NoSuchMethodError using spring framework [duplicate] - java

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

Related

java.lang.ClassNotFoundException: org.threeten.bp.temporal.TemporalAccessor

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

Spring boot application exception java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectWriter.forType

I am working on a Spring boot 1.5.9 application with JDK 1.8.2.
In debug mode with Intellij Ultimate edition, when the application tries to call a Rest API Method, there is an exception thrown like below;
I tried changing or adding different versions of 'com.faster' dependencies but no luck.
<jackson.version>2.8.8</jackson.version>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectWriter.forType(Lcom/fasterxml/jackson/databind/JavaType;)Lcom/fasterxml/jackson/databind/ObjectWriter;
at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:279)
at org.springframework.http.converter.AbstractGenericHttpMessageConverter.write(AbstractGenericHttpMessageConverter.java:106)
at org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(RestTemplate.java:870)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:657)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:620)
at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:387)
at com.YYY.XXX.servicehelper.ContentServiceHelper.getPageContentWithLangNew(ContentServiceHelper.java:98)
at com.YYY.XXX.servicehelper.ContentServiceHelper$$FastClassBySpringCGLIB$$9d352ef9.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.cache.interceptor.CacheInterceptor$1.invoke(CacheInterceptor.java:52)
at org.springframework.cache.interceptor.CacheAspectSupport.invokeOperation(CacheAspectSupport.java:344)
at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:407)
at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:326)
at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:61)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
Here is the dependency tree.
[INFO] -------------------------< com.YYY:XXXWeb >-------------------------
[INFO] Building XXXWeb 0.0.1-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) # XXXWeb ---
[INFO] com.YYY:XXXWeb:war:0.0.1-SNAPSHOT
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.8:compile
[INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.8.8:compile
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.8:compile
[INFO] +- com.YYY:XXXBackendLib:jar:0.1-SNAPSHOT:compile
[INFO] | \- commons-codec:commons-codec:jar:1.10:compile
[INFO] +- com.YYY:PaymentModuleLib:jar:0.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.5.9.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.5.9.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.5.9.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.9.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.9.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.1.11:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.1.11:compile
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] | +- org.hibernate:hibernate-validator:jar:5.3.6.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] | +- org.springframework:spring-web:jar:4.3.13.RELEASE:compile
[INFO] | | \- org.springframework:spring-beans:jar:4.3.13.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:4.3.13.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.3.13.RELEASE:compile
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.5.5:compile
[INFO] | \- org.apache.httpcomponents:httpcore:jar:4.4.8:compile
[INFO] +- com.bkm:bexandroidsdk:jar:1.2.0:compile
[INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.5.9.RELEASE:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.23:compile
[INFO] | | \- org.apache.tomcat:tomcat-annotations-api:jar:8.5.23:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.23:compile
[INFO] | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.23:compile
[INFO] +- org.springframework.boot:spring-boot-configuration-processor:jar:1.5.9.RELEASE:compile
[INFO] | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-security:jar:1.5.9.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.3.13.RELEASE:compile
[INFO] | +- org.springframework.security:spring-security-config:jar:4.2.3.RELEASE:compile
[INFO] | | \- org.springframework.security:spring-security-core:jar:4.2.3.RELEASE:compile
[INFO] | \- org.springframework.security:spring-security-web:jar:4.2.3.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-cache:jar:1.5.9.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:4.3.13.RELEASE:compile
[INFO] | \- org.springframework:spring-context-support:jar:4.3.13.RELEASE:compile
[INFO] +- javax.servlet:jstl:jar:1.2:compile
[INFO] +- org.springframework.session:spring-session:jar:1.3.1.RELEASE:compile
[INFO] +- com.aerospike:spring-session-aerospike:jar:1.0.0.RELEASE:compile
[INFO] +- com.aerospike:spring-data-aerospike:jar:1.0.2.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-commons:jar:1.13.9.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-keyvalue:jar:1.2.9.RELEASE:compile
[INFO] | +- org.springframework:spring-tx:jar:4.3.13.RELEASE:compile
[INFO] | +- com.aerospike:aerospike-helper-java:jar:1.2:compile
[INFO] | +- log4j:log4j:jar:1.2.17:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] | \- org.slf4j:jcl-over-slf4j:jar:1.7.25:compile
[INFO] +- com.aerospike:aerospike-client:jar:4.0.8:compile
[INFO] | +- org.gnu:gnu-crypto:jar:2.0.1:compile
[INFO] | +- org.luaj:luaj-jse:jar:3.0:compile
[INFO] | \- org.mindrot:jbcrypt:jar:0.3m:compile
[INFO] +- org.apache.tomcat.embed:tomcat-embed-jasper:jar:8.5.23:compile
[INFO] | \- org.eclipse.jdt:ecj:jar:3.12.3:compile
[INFO] +- de.codecentric:spring-boot-admin-starter-client:jar:1.5.2:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-actuator:jar:1.5.9.RELEASE:compile
[INFO] | | \- org.springframework.boot:spring-boot-actuator:jar:1.5.9.RELEASE:compile
[INFO] | +- org.jolokia:jolokia-core:jar:1.3.7:compile
[INFO] | \- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] +- com.itextpdf:itextpdf:jar:5.4.5:compile
[INFO] +- biz.paluch.logging:logstash-gelf:jar:1.11.2:compile
[INFO] \- org.springframework.boot:spring-boot-starter-test:jar:1.5.9.RELEASE:test
[INFO] +- org.springframework.boot:spring-boot-test:jar:1.5.9.RELEASE:test
[INFO] +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.5.9.RELEASE:test
[INFO] +- com.jayway.jsonpath:json-path:jar:2.2.0:test
[INFO] | \- net.minidev:json-smart:jar:2.2.1:test
[INFO] | \- net.minidev:accessors-smart:jar:1.1:test
[INFO] | \- org.ow2.asm:asm:jar:5.0.3:test
[INFO] +- junit:junit:jar:4.12:compile
[INFO] +- org.assertj:assertj-core:jar:2.6.0:test
[INFO] +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | \- org.objenesis:objenesis:jar:2.1:test
[INFO] +- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] +- org.skyscreamer:jsonassert:jar:1.4.0:test
[INFO] +- org.springframework:spring-core:jar:4.3.13.RELEASE:compile
[INFO] \- org.springframework:spring-test:jar:4.3.13.RELEASE:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.535 s
[INFO] Finished at: 2019-06-22T11:45:31+03:00
[INFO] ------------------------------------------------------------------------
In my case, I was not starting the Spring boot application with correct configuration. It should be started with the command spring-boot:run

