AbstractMethodError from slf4j in Spring Project - java

I have a Spring application with Hibernate as persistency layer. For logging I'am using slf4j with log4j as binding.
My pom.xml looks like this.
<properties>
<spring.version>3.2.0.RELEASE</spring.version>
<hibernate.version>4.1.0.Final</hibernate.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<!--DEPENDENCYS FOR HIBERNATE-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>${hibernate.version}</version>
</dependency>
<!--DEPENDENCY FOR BEANVALIDATION-->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>${hibernate.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--DRIVER FOR MYSQL-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.18</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-extras</artifactId>
<version>2.2.2</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--REQUIRED FOR FILEUPLOAD-->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.3</version>
</dependency>
<!--LIB FOR JSON CONVERTING-->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.12</version>
</dependency>
<!-- Solr -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-solr</artifactId>
<version>1.0.0.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-core</artifactId>
<version>4.4.0</version>
<exclusions>
<exclusion>
<artifactId>slf4j-jdk14</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--Logging-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.7</version>
</dependency>
So, when I deploy this application on a tomcat7 on Ubuntu with Java 1.8 everything works fine (My laptop). But when I'm trying to deploy it on the production system (Win 8, Java 7, Tomcat7 and Tomcat8 tried) I get the following error:
21-Oct-2014 17:57:50.016 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
21-Oct-2014 17:57:50.079 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
21-Oct-2014 17:57:50.079 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.AbstractMethodError: org.slf4j.impl.JDK14LoggerAdapter.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.java:159)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:272)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5221)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:919)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1703)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
The standard error says "startup failed due to previous errors"...
Any Ideas what could be the reason?
EDIT
The dependency tree from 'mvn dependency:tree' looks like this:
[INFO] +- org.springframework:spring-core:jar:3.2.0.RELEASE:compile
[INFO] | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- org.springframework:spring-web:jar:3.2.0.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:3.2.0.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:3.2.0.RELEASE:compile
[INFO] | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | \- org.springframework:spring-beans:jar:3.2.0.RELEASE:compile
[INFO] +- javax.servlet:servlet-api:jar:2.5:provided
[INFO] +- javax.servlet.jsp:jsp-api:jar:2.1:provided (scope not updated to compile)
[INFO] +- org.springframework:spring-webmvc:jar:3.2.0.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:3.2.0.RELEASE:compile
[INFO] +- org.springframework:spring-test:jar:3.2.0.RELEASE:test
[INFO] +- org.springframework:spring-orm:jar:3.2.0.RELEASE:compile
[INFO] | +- org.springframework:spring-jdbc:jar:3.2.0.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:3.2.0.RELEASE:compile
[INFO] +- org.hibernate:hibernate-core:jar:4.1.0.Final:compile
[INFO] | +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] | +- antlr:antlr:jar:2.7.7:compile
[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.0.Final:compile
[INFO] | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] | +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.1.0.CR2:compile
[INFO] | +- org.javassist:javassist:jar:3.15.0-GA:compile
[INFO] | \- org.hibernate.common:hibernate-commons-annotations:jar:4.0.1.Final:compile
[INFO] +- org.hibernate:hibernate-c3p0:jar:4.1.0.Final:compile
[INFO] | \- c3p0:c3p0:jar:0.9.1:compile
[INFO] +- org.hibernate:hibernate-validator:jar:4.1.0.Final:compile
[INFO] | \- javax.validation:validation-api:jar:1.0.0.GA:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.18:compile
[INFO] +- junit:junit:jar:4.8.2:test
[INFO] +- jstl:jstl:jar:1.2:compile
[INFO] +- org.apache.tiles:tiles-extras:jar:2.2.2:compile
[INFO] | +- org.apache.tiles:tiles-core:jar:2.2.2:compile
[INFO] | | +- org.apache.tiles:tiles-api:jar:2.2.2:compile
[INFO] | | \- commons-digester:commons-digester:jar:2.0:compile
[INFO] | | \- commons-beanutils:commons-beanutils:jar:1.8.0:compile
[INFO] | +- org.apache.tiles:tiles-servlet-wildcard:jar:2.2.2:compile
[INFO] | | \- org.apache.tiles:tiles-servlet:jar:2.2.2:compile
[INFO] | +- org.apache.tiles:tiles-jsp:jar:2.2.2:compile
[INFO] | | \- org.apache.tiles:tiles-template:jar:2.2.2:compile
[INFO] | +- org.apache.tiles:tiles-freemarker:jar:2.2.2:compile
[INFO] | | \- org.freemarker:freemarker:jar:2.3.15:compile
[INFO] | +- org.apache.tiles:tiles-velocity:jar:2.2.2:compile
[INFO] | | \- org.apache.velocity:velocity-tools:jar:2.0:compile
[INFO] | | +- oro:oro:jar:2.0.8:compile
[INFO] | | \- org.apache.velocity:velocity:jar:1.6.2:compile
[INFO] | +- org.apache.tiles:tiles-el:jar:2.2.2:compile
[INFO] | +- org.apache.tiles:tiles-mvel:jar:2.2.2:compile
[INFO] | | \- org.mvel:mvel2:jar:2.0.11:compile
[INFO] | +- org.apache.tiles:tiles-ognl:jar:2.2.2:compile
[INFO] | | \- ognl:ognl:jar:2.7.3:compile
[INFO] | | \- jboss:javassist:jar:3.7.ga:compile
[INFO] | \- org.apache.tiles:tiles-compat:jar:2.2.2:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.2.1:compile
[INFO] +- commons-io:commons-io:jar:1.3:compile
[INFO] +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.12:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.12:compile
[INFO] +- org.springframework.data:spring-data-solr:jar:1.0.0.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-commons:jar:1.6.1.RELEASE:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.2.2:compile
[INFO] | | \- org.apache.httpcomponents:httpcore:jar:4.2.2:compile
[INFO] | +- org.apache.httpcomponents:httpmime:jar:4.2.2:compile
[INFO] | +- org.apache.httpcomponents:httpclient-cache:jar:4.2.2:compile
[INFO] | \- org.apache.solr:solr-solrj:jar:4.3.1:compile
[INFO] | +- org.apache.zookeeper:zookeeper:jar:3.4.5:compile
[INFO] | \- org.noggit:noggit:jar:0.5:compile
[INFO] +- org.apache.solr:solr-core:jar:4.4.0:compile
[INFO] | +- org.apache.lucene:lucene-core:jar:4.4.0:compile
[INFO] | +- org.apache.lucene:lucene-codecs:jar:4.4.0:compile
[INFO] | +- org.apache.lucene:lucene-analyzers-common:jar:4.4.0:compile
[INFO] | +- org.apache.lucene:lucene-analyzers-kuromoji:jar:4.4.0:compile
[INFO] | +- org.apache.lucene:lucene-analyzers-phonetic:jar:4.4.0:compile
[INFO] | +- org.apache.lucene:lucene-highlighter:jar:4.4.0:compile
[INFO] | +- org.apache.lucene:lucene-memory:jar:4.4.0:compile
[INFO] | +- org.apache.lucene:lucene-misc:jar:4.4.0:compile
[INFO] | +- org.apache.lucene:lucene-queryparser:jar:4.4.0:compile
[INFO] | +- org.apache.lucene:lucene-spatial:jar:4.4.0:compile
[INFO] | | \- com.spatial4j:spatial4j:jar:0.3:compile
[INFO] | +- org.apache.lucene:lucene-suggest:jar:4.4.0:compile
[INFO] | +- org.apache.lucene:lucene-grouping:jar:4.4.0:compile
[INFO] | +- org.apache.lucene:lucene-queries:jar:4.4.0:compile
[INFO] | +- com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.2:compile
[INFO] | +- commons-codec:commons-codec:jar:1.7:compile
[INFO] | +- commons-cli:commons-cli:jar:1.2:compile
[INFO] | +- joda-time:joda-time:jar:2.2:compile
[INFO] | +- org.apache.hadoop:hadoop-annotations:jar:2.0.5-alpha:compile
[INFO] | | \- jdk.tools:jdk.tools:jar:1.6:system
[INFO] | +- org.apache.hadoop:hadoop-auth:jar:2.0.5-alpha:compile
[INFO] | +- org.apache.hadoop:hadoop-common:jar:2.0.5-alpha:compile
[INFO] | | +- org.mortbay.jetty:jetty:jar:6.1.26:compile
[INFO] | | +- org.mortbay.jetty:jetty-util:jar:6.1.26:compile
[INFO] | | +- commons-configuration:commons-configuration:jar:1.6:compile
[INFO] | | \- com.google.protobuf:protobuf-java:jar:2.4.0a:compile
[INFO] | +- org.apache.hadoop:hadoop-hdfs:jar:2.0.5-alpha:compile
[INFO] | +- org.restlet.jee:org.restlet:jar:2.1.1:compile
[INFO] | +- org.restlet.jee:org.restlet.ext.servlet:jar:2.1.1:compile
[INFO] | +- commons-lang:commons-lang:jar:2.6:compile
[INFO] | +- com.google.guava:guava:jar:14.0.1:compile
[INFO] | \- org.codehaus.woodstox:wstx-asl:jar:3.2.7:runtime
[INFO] \- org.slf4j:slf4j-log4j12:jar:1.7.7:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.7.7:compile
[INFO] \- log4j:log4j:jar:1.2.17:compile
EDIT 2
so... Now I tried to exclude the commons-logging things from my projects pom.xml. But it was also not very effective. The error message stays exactly the same... But I recognised something very interesting...
When I open the output war (I generate it with mvn clean install) with an archive manager and navigate to the WEB-INF/lib folder i can see all the jar-files, which were in my pom.xml during the past. So, there are the jars of 3 different versions of slf4j, multiple log4j versions and many other libs, which could be in conflict.
The strange thing is, that all these jar-files does not appear in the mvn dependency:tree.
Any idea, how I can get rid of those files?

