0

I have a Maven project that works correctly. I bought a new computer and the same project, with the same operating system and same maven (it's from the project itself). If I execute:

./mvnw -Pprod package -e

If I do the packaging in the old computer when deploying everything is correct, but if I do it from the new one:

The application will start in 0s...
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/app.war!/WEB-INF/lib/slf4j-simple- 1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/app.war!/WEB-INF/lib/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
Exception in thread "main" java.lang.reflect.InvocationTargetException
...

In some forums I have seen that executing:

mvn dependency:tree

...
[INFO] +- io.dropwizard.metrics:metrics-core:jar:3.2.5:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.25:compile
...
[INFO] +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.9.RELEASE:compile
[INFO] |  +- ch.qos.logback:logback-classic:jar:1.1.11:compile
[INFO] |  |  \- ch.qos.logback:logback-core:jar:1.1.11:compile
[INFO] |  +- org.slf4j:jcl-over-slf4j:jar:1.7.25:compile
[INFO] |  +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] |  \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
...
[INFO] +- org.postgresql:postgresql:jar:9.4-1200-jdbc41:compile
[INFO] |  +- com.github.dblock.waffle:waffle-jna:jar:1.7:runtime
[INFO] |  \- org.slf4j:slf4j-simple:jar:1.7.25:runtime

I have seen options in others such as excluding or changing le pom, but it is the same pom that works correctly on my old computer. Could it be for another reason?

Jose
  • 1,779
  • 4
  • 26
  • 50
  • So, the computer is new, same OS, same maven version. What about the Container (tomcat or whatever you use) ? Did it changed? I Since you said that nothing changed and didn't mentioned your container I would bet on it. Maybe your new container has the same dependency and it is causing the problem. You should also set up your project in debug mode and see the full stack trace of the problem. – Jorge Campos Apr 16 '19 at 16:03
  • The tomcat and maven are integrated into the project, it is generated with Jhipster, it does not depend on my operating system, I think. The error it gives is when deploying in production and is indicated above. Greetings. – Jose Apr 16 '19 at 16:15
  • Well the error is clear enough on how to be solved. There are conflicts that need to be resolved in your POM configuration level (that you already found out) and for reference here is a link https://stackoverflow.com/a/49269738/460557. So my best guess is on [Maven conflict resolution](https://maven.apache.org/plugins/maven-dependency-plugin/examples/resolving-conflicts-using-the-dependency-tree.html) being changed from one machine to another (I wouldn't know why though.) I would recommend you to compare both packages (unzip then and compare the files) from old and new machine. Look for diffs – Jorge Campos Apr 16 '19 at 19:04

0 Answers0