Update to Spring 5.1 - java.lang.NoClassDefFoundError: org/springframework/http/server/reactive/ServletServerHttpResponse$ResponseBodyProcessor

I get the following stacktrace while deploying when trying to update to Spring 5.1 from 4.3. Server is WildFly 14. Runtime is JDK 11. Compiler target is 1.8.
I tried cleaning dependecies, but nothing help. Further below is dependency:tree output.
22:23:51,323 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."BDOS-POP.war".component."org.springframework.http.server.reactive.ServletServerHttpResponse$ResponseAsyncListener".WeldInstantiator: org.jboss.msc.service.StartException in service jboss.deployment.unit."BDOS-POP.war".component."org.springframework.http.server.reactive.ServletServerHttpResponse$ResponseAsyncListener".WeldInstantiator: Failed to start service
at org.jboss.msc#1.4.3.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1728)
at org.jboss.msc#1.4.3.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556)
at org.jboss.threads#2.3.2.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads#2.3.2.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads#2.3.2.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads#2.3.2.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1364)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.jboss.weld.resources.spi.ResourceLoadingException: Error while loading class org.springframework.http.server.reactive.ServletServerHttpResponse$ResponseAsyncListener
at org.jboss.weld.core#3.0.5.Final//org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:186)
at org.jboss.weld.core#3.0.5.Final//org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:194)
at org.jboss.weld.core#3.0.5.Final//org.jboss.weld.resources.ClassTransformer.getEnhancedAnnotatedType(ClassTransformer.java:232)
at org.jboss.as.weld#14.0.0.Final//org.jboss.as.weld.injection.InjectionTargets.createInjectionTarget(InjectionTargets.java:60)
at org.jboss.as.weld#14.0.0.Final//org.jboss.as.weld.injection.WeldComponentService.start(WeldComponentService.java:120)
at org.jboss.msc#1.4.3.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1736)
at org.jboss.msc#1.4.3.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1698)
... 6 more
Caused by: java.lang.NoClassDefFoundError: Failed to link org/springframework/http/server/reactive/ServletServerHttpResponse$ResponseBodyProcessor (Module "deployment.BDOS-POP.war" from Service Module Loader): Failed to link org/springframework/http/server/reactive/AbstractListenerWriteProcessor (Module "deployment.BDOS-POP.war" from Service Module Loader): org/reactivestreams/Processor
at java.base/java.lang.Class.getDeclaringClass0(Native Method)
at java.base/java.lang.Class.getDeclaringClass(Class.java:1472)
at org.jboss.weld.core#3.0.5.Final//org.jboss.weld.util.reflection.Reflections.checkDeclaringClassLoadable(Reflections.java:427)
at org.jboss.weld.core#3.0.5.Final//org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.apply(ClassTransformer.java:83)
at org.jboss.weld.core#3.0.5.Final//org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.apply(ClassTransformer.java:79)
at org.jboss.weld.core#3.0.5.Final//org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.lambda$null$0(ReentrantMapBackedComputingCache.java:55)
at org.jboss.weld.core#3.0.5.Final//org.jboss.weld.util.WeakLazyValueHolder$1.computeValue(WeakLazyValueHolder.java:35)
at org.jboss.weld.core#3.0.5.Final//org.jboss.weld.util.WeakLazyValueHolder.get(WeakLazyValueHolder.java:53)
at org.jboss.weld.core#3.0.5.Final//org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.getValue(ReentrantMapBackedComputingCache.java:72)
at org.jboss.weld.core#3.0.5.Final//org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.getCastValue(ReentrantMapBackedComputingCache.java:78)
at org.jboss.weld.core#3.0.5.Final//org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:177)
... 12 more
mvn dependency:tree looks like this:
[INFO] com.company:app:war:1.0-SNAPSHOT
[INFO] +- org.apache.wicket:wicket-core:jar:7.10.0:compile
[INFO] | +- org.apache.commons:commons-collections4:jar:4.1:compile
[INFO] | +- org.apache.wicket:wicket-request:jar:7.10.0:compile
[INFO] | +- org.apache.wicket:wicket-util:jar:7.10.0:compile
[INFO] | | \- commons-fileupload:commons-fileupload:jar:1.3.2:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] +- org.apache.wicket:wicket-extensions:jar:7.10.0:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.25:compile
[INFO] +- log4j:log4j:jar:1.2.17:compile
[INFO] +- org.springframework:spring-core:jar:5.1.0.RELEASE:compile
[INFO] | \- org.springframework:spring-jcl:jar:5.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-web:jar:5.1.0.RELEASE:compile
[INFO] | \- org.springframework:spring-beans:jar:5.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:5.1.0.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:5.1.0.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:5.1.0.RELEASE:compile
[INFO] +- org.apache.wicket:wicket-spring:jar:7.10.0:compile
[INFO] | \- org.apache.wicket:wicket-ioc:jar:7.10.0:compile
[INFO] | +- cglib:cglib:jar:3.1:compile
[INFO] | +- javax.inject:javax.inject:jar:1:compile
[INFO] | \- org.ow2.asm:asm-util:jar:5.0.3:compile
[INFO] | \- org.ow2.asm:asm-tree:jar:5.0.3:compile
[INFO] | \- org.ow2.asm:asm:jar:5.0.3:compile
[INFO] +- org.apache.wicket:wicket-devutils:jar:7.10.0:compile
[INFO] +- org.springframework:spring-jdbc:jar:5.1.0.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:5.1.0.RELEASE:compile
[INFO] +- org.jboss.spec.javax.servlet:jboss-servlet-api_4.0_spec:jar:1.0.0.Final:compile
[INFO] +- com.zaxxer:HikariCP:jar:3.2.0:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.8:compile
[INFO] +- com.company:wicketWebComponents:jar:2.0.0-SNAPSHOT:compile
[INFO] | \- org.apache.commons:commons-vfs2:jar:2.1:compile
[INFO] | \- commons-logging:commons-logging:jar:1.2:compile
[INFO] +- com.company.marsz:MailSender:jar:1.8.1:compile
[INFO] | \- org.apache.commons:commons-email:jar:1.4:compile
[INFO] | +- com.sun.mail:javax.mail:jar:1.5.2:compile
[INFO] | \- javax.activation:activation:jar:1.1.1:compile
[INFO] +- net.bull.javamelody:javamelody-core:jar:1.74.0:compile
[INFO] | \- org.jrobin:jrobin:jar:1.5.9:compile
[INFO] +- com.company.proces:system-parameters:jar:1.8.6-SNAPSHOT:compile
[INFO] | +- redis.clients:jedis:jar:2.9.0:compile
[INFO] | | \- org.apache.commons:commons-pool2:jar:2.4.2:compile
[INFO] | +- org.springframework.data:spring-data-redis:jar:2.1.0.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-keyvalue:jar:2.1.0.RELEASE:compile
[INFO] | | +- org.springframework:spring-oxm:jar:5.1.0.RELEASE:compile
[INFO] | | \- org.springframework:spring-context-support:jar:5.1.0.RELEASE:compile
[INFO] | +- com.company:energetyka-coretypes:jar:1.8.1-umarsz:compile
[INFO] | \- com.company:ucore:jar:1.8.6-SNAPSHOT:compile
[INFO] +- com.company:sso-service:jar:1.8.0:compile
[INFO] | \- org.jasig.cas.client:cas-client-core:jar:3.4.1:compile
[INFO] +- com.company:appBackend:jar:1.0-SNAPSHOT:compile
[INFO] | +- org.springframework.data:spring-data-jpa:jar:2.1.0.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:2.1.0.RELEASE:compile
[INFO] | | +- org.springframework:spring-orm:jar:5.1.0.RELEASE:compile
[INFO] | | \- org.aspectj:aspectjrt:jar:1.9.1:compile
[INFO] | +- javax.xml.bind:jaxb-api:jar:2.3.0:compile
[INFO] | +- com.sun.xml.bind:jaxb-core:jar:2.3.0:compile
[INFO] | +- com.sun.xml.bind:jaxb-impl:jar:2.3.0:compile
[INFO] | +- javax.annotation:javax.annotation-api:jar:1.3.1:compile
[INFO] | \- javax.persistence:javax.persistence-api:jar:2.2:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.5:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.9.5:compile
[INFO] +- com.company:notification-api:jar:0.0.1-SNAPSHOT:compile
[INFO] | +- com.google.code.gson:gson:jar:2.6.2:compile
[INFO] | \- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] +- com.company:c-components:jar:1.1.1-SNAPSHOT:compile
[INFO] +- com.company.marsz:wicketWebComponents:jar:1.8-SNAPSHOT:compile
[INFO] +- com.company.marsz:ExcelReports:jar:1.8.1:compile
[INFO] | +- com.company.marsz:statistics:jar:1.8.1:compile
[INFO] | +- commons-io:commons-io:jar:2.6:compile
[INFO] | +- commons-codec:commons-codec:jar:1.11:compile
[INFO] | +- org.apache.poi:poi:jar:4.0.0:compile
[INFO] | +- org.apache.poi:poi-ooxml:jar:4.0.0:compile
[INFO] | | +- org.apache.poi:poi-ooxml-schemas:jar:4.0.0:compile
[INFO] | | | \- org.apache.xmlbeans:xmlbeans:jar:3.0.1:compile
[INFO] | | +- org.apache.commons:commons-compress:jar:1.18:compile
[INFO] | | \- com.github.virtuald:curvesapi:jar:1.04:compile
[INFO] | \- xerces:xercesImpl:jar:2.12.0:compile
[INFO] | \- xml-apis:xml-apis:jar:1.4.01:compile
[INFO] +- org.hibernate:hibernate-core:jar:5.3.6.Final:provided
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.3.2.Final:provided
[INFO] | +- org.javassist:javassist:jar:3.23.1-GA:provided
[INFO] | +- net.bytebuddy:byte-buddy:jar:1.8.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.0.5.Final:provided
[INFO] | +- com.fasterxml:classmate:jar:1.3.4:provided
[INFO] | +- javax.activation:javax.activation-api:jar:1.2.0:provided
[INFO] | +- dom4j:dom4j:jar:1.6.1:provided
[INFO] | \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.4.Final:provided
[INFO] \- com.company:multitenancy:jar:1.0.0-SNAPSHOT:compile
I found help on the wildfly forums: https://developer.jboss.org/thread/276373?start=15&tstart=0
After adding this dependency it works:
<dependency>
<groupId>org.reactivestreams</groupId>
<artifactId>reactive-streams</artifactId>
<version>1.0.1</version>
</dependency>

NamedEntityGraph cannot be resolved to a type

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>

ClassNotFoundException: org.aopalliance.intercept.MethodInterceptor

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.

Categories