I am working on Hibernate3 Spring3 project starter with Tomcat 7,
I am struggling with this ClassNotFoundException - of aopalliance interceptor Jar (is this AspectJ??)
This despite the fact that the Jar exist is in the class-path.
What I don't understand from maven is, where do I use this Jar - who is dependent on this Jar?
[INFO] +- org.hibernate:hibernate-core:jar:3.3.2.GA:compile
[INFO] | +- antlr:antlr:jar:2.7.6:compile
[INFO] | +- javax.transaction:jta:jar:1.1:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.5.8:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:3.3.2.GA:compile
[INFO] | +- org.hibernate:hibernate:jar:3.2.6.ga:compile
[INFO] | | +- net.sf.ehcache:ehcache:jar:1.2.3:compile
[INFO] | | \- asm:asm-attrs:jar:1.5.3:compile
[INFO] | +- org.hibernate:hibernate-annotations:jar:3.3.1.GA:compile
[INFO] | +- org.hibernate:hibernate-commons-annotations:jar:3.0.0.ga:compile
[INFO] | +- org.hibernate:ejb3-persistence:jar:1.0.1.GA:compile
[INFO] | \- javassist:javassist:jar:3.4.GA:compile
[INFO] +- junit:junit:jar:4.8.1:test
[INFO] +- org.springframework:spring-core:jar:3.0.5.RELEASE:compile
[INFO] | \- org.springframework:spring-asm:jar:3.0.5.RELEASE:compile
[INFO] +- javax.servlet:servlet-api:jar:2.4:compile
Here is the problematic jar:
[INFO] +- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- org.springframework:spring-expression:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-web:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-beans:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-aop:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-context-support:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-tx:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-jdbc:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-test:jar:3.0.5.RELEASE:test
[INFO] +- org.springframework:spring-webmvc:jar:3.0.5.RELEASE:compile
...
who is dependent on this Jar?
The Spring framework needs it for Spring AOP. Stand-alone AspectJ does not need it.
Related
I'm facing a really frustrating issue related to modules. Can't figure out why I'm getting
Module 'com.test' reads package 'javax.xml.bind' from both 'java.xml.bind' and 'java.xml.bind'
How to solve it?
Module list
module com.test {
requires java.activation;
requires slf4j.api;
requires spring.context;
requires java.persistence;
requires spring.beans;
requires org.apache.cxf.core;
requires java.xml;
requires java.xml.bind;
}
My environment
IntelliJ IDEA 2020.3.1 (Community Edition)
JAVA JDK 11
Update no.1
found a post on stackoverflow.com that has a very similar issue I'm facing
Package 'com.example' reads package 'javafx.beans' from both 'javafx.base' and 'javafx.base'
Update no.2
[INFO] +- org.hibernate:hibernate-core:jar:5.4.23.Final:provided
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.4.1.Final:provided
[INFO] | +- javax.persistence:javax.persistence-api:jar:2.2:provided
[INFO] | +- org.javassist:javassist:jar:3.24.0-GA:provided
[INFO] | +- net.bytebuddy:byte-buddy:jar:1.10.17:provided
[INFO] | +- antlr:antlr:jar:2.7.7:provided
[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.1.1.Final:provided
[INFO] | +- org.jboss:jandex:jar:2.1.3.Final:provided
[INFO] | +- com.fasterxml:classmate:jar:1.5.1:provided
[INFO] | +- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] | +- org.dom4j:dom4j:jar:2.1.3:provided
[INFO] | +- org.hibernate.common:hibernate-commons-annotations:jar:5.1.2.Final:provided
[INFO] | +- javax.xml.bind:jaxb-api:jar:2.3.1:compile
[INFO] | \- org.glassfish.jaxb:jaxb-runtime:jar:2.3.1:compile
[INFO] | +- org.glassfish.jaxb:txw2:jar:2.3.1:compile
[INFO] | \- com.sun.istack:istack-commons-runtime:jar:3.0.7:compile
[INFO] +- org.springframework:spring-context:jar:5.3.1:provided
[INFO] | +- org.springframework:spring-aop:jar:5.3.1:provided
[INFO] | +- org.springframework:spring-beans:jar:5.3.1:provided
[INFO] | +- org.springframework:spring-core:jar:5.3.1:provided
[INFO] | | \- org.springframework:spring-jcl:jar:5.3.1:provided
[INFO] | \- org.springframework:spring-expression:jar:5.3.1:provided
[INFO] +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile
[INFO] | \- jakarta.activation:jakarta.activation-api:jar:1.2.2:compile
[INFO] +- org.apache.cxf:cxf-core:jar:3.4.1:compile
[INFO] | +- com.fasterxml.woodstox:woodstox-core:jar:6.2.1:compile
[INFO] | +- org.apache.ws.xmlschema:xmlschema-core:jar:2.2.5:compile
[INFO] | +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] | +- jakarta.jws:jakarta.jws-api:jar:2.1.0:compile
[INFO] | +- jakarta.xml.soap:jakarta.xml.soap-api:jar:1.4.2:compile
[INFO] | +- com.sun.activation:jakarta.activation:jar:1.2.2:compile
[INFO] | +- com.sun.xml.messaging.saaj:saaj-impl:jar:1.5.2:runtime
[INFO] | +- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
[INFO] | \- org.jboss.spec.javax.rmi:jboss-rmi-api_1.0_spec:jar:1.0.6.Final:compile
[INFO] +- com.sun.xml.bind:jaxb-impl:jar:2.3.3:runtime
[INFO] +- jakarta.xml.ws:jakarta.xml.ws-api:jar:2.3.3:compile
[INFO] +- com.sun.xml.ws:jaxws-rt:jar:2.3.3:compile
[INFO] | +- com.sun.xml.ws:policy:jar:2.7.10:compile
[INFO] | +- org.glassfish.ha:ha-api:jar:3.1.12:compile
[INFO] | +- org.glassfish.external:management-api:jar:3.2.2:compile
[INFO] | +- org.glassfish.gmbal:gmbal:jar:4.0.1:compile
[INFO] | +- org.glassfish.pfl:pfl-tf:jar:4.1.0:compile
[INFO] | +- org.glassfish.pfl:pfl-basic:jar:4.1.0:compile
[INFO] | +- org.jvnet.staxex:stax-ex:jar:1.8.3:compile
[INFO] | +- com.sun.xml.stream.buffer:streambuffer:jar:1.5.9:compile
[INFO] | +- org.jvnet.mimepull:mimepull:jar:1.9.13:compile
[INFO] | +- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.18:compile
[INFO] | \- org.codehaus.woodstox:stax2-api:jar:4.1:compile
[INFO] +- org.apache.logging.log4j:log4j-api:jar:2.13.3:compile
[INFO] +- org.apache.logging.log4j:log4j-core:jar:2.13.3:compile
[INFO] +- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.13.3:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.7.0:test
[INFO] | \- org.apiguardian:apiguardian-api:jar:1.1.0:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.7.0:test
[INFO] | +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.7.0:test
[INFO] \- org.mockito:mockito-junit-jupiter:jar:3.5.10:test
[INFO] \- org.mockito:mockito-core:jar:3.5.10:test
[INFO] +- net.bytebuddy:byte-buddy-agent:jar:1.10.13:test
[INFO] \- org.objenesis:objenesis:jar:3.1:test
Thanks to Naman and the link provided in original post I found out that I was mixing jakarta.activation and javax.activation while using cxf.
And, because cxf-xjc-plugin:3.3.1 generates code from xsd files using javax.activation I had to exclude
everywhere in a pom jakarta.activation
Update No.1
to be precise I had to replace javax dependencies with jakarta dependencies
that have javax package naming structure (i.e javax.activation and not jakarta.activation), i.e
<has javax packaging structure>
<dependency>
<groupId>jakarta.jws</groupId>
<artifactId>jakarta.jws-api</artifactId>
<version>2.1.0</version>
</dependency>
but not
<has jakarta packaging structure>
<dependency>
<groupId>jakarta.jws</groupId>
<artifactId>jakarta.jws-api</artifactId>
<version>3.0.0</version>
</dependency>
I haven't changed its pom.xml for this project, but when I started the project recently, it reported this error: java.lang.NoSuchMethodError.
Seeing the error, it seems that it can't find the interface method I wrote.
2020-07-21 10:23:05.212 ERROR [main] ApiDescriptionReader::read[#87] : Skipping process path[/projects], method[addProject] as it has an error.java.lang.NoSuchMethodError: org.springframework.http.MediaType.equalsTypeAndSubtype(Lorg/springframework/util/MimeType;)Z
at springfox.documentation.builders.BodyParameterSpecificationProvider.lambda$create$0(BodyParameterSpecificationProvider.java:37)
... ...
I tried mvn clean install, it still doesn't work. This is the io.springfox dependency tree:
[INFO] +- org.springframework.retry:spring-retry:jar:1.2.4.RELEASE:compile
[INFO] | \- org.springframework:spring-core:jar:5.0.7.RELEASE:compile
[INFO] | \- org.springframework:spring-jcl:jar:5.0.7.RELEASE:compile
[INFO] +- org.mybatis.spring.boot:mybatis-spring-boot-starter:jar:2.0.0:compile
[INFO] | \- org.springframework.boot:spring-boot-starter-jdbc:jar:2.0.3.RELEASE:compile
[INFO] | \- org.springframework:spring-jdbc:jar:5.0.7.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:5.0.7.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-webflux:jar:2.0.3.RELEASE:compile
[INFO] | +- org.springframework:spring-web:jar:5.0.7.RELEASE:compile
[INFO] | \- org.springframework:spring-webflux:jar:5.0.7.RELEASE:compile
[INFO] \- org.springframework.plugin:spring-plugin-core:jar:2.0.0.RELEASE:compile
[INFO] +- org.springframework:spring-beans:jar:5.0.7.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:5.0.7.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:5.0.7.RELEASE:compile
[INFO] \- org.springframework:spring-aop:jar:5.0.7.RELEASE:compile
[INFO] +- io.springfox:springfox-swagger2:jar:3.0.0-SNAPSHOT:compile
[INFO] | +- io.springfox:springfox-spi:jar:3.0.0-SNAPSHOT:compile
[INFO] | +- io.springfox:springfox-schema:jar:3.0.0-SNAPSHOT:compile
[INFO] | +- io.springfox:springfox-swagger-common:jar:3.0.0-SNAPSHOT:compile
[INFO] | +- io.springfox:springfox-spring-web:jar:3.0.0-SNAPSHOT:compile
[INFO] | \- io.springfox:springfox-spring-webmvc:jar:3.0.0-SNAPSHOT:compile
[INFO] +- io.springfox:springfox-swagger-ui:jar:3.0.0-SNAPSHOT:compile
[INFO] \- io.springfox:springfox-spring-webflux:jar:3.0.0-SNAPSHOT:compile
[INFO] \- io.springfox:springfox-core:jar:3.0.0-SNAPSHOT:compile
According to the documentation this method exists since spring 5.1.4
https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/util/MimeType.html#equalsTypeAndSubtype-org.springframework.util.MimeType-
You can update the version of spring that you use or decrease the version of spring-fox
I am using threetenbp version 1.4.4 in my maven project. On deploying my JAR in a tomcat container, I get the exception below:
java.lang.NoClassDefFoundError:
"org/threeten/bp/temporal/TemporalAccessor" Caused by:
"java.lang.ClassNotFoundException:
org.threeten.bp.temporal.TemporalAccessor".
... What is the root cause and solution to this issue?
(Note: Suggested solutions currently published on this platform concerning the same issue, have not resolved mine).
I even tried bumping up or down the version for JAR and its not resolving the issue
My maven dependency tree is below ( I do not see any transitive dependency) linked to this dependency
[INFO] aa.aa.aaa.aaa.hass:hass-consumer:jar:1.0
[INFO] +- junit:junit:jar:4.11:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- javax.servlet:javax.servlet-api:jar:3.1.0:provided
[INFO] +- org.glassfish.jersey.core:jersey-server:jar:2.26:compile
[INFO] | +- org.glassfish.jersey.core:jersey-common:jar:2.26:compile
[INFO] | | \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
[INFO] | +- javax.ws.rs:javax.ws.rs-api:jar:2.1:compile
[INFO] | +- org.glassfish.jersey.media:jersey-media-jaxb:jar:2.26:compile
[INFO] | +- javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO] | +- org.glassfish.hk2.external:javax.inject:jar:2.5.0-b42:compile
[INFO] | \- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] +- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.26:compile
[INFO] | \- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.26:compile
[INFO] +- org.glassfish.jersey.media:jersey-media-moxy:jar:2.26:compile
[INFO] | +- org.glassfish.jersey.ext:jersey-entity-filtering:jar:2.26:compile
[INFO] | \- org.eclipse.persistence:org.eclipse.persistence.moxy:jar:2.6.4:compile
[INFO] | +- org.eclipse.persistence:org.eclipse.persistence.core:jar:2.6.4:compile
[INFO] | | \- org.eclipse.persistence:org.eclipse.persistence.asm:jar:2.6.4:compile
[INFO] | \- org.glassfish:javax.json:jar:1.0.4:compile
[INFO] +- org.glassfish.jersey.inject:jersey-hk2:jar:2.26:compile
[INFO] | \- org.glassfish.hk2:hk2-locator:jar:2.5.0-b42:compile
[INFO] | +- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.5.0-b42:compile
[INFO] | +- org.glassfish.hk2:hk2-api:jar:2.5.0-b42:compile
[INFO] | | \- javax.inject:javax.inject:jar:1:compile
[INFO] | +- org.glassfish.hk2:hk2-utils:jar:2.5.0-b42:compile
[INFO] | \- org.javassist:javassist:jar:3.22.0-CR2:compile
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.8:compile
[INFO] +- org.glassfish.jersey.core:jersey-client:jar:2.26:compile
[INFO] +- io.jsonwebtoken:jjwt:jar:0.9.1:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-databind:jar:2.9.6:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.9.6:compile
[INFO] +- javax.xml.bind:jaxb-api:jar:2.3.1:compile
[INFO] | \- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] +- com.google.code.gson:gson:jar:2.8.1:compile
[INFO] +- io.gsonfire:gson-fire:jar:1.8.3:compile
[INFO] +- com.auth0:java-jwt:jar:3.9.0:compile
[INFO] | \- commons-codec:commons-codec:jar:1.12:runtime
[INFO] +- org.bouncycastle:bcprov-jdk15on:jar:1.53:compile
[INFO] +- org.bouncycastle:bcpkix-jdk15on:jar:1.53:compile
[INFO] +- commons-io:commons-io:jar:2.6:compile
[INFO] +- io.swagger:swagger-annotations:jar:1.5.18:compile
[INFO] +- com.squareup.okhttp:okhttp:jar:2.7.5:compile
[INFO] | \- com.squareup.okio:okio:jar:1.6.0:compile
[INFO] +- com.squareup.okhttp:logging-interceptor:jar:2.7.5:compile
[INFO] +- org.threeten:threetenbp:jar:1.3.5:compile
[INFO] +- org.aspectj:aspectjrt:jar:1.9.0:compile
[INFO] +- openconnector:openconnector:jar:1.0:compile
[INFO] +- commons-logging:commons-logging:jar:1.2:compile
[INFO] +- net.sf.flexjson:flexjson:jar:3.3:compile
[INFO] +- sailpoint.integration:iiqIntegration-1.0:jar:1.0:compile
[INFO] +- sailpoint.identityiq:identityiq:jar:1.0:compile
[INFO] \- log4j:log4j:jar:1.2.17:compile"
Please add threetenbp-1.3.5.jar in the Tomcat server class path or Tomcat's libraries folder
This question already has answers here:
How do I fix a NoSuchMethodError?
(33 answers)
Closed 5 years ago.
i'm using spring like application container and I'm getting the following error at runtime:
Caused by: java.lang.NoSuchMethodError: org.springframework.http.MediaType.compareTo(Lorg/springframework/http/MediaType;)I
at org.springframework.web.servlet.mvc.condition.ProducesRequestCondition.compareMatchingMediaTypes(ProducesRequestCondition.java:273)
at org.springframework.web.servlet.mvc.condition.ProducesRequestCondition.compareTo(ProducesRequestCondition.java:218)
at org.springframework.web.servlet.mvc.method.RequestMappingInfo.compareTo(RequestMappingInfo.java:217)
at org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping$1.compare(RequestMappingInfoHandlerMapping.java:77)
at org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping$1.compare(RequestMappingInfoHandlerMapping.java:75)
at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MatchComparator.compare(AbstractHandlerMethodMapping.java:367)
at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MatchComparator.compare(AbstractHandlerMethodMapping.java:358)
at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355)
at java.util.TimSort.sort(TimSort.java:220)
at java.util.Arrays.sort(Arrays.java:1512)
at java.util.ArrayList.sort(ArrayList.java:1454)
at java.util.Collections.sort(Collections.java:175)
at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.lookupHandlerMethod(AbstractHandlerMethodMapping.java:261)
at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.getHandlerInternal(AbstractHandlerMethodMapping.java:223)
at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.getHandlerInternal(AbstractHandlerMethodMapping.java:56)
at org.springframework.web.servlet.handler.AbstractHandlerMapping.getHandler(AbstractHandlerMapping.java:298)
at org.springframework.web.servlet.DispatcherServlet.getHandler(DispatcherServlet.java:1091)
at org.springframework.web.servlet.DispatcherServlet.getHandler(DispatcherServlet.java:1076)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:896)
This is my dependency tree
[INFO] +- pdftron:pdftron:jar:6.6.1:compile
[INFO] +- edu.yale:its.tp.cas.client.dto:jar:3.1.0:compile
[INFO] +- log4j:log4j:jar:1.2.16:compile
[INFO] +- org.apache.openejb:javaee-api:jar:5.0-1:provided
[INFO] +- javax.servlet:jstl:jar:1.2:provided
[INFO] +- javax.servlet.jsp:jsp-api:jar:2.1:provided
[INFO] +- org.springframework:spring-core:jar:4.1.4.RELEASE:compile
[INFO] | \- commons-logging:commons-logging:jar:1.2:compile
[INFO] +- org.springframework:spring-expression:jar:4.1.4.RELEASE:compile
[INFO] +- org.springframework:spring-beans:jar:4.1.4.RELEASE:compile
[INFO] +- org.springframework:spring-aop:jar:4.1.4.RELEASE:compile
[INFO] | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- org.springframework:spring-context:jar:4.1.4.RELEASE:compile
[INFO] +- org.springframework:spring-context-support:jar:4.1.4.RELEASE:compile
[INFO] +- org.springframework:spring-tx:jar:4.1.4.RELEASE:compile
[INFO] +- org.springframework:spring-jdbc:jar:4.1.4.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:4.1.4.RELEASE:compile
[INFO] +- org.springframework:spring-oxm:jar:4.1.4.RELEASE:compile
[INFO] +- org.springframework:spring-web:jar:4.1.4.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc:jar:4.1.4.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc-portlet:jar:4.1.4.RELEASE:compile
[INFO] +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.5:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.5:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.19:compile
[INFO] +- org.springframework:spring-test:jar:4.1.4.RELEASE:test
[INFO] +- org.springframework.security:spring-security-core:jar:3.2.0.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-web:jar:3.2.0.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-config:jar:3.2.0.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-taglibs:jar:3.2.0.RELEASE:compile
[INFO] | \- org.springframework.security:spring-security-acl:jar:3.2.0.RELEASE:compile
[INFO] +- commons-dbcp:commons-dbcp:jar:1.3:compile
[INFO] +- org.hibernate:hibernate-core:jar:3.6.9.Final:compile
[INFO] | +- antlr:antlr:jar:2.7.6: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.6.1:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:3.6.9.Final:compile
[INFO] | \- javassist:javassist:jar:3.12.0.GA:compile
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
[INFO] +- org.hibernate:hibernate-validator:jar:4.2.0.Final:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.1:compile
[INFO] +- org.slf4j:jcl-over-slf4j:jar:1.6.1:compile
[INFO] +- javax.validation:validation-api:jar:1.0.0.GA:compile
[INFO] +- cglib:cglib-nodep:jar:2.2.2:compile
[INFO] +- javax.transaction:jta:jar:1.1:compile
[INFO] +- commons-pool:commons-pool:jar:1.5.6:compile
[INFO] +- commons-digester:commons-digester:jar:2.1:compile
[INFO] | \- commons-beanutils:commons-beanutils:jar:1.8.3:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.2.2:compile
[INFO] +- javax.servlet.jsp.jstl:jstl-api:jar:1.2:compile
[INFO] +- org.glassfish.web:jstl-impl:jar:1.2:compile
[INFO] +- javax.el:el-api:jar:1.0:provided
[INFO] +- joda-time:joda-time:jar:1.6:compile
[INFO] +- commons-codec:commons-codec:jar:1.6:compile
[INFO] +- org.apache.tiles:tiles-jsp:jar:2.2.2:compile
[INFO] | +- org.apache.tiles:tiles-servlet:jar:2.2.2:compile
[INFO] | | \- org.apache.tiles:tiles-core:jar:2.2.2:compile
[INFO] | \- org.apache.tiles:tiles-template:jar:2.2.2:compile
[INFO] | \- org.apache.tiles:tiles-api:jar:2.2.2:compile
[INFO] +- commons-io:commons-io:jar:2.3:compile
[INFO] +- commons-lang:commons-lang:jar:2.6:compile
[INFO] +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] +- jsptags:pager-taglib:jar:2.0:compile
[INFO] +- org.owasp.esapi:esapi:jar:2.1.0:compile
[INFO] | +- commons-configuration:commons-configuration:jar:1.5:compile
[INFO] | +- commons-beanutils:commons-beanutils-core:jar:1.7.0:compile
[INFO] | +- xom:xom:jar:1.2.5:compile
[INFO] | +- org.beanshell:bsh-core:jar:2.0b4:compile
[INFO] | \- org.owasp.antisamy:antisamy:jar:1.4.3:compile
[INFO] | +- org.apache.xmlgraphics:batik-css:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-ext:jar:1.7:compile
[INFO] | | \- org.apache.xmlgraphics:batik-util:jar:1.7:compile
[INFO] | \- net.sourceforge.nekohtml:nekohtml:jar:1.9.12:compile
[INFO] \- junit:junit:jar:3.8.1:test
Where am I doing wrong?
You're using mixed versions of Spring. spring-security-web 3.2.0.Release depends on spring-web 3.2.6.Release. You should update all of your spring dependencies to use a single version where possible.
https://mvnrepository.com/artifact/org.springframework.security/spring-security-web/3.2.0.RELEASE
You can catch problems like this by using the maven enforcer plugin DependencyConvergence rule: http://maven.apache.org/enforcer/enforcer-rules/dependencyConvergence.html
In an eclipse project that uses maven, jpa, and hibernate, I am getting the following two compilation errors:
NamedEntityGraph cannot be resolved to a type
and
NamedAttributeNode cannot be resolved to a type
How can I resolve these compilation errors?
Here is the line of code that is showing the compilation errors:
#Entity(name="someclass")
#NamedEntityGraph(name="includeOther", attributeNodes={#NamedAttributeNode("other")})
#Table(name="sometable")
public class SomeClass {
//lots of stuff
}
I think the problem is that eclipse is not seeing that I have JPA 2.1 configured. But I have tried to install and configure JPA 2.1. You can read the entire code of my pom.xml at a file sharing site by clicking on this link. I set up JPA 2.1 in the eclipse project facets, which you can see by clicking on this link. Also, I ran mvn dependency:tree on the root folder of the eclipse project from the windows command line, and I got the following output:
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building MyApp 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # MyApp ---
[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2
[INFO] org.springframework.samples:MyApp:war:1.0.0-SNAPSHOT
[INFO] +- org.jvnet.hyperjaxb3:hyperjaxb3-ejb-runtime:jar:0.6.0:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.2.1:compile
[INFO] | \- org.jvnet.jaxb2_commons:jaxb2-basics-runtime:jar:0.8.2:compile
[INFO] +- org.jvnet.hyperjaxb3:hyperjaxb3-ejb-roundtrip:jar:0.6.0:compile
[INFO] | +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final:compile
[INFO] | +- org.jvnet.jaxb2_commons:jaxb2-basics-testing:jar:0.8.2:compile
[INFO] | | +- xmlunit:xmlunit:jar:1.0:compile
[INFO] | | \- org.jvnet.jaxb2_commons:jaxb2-basics-tools:jar:0.8.2:compile
[INFO] | | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] | \- org.slf4j:slf4j-log4j12:jar:1.6.1:compile
[INFO] | \- log4j:log4j:jar:1.2.16:compile
[INFO] +- org.jadira.usertype:usertype.core:jar:3.1.0.CR8:compile
[INFO] | \- org.jadira.usertype:usertype.spi:jar:3.1.0.CR8:compile
[INFO] +- javax.servlet:jstl:jar:1.2:compile
[INFO] +- javax.servlet:servlet-api:jar:2.5:provided
[INFO] +- javax.servlet.jsp:jsp-api:jar:2.2:provided
[INFO] +- org.springframework.data:spring-data-jpa:jar:1.6.4.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-commons:jar:1.8.4.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:4.0.6.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:4.0.6.RELEASE:compile
[INFO] | +- org.springframework:spring-core:jar:4.0.6.RELEASE:compile
[INFO] | \- org.slf4j:jcl-over-slf4j:jar:1.7.7:runtime
[INFO] +- org.springframework:spring-jdbc:jar:4.0.6.RELEASE:compile
[INFO] +- org.springframework:spring-aop:jar:4.0.6.RELEASE:compile
[INFO] | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- org.springframework:spring-webmvc:jar:4.0.6.RELEASE:compile
[INFO] | +- org.springframework:spring-expression:jar:4.0.6.RELEASE:compile
[INFO] | \- org.springframework:spring-web:jar:4.0.6.RELEASE:compile
[INFO] +- org.springframework:spring-tx:jar:4.0.6.RELEASE:compile
[INFO] +- org.springframework:spring-context-support:jar:4.0.6.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:4.0.6.RELEASE:compile
[INFO] +- org.springframework:spring-oxm:jar:4.0.6.RELEASE:compile
[INFO] +- org.springframework:spring-jms:jar:4.0.6.RELEASE:compile
[INFO] +- org.apache.tomcat:tomcat-jdbc:jar:7.0.42:runtime
[INFO] | \- org.apache.tomcat:tomcat-juli:jar:7.0.42:runtime
[INFO] +- org.slf4j:slf4j-api:jar:1.7.5:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.0.13:runtime
[INFO] | \- ch.qos.logback:logback-core:jar:1.0.13:runtime
[INFO] +- joda-time:joda-time:jar:2.3:compile
[INFO] +- joda-time:joda-time-hibernate:jar:1.3:compile
[INFO] +- joda-time:joda-time-jsptags:jar:1.1.1:compile
[INFO] +- org.jadira.usertype:usertype.jodatime:jar:2.0.1:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.27:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:4.2.1.Final:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.1.0.GA:compile
[INFO] | +- org.hibernate:hibernate-core:jar:4.2.1.Final:compile
[INFO] | | \- antlr:antlr:jar:2.7.7:compile
[INFO] | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction api_1.1_spec:jar:1.0.1.Final: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-validator:jar:5.1.1.Final:compile
[INFO] | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | \- com.fasterxml:classmate:jar:1.0.0:compile
[INFO] +- org.hibernate:hibernate-ehcache:jar:4.2.1.Final:compile
[INFO] +- net.sf.ehcache:ehcache-core:jar:2.6.6:compile
[INFO] +- org.webjars:bootstrap:jar:2.3.0:compile
[INFO] +- org.webjars:jquery-ui:jar:1.10.3:compile
[INFO] +- org.webjars:jquery:jar:2.0.3-1:compile
[INFO] +- org.springframework:spring-test:jar:4.0.6.RELEASE:test
[INFO] +- junit:junit:jar:4.11:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] +- org.aspectj:aspectjrt:jar:1.7.4:compile
[INFO] +- org.aspectj:aspectjweaver:jar:1.7.4:runtime
[INFO] +- com.github.dandelion:datatables-jsp:jar:0.9.2:compile
[INFO] | \- com.github.dandelion:datatables-core:jar:0.9.2:compile
[INFO] | +- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] | \- commons-beanutils:commons-beanutils:jar:1.8.3:compile
[INFO] +- com.github.dandelion:datatables-export-itext:jar:0.9.2:compile
[INFO] | \- com.itextpdf:itextpdf:jar:5.3.4:compile
[INFO] +- com.github.dandelion:datatables-servlet2:jar:0.9.2:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.2:compile
[INFO] +- commons-io:commons-io:jar:1.3.2:compile
[INFO] +- commons-lang:commons-lang:jar:2.6:compile
[INFO] +- org.apache.tiles:tiles-jsp:jar:2.1.3:compile
[INFO] | \- org.apache.tiles:tiles-servlet:jar:2.1.3:compile
[INFO] | \- org.apache.tiles:tiles-core:jar:2.1.3:compile
[INFO] | +- org.apache.tiles:tiles-api:jar:2.1.3:compile
[INFO] | \- commons-digester:commons-digester:jar:1.8.1:compile
[INFO] +- org.springframework.security:spring-security-core:jar:3.2.2.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-web:jar:3.2.2.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-config:jar:3.2.2.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-taglibs:jar:3.2.2.RELEASE:compile
[INFO] | \- org.springframework.security:spring-security-acl:jar:3.2.2.RELEASE:compile
[INFO] +- org.eclipse.emf:ecore:jar:2.2.3:compile
[INFO] \- org.eclipse.emf:common:jar:2.2.3:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.805s
[INFO] Finished at: Thu Nov 06 12:32:32 PST 2014
[INFO] Final Memory: 14M/124M
[INFO] ------------------------------------------------------------------------
From your dependency tree:
org.hibernate:hibernate-entitymanager:jar:4.2.1.Final:compile
I don't think Hibernate 4.2.1 supports JPA 2.1. You may need to upgrade to Hibernate 4.3.
You may also want to add this dependency if your application container doesn't provide it:
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version>
</dependency>