Related

Maven compilation error about missing javax/mail/mail/1.4/activation.jar. How to fix?

I have imported my maven project into eclipse. The project works with another eclipse on a different machine.
I get the following compilation error:
[ERROR] bad path element "/home/ps/.m2/repository/javax/mail/mail/1.4/activation.jar": no such file or directory
When I look at the m2, there indeed is no activation.jar.
When I look at the copy on another machine, the only difference I see is it has ojdbc6.jar in the referenced libraries list. All other libraries come from M2.
However, looking at the manifest of javax/mail/mail/1.4/mail-1.4.jar with
jar xf ~/.m2/repository/javax/mail/mail/1.4/mail-1.4.jar META-INF/MANIFEST.MF; grep -i 'class-path' META-INF/MANIFEST.MF; I find it has activation.jar in the class-path. Is this the cause of the compilation error?
Maybe I should also mention that I had to change the java version settings on the machine from 1.6 to 1.8 because the new machine doesn't have 1.6.
pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxxmonitor</groupId>
<artifactId>xxx</artifactId>
<name>cdxxx</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.6</java-version>
<org.springframework-version>3.1.1.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.0.0.GA</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.6.0.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.0.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>20030825.184428</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>20030825.183949</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.6</version>
</dependency>
<!-- <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId>
<version>5.1.21</version> <scope>runtime</scope> </dependency> -->
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>1.9.5</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
<!-- Email -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-io</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>commons-email</groupId>
<artifactId>commons-email</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
<type>jar</type>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>compile</scope>
</dependency>
<!-- #Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap-core</artifactId>
<version>2.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-ldap</artifactId>
<version>3.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.james</groupId>
<artifactId>apache-mime4j-core</artifactId>
<version>0.7.2</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>javax.mail-api</artifactId>
<version>1.5.0-b01</version>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.5.3</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.53</version>
</dependency>
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId>
<version>1.9.1</version>
</dependency>
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt-spring31</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.samba.jcifs</groupId>
<artifactId>jcifs</artifactId>
<version>1.3.14-kohsuke-1</version>
</dependency>
<dependency>
<groupId>org.opensmpp</groupId>
<artifactId>opensmpp-core</artifactId>
<version>3.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/httpunit/httpunit -->
<dependency>
<groupId>httpunit</groupId>
<artifactId>httpunit</artifactId>
<version>1.7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mozilla/rhino -->
<dependency>
<groupId>org.mozilla</groupId>
<artifactId>rhino</artifactId>
<version>1.7.10</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
Desired behavior: the project should compile without errors.
I created a dependency tree, but I don't understand it:
ps#REGULUS:~/Projects/xxx-monitoring/xxx2$ mvn dependency:tree -Dverbose
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building cdxxx 1.0.0-BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # xxx ---
[INFO] com.xxxmonitor:xxx:war:1.0.0-BUILD-SNAPSHOT
[INFO] +- org.springframework:spring-context:jar:3.1.1.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:3.1.1.RELEASE:compile
[INFO] | | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | | +- (org.springframework:spring-asm:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-beans:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | +- org.springframework:spring-beans:jar:3.1.1.RELEASE:compile
[INFO] | | \- (org.springframework:spring-core:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | +- org.springframework:spring-core:jar:3.1.1.RELEASE:compile
[INFO] | | \- (org.springframework:spring-asm:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | +- org.springframework:spring-expression:jar:3.1.1.RELEASE:compile
[INFO] | | \- (org.springframework:spring-core:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | \- org.springframework:spring-asm:jar:3.1.1.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc:jar:3.1.1.RELEASE:compile
[INFO] | +- (org.springframework:spring-asm:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-beans:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-context:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | +- org.springframework:spring-context-support:jar:3.1.1.RELEASE:compile
[INFO] | | +- (org.springframework:spring-beans:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-context:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-expression:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | \- org.springframework:spring-web:jar:3.1.1.RELEASE:compile
[INFO] | +- (aopalliance:aopalliance:jar:1.0:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-beans:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-context:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | \- (org.springframework:spring-core:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] +- org.springframework:spring-orm:jar:3.1.1.RELEASE:compile
[INFO] | +- (org.springframework:spring-beans:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | +- org.springframework:spring-jdbc:jar:3.1.1.RELEASE:compile
[INFO] | | +- (org.springframework:spring-beans:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-core:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | | \- (org.springframework:spring-tx:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | \- org.springframework:spring-tx:jar:3.1.1.RELEASE:compile
[INFO] | +- (aopalliance:aopalliance:jar:1.0:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-aop:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-beans:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-context:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] | \- (org.springframework:spring-core:jar:3.1.1.RELEASE:compile - omitted for duplicate)
[INFO] +- org.hibernate:hibernate-validator:jar:4.0.0.GA:compile
[INFO] | +- javax.validation:validation-api:jar:1.0.0.GA:compile
[INFO] | +- (org.slf4j:slf4j-api:jar:1.5.6:compile - omitted for conflict with 1.6.6)
[INFO] | +- javax.xml.bind:jaxb-api:jar:2.1:compile
[INFO] | | +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] | | \- (javax.activation:activation:jar:1.1:compile - omitted for duplicate)
[INFO] | \- com.sun.xml.bind:jaxb-impl:jar:2.1.3:compile
[INFO] | \- (javax.xml.bind:jaxb-api:jar:2.1:compile - omitted for duplicate)
[INFO] +- org.hibernate:hibernate-entitymanager:jar:3.6.0.Final:compile
[INFO] | +- org.hibernate:hibernate-core:jar:3.6.0.Final:compile
[INFO] | | +- antlr:antlr:jar:2.7.6:compile
[INFO] | | +- commons-collections:commons-collections:jar:3.1:compile
[INFO] | | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | +- org.hibernate:hibernate-commons-annotations:jar:3.2.0.Final:compile
[INFO] | | | \- (org.slf4j:slf4j-api:jar:1.5.8:compile - omitted for conflict with 1.5.6)
[INFO] | | +- (org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final:compile - omitted for duplicate)
[INFO] | | +- javax.transaction:jta:jar:1.1:compile
[INFO] | | \- (org.slf4j:slf4j-api:jar:1.6.1:compile - omitted for conflict with 1.5.6)
[INFO] | +- cglib:cglib:jar:2.2:compile
[INFO] | | \- asm:asm:jar:3.1:compile
[INFO] | +- javassist:javassist:jar:3.12.0.GA:compile
[INFO] | +- (org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final:compile - omitted for duplicate)
[INFO] | \- (org.slf4j:slf4j-api:jar:1.6.1:compile - omitted for conflict with 1.5.6)
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final:compile
[INFO] +- taglibs:standard:jar:1.1.2:compile
[INFO] +- commons-dbcp:commons-dbcp:jar:20030825.184428:compile
[INFO] +- commons-pool:commons-pool:jar:20030825.183949:compile
[INFO] +- commons-net:commons-net:jar:2.0:compile
[INFO] +- commons-codec:commons-codec:jar:1.6:compile
[INFO] +- org.liquibase:liquibase-core:jar:1.9.5:compile
[INFO] +- org.codehaus.jackson:jackson-mapper-asl:jar:1.7.1:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.7.1:compile
[INFO] +- com.googlecode.json-simple:json-simple:jar:1.1:compile
[INFO] +- commons-io:commons-io:jar:1.3.2:compile
[INFO] +- org.apache.commons:commons-email:jar:1.1:compile
[INFO] | +- javax.mail:mail:jar:1.4:compile
[INFO] | | \- (javax.activation:activation:jar:1.1:compile - omitted for duplicate)
[INFO] | \- javax.activation:activation:jar:1.1:compile
[INFO] +- commons-lang:commons-lang:jar:2.4:compile
[INFO] +- org.aspectj:aspectjrt:jar:1.6.10:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.6.6:compile
[INFO] +- org.slf4j:jcl-over-slf4j:jar:1.6.6:runtime
[INFO] | \- (org.slf4j:slf4j-api:jar:1.6.6:runtime - omitted for duplicate)
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.6:runtime
[INFO] | +- (org.slf4j:slf4j-api:jar:1.6.6:runtime - omitted for duplicate)
[INFO] | \- (log4j:log4j:jar:1.2.17:runtime - omitted for conflict with 1.2.15)
[INFO] +- log4j:log4j:jar:1.2.15:compile
[INFO] +- javax.inject:javax.inject:jar:1:compile
[INFO] +- javax.servlet:servlet-api:jar:2.5:provided (scope not updated to compile)
[INFO] +- javax.servlet.jsp:jsp-api:jar:2.1:provided
[INFO] +- javax.servlet:jstl:jar:1.2:compile
[INFO] +- junit:junit:jar:4.7:test
[INFO] +- org.quartz-scheduler:quartz:jar:2.2.1:compile
[INFO] | +- c3p0:c3p0:jar:0.9.1.1:compile
[INFO] | \- (org.slf4j:slf4j-api:jar:1.6.6:compile - omitted for duplicate)
[INFO] +- org.springframework.ldap:spring-ldap-core:jar:2.0.2.RELEASE:compile
[INFO] | +- (org.springframework:spring-tx:jar:3.2.8.RELEASE:compile - omitted for conflict with 3.1.1.RELEASE)
[INFO] | +- org.springframework.data:spring-data-commons:jar:1.6.1.RELEASE:compile
[INFO] | | +- (org.springframework:spring-core:jar:3.1.4.RELEASE:compile - omitted for conflict with 3.1.1.RELEASE)
[INFO] | | +- (org.springframework:spring-beans:jar:3.1.4.RELEASE:compile - omitted for conflict with 3.1.1.RELEASE)
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.1:compile - omitted for conflict with 1.6.6)
[INFO] | | \- (org.slf4j:jcl-over-slf4j:jar:1.7.1:runtime - omitted for conflict with 1.6.6)
[INFO] | +- (org.springframework:spring-beans:jar:3.2.8.RELEASE:compile - omitted for conflict with 3.1.1.RELEASE)
[INFO] | \- (org.springframework:spring-core:jar:3.2.8.RELEASE:compile - omitted for conflict with 3.1.1.RELEASE)
[INFO] +- org.springframework.security:spring-security-ldap:jar:3.0.1.RELEASE:compile
[INFO] | +- org.springframework.security:spring-security-core:jar:3.0.1.RELEASE:compile
[INFO] | | +- (org.springframework:spring-expression:jar:3.0.0.RELEASE:compile - omitted for conflict with 3.1.1.RELEASE)
[INFO] | | +- (org.springframework:spring-core:jar:3.0.0.RELEASE:compile - omitted for conflict with 3.1.1.RELEASE)
[INFO] | | +- (org.springframework:spring-context:jar:3.0.0.RELEASE:compile - omitted for conflict with 3.1.1.RELEASE)
[INFO] | | +- (org.springframework:spring-tx:jar:3.0.0.RELEASE:compile - omitted for conflict with 3.1.1.RELEASE)
[INFO] | | +- (org.springframework:spring-aop:jar:3.0.0.RELEASE:compile - omitted for conflict with 3.1.1.RELEASE)
[INFO] | | +- (org.aspectj:aspectjrt:jar:1.6.5:compile - omitted for conflict with 1.6.10)
[INFO] | | +- org.aspectj:aspectjweaver:jar:1.6.5:compile
[INFO] | | \- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for duplicate)
[INFO] | +- (org.springframework.ldap:spring-ldap-core:jar:1.3.0.RELEASE:compile - omitted for conflict with 2.0.2.RELEASE)
[INFO] | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- org.apache.james:apache-mime4j-core:jar:0.7.2:compile
[INFO] +- javax.mail:javax.mail-api:jar:1.5.0-b01:compile
[INFO] | \- (javax.activation:activation:jar:1.1:compile - omitted for duplicate)
[INFO] +- com.sun.mail:javax.mail:jar:1.5.3:compile
[INFO] | \- (javax.activation:activation:jar:1.1:compile - omitted for duplicate)
[INFO] +- com.jcraft:jsch:jar:0.1.53:compile
[INFO] +- org.jasypt:jasypt:jar:1.9.1:compile
[INFO] +- org.jasypt:jasypt-spring31:jar:1.9.2:compile
[INFO] | \- (org.jasypt:jasypt:jar:1.9.2:compile - omitted for conflict with 1.9.1)
[INFO] +- org.samba.jcifs:jcifs:jar:1.3.14-kohsuke-1:compile
[INFO] +- org.opensmpp:opensmpp-core:jar:3.0.0:compile
[INFO] | \- org.opensmpp:opensmpp-charset:jar:3.0.0:compile
[INFO] +- httpunit:httpunit:jar:1.7:compile
[INFO] | +- (javax.servlet:servlet-api:jar:2.3:compile - omitted for conflict with 2.5)
[INFO] | \- jtidy:jtidy:jar:4aug2000r7-dev:compile
[INFO] \- org.mozilla:rhino:jar:1.7.10:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.346 s
[INFO] Finished at: 2020-02-20T16:34:22+01:00
[INFO] Final Memory: 33M/1932M
[INFO] ------------------------------------------------------------------------
I updated two dependencies, which I spotted because of conflicts in the dependency tree.
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-email</artifactId>
<version>1.5</version>
<!-- <version>1.1</version> -->
</dependency>
I could not use version 6.1.2.Final of hibernate-validator because tomcat 7 has issues with it.
<!-- https://mvnrepository.com/artifact/org.hibernate.validator/hibernate-validator -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.2.0.Final</version>
<scope>compile</scope>
</dependency>
It looks like it helped, I only have the character encoding errors left in the compilation output.
The character encoding issues have been fixed temporarily by:
<properties>
..
<project.build.sourceEncoding>Cp1252</project.build.sourceEncoding>
</properties>

Invocation of init method failed; nested exception is java.lang.NoSuchMethodError after adding Hibernate envers

I'm trying to add hibernate-envers to one of our Spring MVC project. My entity classes are in separate maven module and I'm using envers there and then install this as local maven repo and use in my actual Spring project as dependency. Everything works okay without envers.
My dependency tree in Spring project for hibernate is:
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] +- org.hibernate:hibernate-core:jar:5.3.9.Final:compile
[INFO] | \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.4.Final:compile
[INFO] +- org.hibernate:hibernate-ehcache:jar:5.3.9.Final:compile
[INFO] | \- (org.hibernate:hibernate-core:jar:5.3.9.Final:compile - omitted for duplicate)
[INFO] +- org.hibernate:hibernate-spatial:jar:5.3.9.Final:compile
[INFO] | \- (org.hibernate:hibernate-core:jar:5.3.9.Final:compile - omitted for duplicate)
[INFO] +- az.asdf.dcs:az.asdf.dcs.core:jar:1.1:compile
[INFO] | +- (org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile - omitted for duplicate)
[INFO] | +- (org.hibernate:hibernate-core:jar:4.3.6.Final:compile - omitted for conflict with 5.3.9.Final)
[INFO] | +- (org.hibernate:hibernate-spatial:jar:4.3-SNAPSHOT:compile - omitted for conflict with 5.3.9.Final)
[INFO] | \- (org.hibernate:hibernate-envers:jar:5.3.9.Final:compile - omitted for duplicate)
[INFO] \- org.hibernate:hibernate-envers:jar:5.3.9.Final:compile
[INFO] \- (org.hibernate:hibernate-core:jar:5.3.9.Final:compile - omitted for duplicate)
and for Spring dependencies:
[INFO] +- org.springframework:spring-core:jar:4.3.3.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc:jar:4.3.3.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.3.3.RELEASE:compile
[INFO] | | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- org.springframework:spring-beans:jar:4.3.3.RELEASE:compile
[INFO] | | \- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- org.springframework:spring-context:jar:4.3.3.RELEASE:compile
[INFO] | | +- (org.springframework:spring-aop:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | | \- (org.springframework:spring-expression:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- org.springframework:spring-expression:jar:4.3.3.RELEASE:compile
[INFO] | | \- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | \- org.springframework:spring-web:jar:4.3.3.RELEASE:compile
[INFO] | +- (org.springframework:spring-aop:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-context:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | \- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] +- org.springframework:spring-tx:jar:4.3.3.RELEASE:compile
[INFO] | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | \- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] +- org.springframework:spring-orm:jar:4.3.3.RELEASE:compile
[INFO] | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- org.springframework:spring-jdbc:jar:4.3.3.RELEASE:compile
[INFO] | | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | | \- (org.springframework:spring-tx:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] | \- (org.springframework:spring-tx:jar:4.3.3.RELEASE:compile - omitted for duplicate)
[INFO] +- org.springframework:spring-aspects:jar:4.3.3.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-core:jar:4.2.4.RELEASE:compile
[INFO] | +- (org.springframework:spring-aop:jar:4.3.12.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] | +- (org.springframework:spring-beans:jar:4.3.12.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] | +- (org.springframework:spring-context:jar:4.3.12.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] | +- (org.springframework:spring-core:jar:4.3.12.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] | \- (org.springframework:spring-expression:jar:4.3.12.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] +- org.springframework.security:spring-security-web:jar:4.2.4.RELEASE:compile
[INFO] | +- (org.springframework.security:spring-security-core:jar:4.2.4.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-beans:jar:4.3.12.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] | +- (org.springframework:spring-context:jar:4.3.12.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] | +- (org.springframework:spring-core:jar:4.3.12.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] | +- (org.springframework:spring-expression:jar:4.3.12.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] | \- (org.springframework:spring-web:jar:4.3.12.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] +- org.springframework.security:spring-security-config:jar:4.2.4.RELEASE:compile
[INFO] | +- (org.springframework.security:spring-security-core:jar:4.2.4.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-aop:jar:4.3.12.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] | +- (org.springframework:spring-beans:jar:4.3.12.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] | +- (org.springframework:spring-context:jar:4.3.12.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] | \- (org.springframework:spring-core:jar:4.3.12.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] \- az.asdf.dcs:az.asdf.dcs.core:jar:1.1:compile
[INFO] \- org.springframework.data:spring-data-cassandra:jar:2.0.2.RELEASE:compile
[INFO] +- (org.springframework:spring-context:jar:5.0.2.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] +- (org.springframework:spring-beans:jar:5.0.2.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] +- (org.springframework:spring-core:jar:5.0.2.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] +- (org.springframework:spring-tx:jar:5.0.2.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] +- (org.springframework:spring-expression:jar:5.0.2.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] \- org.springframework.data:spring-data-commons:jar:2.0.2.RELEASE:compile
[INFO] +- (org.springframework:spring-core:jar:5.0.2.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
[INFO] \- (org.springframework:spring-beans:jar:5.0.2.RELEASE:compile - omitted for conflict with 4.3.3.RELEASE)
I don't see any version conflicts here. But when I try to run I get this exception:
Unsatisfied dependency expressed through field 'sessionFactory';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sessionFactory' defined in class path resource [Spring-Hibernate.xml]:
Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.envers.configuration.internal.GlobalConfiguration.<init>(Lorg/hibernate/envers/boot/internal/EnversService;Ljava/util/Map;)V]]
Any suggestions are welcome.
UPDATE: Here are my pom.xml's in both core and Spring projects:
Core module:
<dependencies>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.6.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-spatial</artifactId>
<version>4.3-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-envers -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
<version>5.3.9.Final</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-cassandra</artifactId>
<version>2.0.2.RELEASE</version>
</dependency>
</dependencies>
Spring project:
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<springframework.version>4.3.3.RELEASE</springframework.version>
<spring.security.version>4.2.4.RELEASE</spring.security.version>
<hibernate.version>5.3.9.Final</hibernate.version>
</properties>
<dependencies>
<!--Spring resources-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${springframework.version}</version>
</dependency>
<!-- Spring + aspects -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${springframework.version}</version>
</dependency>
<!-- Spring Security -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${spring.security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${spring.security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring.security.version}</version>
</dependency>
<!--Spring resources-->
<!--Hybernate resources-->
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>2.6.11</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-spatial</artifactId>
<version>${hibernate.version}</version>
</dependency>
<!--Hybernate resources-->
<!-- Apache Commons Upload -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.3.2</version>
</dependency>
<!-- Apache Commons Upload -->
<!--for Log-->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!--for Log-->
<!---->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1211.jre7</version>
</dependency>
<!--Jackson JSON Parser-->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.7.5</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.6.3</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<version>1.1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.11</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>az.asdf.dcs</groupId>
<artifactId>az.asdf.dcs.core</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
<version>${hibernate.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.asteriskjava/asterisk-java -->
<dependency>
<groupId>org.asteriskjava</groupId>
<artifactId>asterisk-java</artifactId>
<version>2.0.2</version>
</dependency>
</dependencies>
spring-core, spring-webmvc, spring-tx are already inside spring-orm.
Check here : https://mvnrepository.com/artifact/org.springframework/spring-REPLACE-ME/usages
Same stuff for spring-sercurity-web spring-security-core are inside spring-security-config
You also have conflicts with versions on depndencies logged with
omitted for conflict with 4.3.3.RELEASE
Your dependencies clearly state that you're trying to use Hibernate ORM 4.3.6.Final with Hibernate Envers 5.3.9.Final in your code module. As others have mentioned several times this is a dependency conflict.
In short the version of Hibernate Envers should be identical to that of Hibernate Core.

java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.clearCache()V

I am getting this run-time error:
java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.clearCache()V
And part of stack trace:
Caused By: java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.clearCache()V
at org.springframework.context.support.AbstractApplicationContext.resetCommonCaches(AbstractApplicationContext.j
ava:915)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:575)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:409
)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
Here are my Spring dependencies in the pom.xml:
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>2.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${springframework.version}</version>
</dependency>
Here is ${springframework.version}:
<properties>
<springframework.version>5.0.4.RELEASE</springframework.version>
</properties>
The important part is that I am only getting this run-time error when I add any of the org.springframework.security dependencies; I do not get this error when I don't include any of them.
Here is output of mvn dependency:tree:
+- ora.common.logging:common-logging:jar:1.2.0:system
+- ognl:ognl:jar:3.2.6:compile
| \- org.javassist:javassist:jar:3.20.0-GA:compile
+- org.apache.hivemind:hivemind-framework:jar:2.0-alpha-1:compile
| +- commons-logging:commons-logging:jar:1.0.3:compile
| \- jboss:javassist:jar:3.4.ga:compile
+- xml-apis:xml-apis:jar:1.0.b2:provided
+- org.hibernate:hibernate-core:jar:5.2.16.Final:compile
| +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
| +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
| +- antlr:antlr:jar:2.7.7:compile
| +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.0.1.Final:compile
| +- org.jboss:jandex:jar:2.0.3.Final:compile
| +- com.fasterxml:classmate:jar:1.3.0:compile
| +- dom4j:dom4j:jar:1.6.1:compile
| \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
+- org.springframework.security:spring-security-core:jar:5.0.4.RELEASE:compile
| +- org.springframework:spring-aop:jar:5.0.5.RELEASE:compile
| +- org.springframework:spring-beans:jar:5.0.5.RELEASE:compile
| +- org.springframework:spring-context:jar:5.0.5.RELEASE:compile
| \- org.springframework:spring-expression:jar:5.0.5.RELEASE:compile
+- org.springframework.security:spring-security-web:jar:5.0.4.RELEASE:compile
+- org.springframework.security:spring-security-config:jar:5.0.4.RELEASE:compile
+- org.springframework:spring-web:jar:5.0.4.RELEASE:compile
+- org.springframework:spring-webmvc:jar:5.0.4.RELEASE:compile
+- org.springframework:spring-core:jar:5.0.4.RELEASE:compile
| \- org.springframework:spring-jcl:jar:5.0.4.RELEASE:compile
+- org.springframework:spring-orm:jar:5.0.4.RELEASE:compile
| +- org.springframework:spring-jdbc:jar:5.0.4.RELEASE:compile
| \- org.springframework:spring-tx:jar:5.0.4.RELEASE:compile
+- org.springframework.data:spring-data-jpa:jar:2.0.2.RELEASE:compile
| \- org.springframework.data:spring-data-commons:jar:2.0.2.RELEASE:compile
+- org.springframework:spring-context-support:jar:5.0.4.RELEASE:compile
+- org.springframework:spring-aspects:jar:5.0.4.RELEASE:compile
+- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
+- com.fasterxml.jackson.core:jackson-databind:jar:2.9.0:compile
+- com.fasterxml.jackson.core:jackson-core:jar:2.9.0:compile
+- org.eclipse.persistence:org.eclipse.persistence.jpa:jar:2.6.4:compile
| +- org.eclipse.persistence:javax.persistence:jar:2.1.1:compile
| +- org.eclipse.persistence:org.eclipse.persistence.asm:jar:2.6.4:compile
| +- org.eclipse.persistence:org.eclipse.persistence.antlr:jar:2.6.4:compile
| +- org.glassfish:javax.json:jar:1.0.4:compile
| +- org.eclipse.persistence:org.eclipse.persistence.jpa.jpql:jar:2.6.4:compile
| \- org.eclipse.persistence:org.eclipse.persistence.core:jar:2.6.4:compile
+- commons-lang:commons-lang:jar:2.6:compile
+- org.apache.commons:commons-lang3:jar:3.7:compile
+- org.apache.commons:commons-collections4:jar:4.1:compile
+- junit:junit:jar:4.12:test
| \- org.hamcrest:hamcrest-core:jar:1.3:test
+- org.hsqldb:hsqldb:jar:2.3.4:test
+- javax.servlet:javax.servlet-api:jar:3.0.1:provided
+- javax.servlet.jsp:jsp-api:jar:2.1:provided
+- org.slf4j:slf4j-api:jar:1.7.10:compile
+- ch.qos.logback:logback-classic:jar:1.1.2:compile
| \- ch.qos.logback:logback-core:jar:1.1.2:compile
+- org.mapstruct:mapstruct-jdk8:jar:1.2.0.Final:compile
+- org.jvnet.jaxb2_commons:jaxb2-basics:jar:1.11.1:compile
| +- org.jvnet.jaxb2_commons:jaxb2-basics-runtime:jar:1.11.1:compile
| +- org.jvnet.jaxb2_commons:jaxb2-basics-tools:jar:1.11.1:compile
| | +- commons-beanutils:commons-beanutils:jar:1.9.2:compile
| | | \- commons-collections:commons-collections:jar:3.2.1:compile
| | \- org.slf4j:jcl-over-slf4j:jar:1.7.7:compile
| \- com.google.code.javaparser:javaparser:jar:1.0.11:compile
+- org.aspectj:aspectjrt:jar:1.8.13:compile
+- org.aspectj:aspectjweaver:jar:1.8.13:compile
\- net.sf.ehcache:ehcache:jar:2.10.4:compile
I fixed the problem by changing the version of spring security dependencies to:
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>5.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>5.0.1.RELEASE</version>
</dependency>
For me works on:
<spring.version>5.0.8.RELEASE</spring.version>
<spring-security.version>5.0.7.RELEASE</spring-security.version>

PDPage.getStream function does not exist

I am using pdfbox for reading pdf documents.
But i can not use the function getStream for PDPage. Regarding the documentation this functions should exists:
https://pdfbox.apache.org/docs/2.0.0-SNAPSHOT/javadocs/
I am using the 2.0.0 Snapshot version of PdfBox with Maven.
I already tried to download the .jar files from the website and use them instead of the ones from the maven repo, but this did not work either.
The exact error from eclipse is: The method getStream() is undefined for the type PDPage.
Here is the pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.rwth-aachen.prime</groupId>
<artifactId>prime</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>Prime Project</name>
<url>http://maven.apache.org</url>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.10.RELEASE</version>
</parent>
<repositories>
<!-- <repository> <id>libs</id> ${project.basedir} <url>file://${project.basedir}/libs</url>
</repository> -->
<!-- <repository> <id>pdfbox</id> <url>http://repository.apache.org/content/groups/snapshots</url>
</repository> -->
<!-- <repository>
<id>pdfbox</id>
<url>http://repository.apache.org/content/groups/snapshots</url>
</repository>-->
<repository>
<id>ApacheSnapshot</id>
<name>Apache Repository</name>
<url>https://repository.apache.org/content/groups/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>${spring.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- For mime type extraction -->
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-core</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
</dependency>
<!-- <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-rest-webmvc</artifactId>
<version>2.2.0.RELEASE</version> </dependency> -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>4.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.6.Final</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<!-- <version>2.4.3</version> -->
</dependency>
<dependency>
<groupId>com.voodoodyne.jackson.jsog</groupId>
<artifactId>jackson-jsog</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<!-- needed for setting lazy loaded elements = null -->
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-hibernate4</artifactId>
<version>2.4.4</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- Hibernate uses slf4j for logging -->
<!--<dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId>
<version>1.7.5</version> </dependency> -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.32</version>
</dependency>
<!--<dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId>
<version>2.0.2</version> </dependency> -->
<!--<dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId>
<version>2.0.2</version> </dependency> -->
<dependency>
<groupId>org.docx4j</groupId>
<artifactId>docx4j</artifactId>
<version>3.1.0</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<!-- <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId>
</exclusion> -->
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-tools</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15</artifactId>
<version>1.44</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcmail-jdk15</artifactId>
<version>1.44</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.0.7.RELEASE</version>
</dependency>
<!-- <dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency> -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
<finalName>prime</finalName>
</build>
<properties>
<java-version>1.7</java-version>
<spring.version>4.1.0.RELEASE</spring.version>
<spring.security.version>3.2.5.RELEASE</spring.security.version>
<start-class>spring.Application</start-class>
</properties>
</project>
This is the result of mvn dependencie:tree
[INFO] de.rwth-aachen.prime:prime:war:0.0.1-SNAPSHOT
[INFO] +- org.apache.tika:tika-core:jar:1.8:compile
[INFO] +- org.jsoup:jsoup:jar:1.8.1:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.3.2:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.1.10.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.1.10.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.1.10.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.1.10.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.1.10.RELEASE:compile
[INFO] | | | +- org.slf4j:jcl-over-slf4j:jar:1.7.7:compile
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.7:compile
[INFO] | | | +- org.slf4j:log4j-over-slf4j:jar:1.7.7:compile
[INFO] | | | \- ch.qos.logback:logback-classic:jar:1.1.2:compile
[INFO] | | | \- ch.qos.logback:logback-core:jar:1.1.2:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.13:runtime
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.3.4:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-annotations:jar:2.3.4:compile
[INFO] | +- org.hibernate:hibernate-validator:jar:5.0.3.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.0.0:compile
[INFO] | +- org.springframework:spring-core:jar:4.1.0.RELEASE:compile
[INFO] | +- org.springframework:spring-web:jar:4.1.0.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:4.1.0.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.1.10.RELEASE:provided
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:7.0.57:provided
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:7.0.57:provided
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:7.0.57:provided
[INFO] | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:7.0.57:provided
[INFO] +- org.springframework:spring-context:jar:4.1.0.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.1.0.RELEASE:compile
[INFO] | \- org.springframework:spring-beans:jar:4.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:4.1.0.RELEASE:compile
[INFO] | +- org.springframework:spring-jdbc:jar:4.1.0.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:4.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-expression:jar:4.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-test:jar:4.1.0.RELEASE:compile
[INFO] +- org.hibernate:hibernate-core:jar:4.3.6.Final:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile
[INFO] | +- org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile
[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.0.0.Final:compile
[INFO] | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] | +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.5.Final:compile
[INFO] | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] | +- org.javassist:javassist:jar:3.18.1-GA:compile
[INFO] | +- antlr:antlr:jar:2.7.7:compile
[INFO] | \- org.jboss:jandex:jar:1.1.0.Final:compile
[INFO] +- org.apache.commons:commons-dbcp2:jar:2.0:compile
[INFO] | +- org.apache.commons:commons-pool2:jar:2.2:compile
[INFO] | \- commons-logging:commons-logging:jar:1.1.3:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:3.0.1:compile
[INFO] +- javax.servlet.jsp:jsp-api:jar:2.1:provided
[INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.3.4:compile
[INFO] +- com.voodoodyne.jackson.jsog:jackson-jsog:jar:1.0:compile
[INFO] +- com.fasterxml.jackson.datatype:jackson-datatype-hibernate4:jar:2.4.4:compile
[INFO] +- junit:junit:jar:4.11:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- mysql:mysql-connector-java:jar:5.1.32:compile
[INFO] +- org.docx4j:docx4j:jar:3.1.0:compile
[INFO] | +- org.plutext:jaxb-svg11:jar:1.0.2:compile
[INFO] | +- org.plutext:jaxb-xslfo:jar:1.0.1:compile
[INFO] | +- org.plutext:jaxb-xmldsig-core:jar:1.0.0:compile
[INFO] | +- net.engio:mbassador:jar:1.1.10:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.7:compile
[INFO] | +- log4j:log4j:jar:1.2.17:compile
[INFO] | +- commons-lang:commons-lang:jar:2.4:compile
[INFO] | +- commons-codec:commons-codec:jar:1.3:compile
[INFO] | +- commons-io:commons-io:jar:1.3.1:compile
[INFO] | +- org.apache.xmlgraphics:xmlgraphics-commons:jar:1.5:compile
[INFO] | +- org.apache.xmlgraphics:fop:jar:1.1:compile
[INFO] | | +- org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile
[INFO] | | | +- org.apache.xmlgraphics:batik-anim:jar:1.7:compile
[INFO] | | | +- org.apache.xmlgraphics:batik-css:jar:1.7:compile
[INFO] | | | +- org.apache.xmlgraphics:batik-dom:jar:1.7:compile
[INFO] | | | +- org.apache.xmlgraphics:batik-parser:jar:1.7:compile
[INFO] | | | \- org.apache.xmlgraphics:batik-util:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-bridge:jar:1.7:compile
[INFO] | | | +- org.apache.xmlgraphics:batik-script:jar:1.7:compile
[INFO] | | | | \- org.apache.xmlgraphics:batik-js:jar:1.7:compile
[INFO] | | | \- org.apache.xmlgraphics:batik-xml:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-gvt:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-transcoder:jar:1.7:compile
[INFO] | | | \- org.apache.xmlgraphics:batik-svggen:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-extension:jar:1.7:compile
[INFO] | | \- org.apache.xmlgraphics:batik-ext:jar:1.7:compile
[INFO] | +- org.apache.avalon.framework:avalon-framework-api:jar:4.3.1:compile
[INFO] | +- org.apache.avalon.framework:avalon-framework-impl:jar:4.3.1:compile
[INFO] | +- xalan:xalan:jar:2.7.1:compile
[INFO] | | \- xalan:serializer:jar:2.7.1:compile
[INFO] | +- net.arnx:wmf2svg:jar:0.9.0:compile
[INFO] | +- org.apache.poi:poi-scratchpad:jar:3.8:compile
[INFO] | | \- org.apache.poi:poi:jar:3.8:compile
[INFO] | +- org.antlr:antlr-runtime:jar:3.3:compile
[INFO] | \- org.antlr:stringtemplate:jar:3.2.1:compile
[INFO] +- org.apache.pdfbox:pdfbox:jar:2.0.0-SNAPSHOT:compile
[INFO] | \- org.apache.pdfbox:fontbox:jar:2.0.0-SNAPSHOT:compile
[INFO] +- org.apache.pdfbox:pdfbox-tools:jar:2.0.0-SNAPSHOT:compile
[INFO] +- org.bouncycastle:bcprov-jdk15:jar:1.44:compile
[INFO] +- org.bouncycastle:bcmail-jdk15:jar:1.44:compile
[INFO] +- org.springframework.security:spring-security-web:jar:3.2.5.RELEASE:compile
[INFO] | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | \- org.springframework.security:spring-security-core:jar:3.2.5.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-config:jar:3.2.5.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-taglibs:jar:3.2.5.RELEASE:compile
[INFO] | \- org.springframework.security:spring-security-acl:jar:3.2.5.RELEASE:compile
[INFO] +- org.springframework.security.oauth:spring-security-oauth2:jar:2.0.7.RELEASE:compile
[INFO] | \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] \- javax.servlet:jstl:jar:1.2:compile
Does anybody have any idea how to solve this problem?
Best regards

Maven including old versions of dependencies

I am using Maven to build a WAR file with the following parameters: mvn clean package
This builds successfully but when I open up the WAR I see the following:
jackson-core-2.2.3.jar
jackson-core-2.3.0.jar
pushy-0.2.jar
pushy-0.3.jar
This causes problems on our application server (Most likely conflicts), I proved this by manually deleting the old dependencies in the WAR which fixes any issues.
I have checked the Dependency Hierarchy view in Eclipse and I don't see versions 2.2.3 of Jackson or 0.2 of Pushy listed anywhere.
I have also tried deleting my whole .m2 repository but this doesn't seem to have made any difference.
Is there any particular reason why Maven would be including these old JARs?
Pom.xml dependencies:
<dependencies>
<dependency>
<groupId>core</groupId>
<artifactId>core</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.31</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>com.threewks.thundr</groupId>
<artifactId>thundr-mailgun</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.18.1</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
<version>1.18.1</version>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-multipart</artifactId>
<version>1.18.1</version>
</dependency>
</dependencies>
Core.jar pom.xml depdencies:
<dependencies>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>1.1.7</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
</dependency>
<dependency>
<groupId>org.facebook4j</groupId>
<artifactId>facebook4j-core</artifactId>
<version>[2.0,)</version>
</dependency>
<dependency>
<groupId>com.relayrides</groupId>
<artifactId>pushy</artifactId>
<version>0.3</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>javax.mail-api</artifactId>
<version>1.5.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.threewks.thundr</groupId>
<artifactId>thundr-mailgun</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>
Here is the result of running the dependency tree parameter with mvn when building the WAR:
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) # vimbaserver ---
[INFO] vimbaserver:vimbaserver:war:1.0
[INFO] +- core:core:jar:1.0:compile
[INFO] | +- (commons-dbcp:commons-dbcp:jar:1.4:compile - omitted for duplicate)
[INFO] | +- commons-lang:commons-lang:jar:2.3:compile
[INFO] | +- commons-codec:commons-codec:jar:1.5:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.3.0:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.3.0:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.3.0:compile
[INFO] | | +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.3.0:compile - omitted for duplicate)
[INFO] | | \- (com.fasterxml.jackson.core:jackson-core:jar:2.3.0:compile - omitted for duplicate)
[INFO] | +- org.mariadb.jdbc:mariadb-java-client:jar:1.1.7:compile
[INFO] | | +- net.java.dev.jna:jna:jar:3.3.0:compile
[INFO] | | \- net.java.dev.jna:jna:jar:platform:3.3.0:compile
[INFO] | +- junit:junit:jar:4.11:compile
[INFO] | | \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] | +- org.facebook4j:facebook4j-core:jar:2.1.0:compile
[INFO] | +- com.relayrides:pushy:jar:0.3:compile
[INFO] | | +- org.slf4j:slf4j-api:jar:1.7.6:compile
[INFO] | | +- io.netty:netty-all:jar:4.0.18.Final:compile
[INFO] | | \- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] | | \- (junit:junit:jar:4.10:compile - omitted for conflict with 4.11)
[INFO] | +- (log4j:log4j:jar:1.2.16:compile - omitted for duplicate)
[INFO] | +- com.sun.mail:javax.mail:jar:1.5.2:compile
[INFO] | | \- (javax.activation:activation:jar:1.1:compile - omitted for conflict with 1.1.1)
[INFO] | +- javax.mail:javax.mail-api:jar:1.5.2:runtime
[INFO] | | \- (javax.activation:activation:jar:1.1:runtime - omitted for duplicate)
[INFO] | +- javax.activation:activation:jar:1.1.1:compile
[INFO] | \- (com.threewks.thundr:thundr-mailgun:jar:1.1.0:compile - omitted for duplicate)
[INFO] +- commons-dbcp:commons-dbcp:jar:1.4:compile
[INFO] | \- commons-pool:commons-pool:jar:1.5.4:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.31:compile
[INFO] +- log4j:log4j:jar:1.2.16:compile
[INFO] +- com.threewks.thundr:thundr-mailgun:jar:1.1.0:compile
[INFO] | \- com.threewks.thundr:thundr-http:jar:1.1.0:compile
[INFO] | \- com.threewks.thundr:thundr:jar:1.1.0:compile
[INFO] | +- commons-fileupload:commons-fileupload:jar:1.2.2:compile
[INFO] | +- joda-time:joda-time:jar:2.3:compile
[INFO] | +- com.google.code.gson:gson:jar:2.1:compile
[INFO] | +- com.atomicleopard:expressive:jar:0.9.5:compile
[INFO] | +- org.jodd:jodd-bean:jar:3.4.4:compile
[INFO] | | \- org.jodd:jodd-core:jar:3.4.4:compile
[INFO] | +- org.jodd:jodd-proxetta:jar:3.4.4:compile
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.2:compile - omitted for conflict with 1.7.6)
[INFO] | | \- (org.jodd:jodd-core:jar:3.4.4:compile - omitted for duplicate)
[INFO] | +- org.jodd:jodd-servlet:jar:3.4.4:compile
[INFO] | | +- (org.jodd:jodd-bean:jar:3.4.4:compile - omitted for duplicate)
[INFO] | | +- (org.jodd:jodd-core:jar:3.4.4:compile - omitted for duplicate)
[INFO] | | \- org.jodd:jodd-upload:jar:3.4.4:compile
[INFO] | | \- (org.jodd:jodd-core:jar:3.4.4:compile - omitted for duplicate)
[INFO] | +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] | +- javax.inject:javax.inject:jar:1:compile
[INFO] | \- org.apache.directory.studio:org.apache.commons.codec:jar:1.6:compile
[INFO] | \- (commons-codec:commons-codec:jar:1.6:compile - omitted for conflict with 1.5)
[INFO] +- com.sun.jersey:jersey-client:jar:1.18.1:compile
[INFO] | \- (com.sun.jersey:jersey-core:jar:1.18.1:compile - omitted for duplicate)
[INFO] +- com.sun.jersey:jersey-core:jar:1.18.1:compile
[INFO] \- com.sun.jersey.contribs:jersey-multipart:jar:1.18.1:compile
[INFO] +- org.jvnet.mimepull:mimepull:jar:1.9.3:compile
[INFO] \- (com.sun.jersey:jersey-core:jar:1.18.1:compile - omitted for duplicate)
I have encountered this before - please check your WEB-INF/ folder in the jboss directory for old jars.
Use mvn dependency:tree to see where is a dependency transitively included. Exclude them and use Maven Enforcer plugin to prevent a developer adding a dependency which adds banned transitive dependencies.

Categories