ExecDashboard icon indicating copy to clipboard operation
ExecDashboard copied to clipboard

Runtime Issues related to JAR conflicts on master branch of exec-analysis jar aka "Metrics Collector"

Open benMain opened this issue 3 years ago • 0 comments

I'm currently receiving a significant number of runtime errors on the master branch of this project as I attempt to run the metrics collector locally before containerizing it. It may be an issue with the config I'm using for the metrics collector, so I've attached that as well.

Reproduction Steps:

  1. Ensure that the CMDB collections is seeded with Business Services (app type records) and Business Application (component type records).
  2. Ensure that there is a Team Dashboard that is mapped to the seeded CMDB records through the UI via Business Service and Business Application config fields of "regular" hygieia.
  3. git clone this repo and mvn package the exec-analysis jar or "metrics collector" as I understand it to be called.
  4. Attempting to run the jar locally java -jar target/exec-analysis-1.0.0-SNAPSHOT.jar --spring.config.location=target/analysis.properties immediately produces the a ClassNotDef error: java.lang.NoClassDefFoundError: Lcom/mongodb/MongoDriverInformation; I've attached the full stack trace. metric-collector-stack-trace.txt

Further steps I've taken: It was pretty clear that this was a jar conflict between Apache Spark and Spring Data MongoDB. Can I ask why Apache Spark was introduced into this project. The metrics collector itself not a distributed application, so it doesn't really make sense to me. It seems someone was either uncomfortable with the Spring Data api for mongo, or I don't know, but blending big frameworks like Spark and Spring is a recipe for pain, IMO. So fine, I try locking the exec-analysis pom dependency to the Mongo Spark Drivers' known compatibility version for Spark 2.3.3.

        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongo-java-driver</artifactId>
            <version>3.11.3</version>
        </dependency>

That gets me past the NoClassDefFoundErrror for Spring/Spark mongo jar conflicts and lands me squarely in janino hell incompatibility between Spark and Spring. janino-error.txt

Has anyone actually tried to run the master branch recently? Here is my config. analysis.properties.txt

benMain avatar Apr 06 '21 20:04 benMain