Spring MVC + Spring Security + LDAP - spring

I have this WebSecurityConfig:
#Configuration
#EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
#Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.authorizeRequests()
.antMatchers("/about", "/register").permitAll()
.antMatchers("/p1", "/p2", "/landing").fullyAuthenticated()
.anyRequest().authenticated()
.and()
.formLogin()
.loginPage("/login")
.permitAll()
.and()
.logout()
.permitAll();
}
#Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth
.ldapAuthentication()
.userDnPatterns("uid={0},ou=people")
.groupSearchBase("ou=groups")
.contextSource()
.ldif("classpath:test-server.ldif")
.and()
.passwordCompare()
.passwordEncoder(new LdapShaPasswordEncoder())
.passwordAttribute("userpassword")
;
}
#Override
public void configure(WebSecurity web) throws Exception {
web
.ignoring()
.antMatchers("/resources/**", "/css/**", "/js/**", "/img/**");
}
My ldif file is properly placed and I have a LoginController returning a html page. However, when building with maven I get:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webSecurityConfig': Unsatisfied dependency expressed through method 'setContentNegotationStrategy' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcContentNegotiationManager' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.accept.ContentNegotiationManager]: Factory method 'mvcContentNegotiationManager' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.web.accept.ContentNegotiationManagerFactoryBean.build()Lorg/springframework/web/accept/ContentNegotiationManager;
My mvn dependency:tree:
[INFO] +- org.springframework.security:spring-security-core:jar:4.2.3.RELEASE:compile
[INFO] | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | +- org.springframework:spring-aop:jar:4.3.9.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:4.3.9.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.3.9.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-web:jar:4.2.3.RELEASE:compile
[INFO] | \- org.springframework:spring-web:jar:4.3.9.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-config:jar:4.2.3.RELEASE:compile
[INFO] +- org.springframework.ldap:spring-ldap-core:jar:2.3.2.RELEASE:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] | \- org.springframework:spring-tx:jar:4.3.4.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-ldap:jar:4.2.3.RELEASE:compile
[INFO] +- com.unboundid:unboundid-ldapsdk:jar:4.0.1:compile
[INFO] +- org.springframework.kafka:spring-kafka:jar:2.0.0.RELEASE:compile
[INFO] | +- org.springframework:spring-messaging:jar:5.0.0.RELEASE:compile
[INFO] | +- org.springframework.retry:spring-retry:jar:1.2.0.RELEASE:compile
[INFO] | \- org.apache.kafka:kafka-clients:jar:0.11.0.0:compile
[INFO] | +- net.jpountz.lz4:lz4:jar:1.3.0:compile
[INFO] | \- org.xerial.snappy:snappy-java:jar:1.1.2.6:compile
[INFO] +- org.springframework:spring-core:jar:5.0.0.RELEASE:compile
[INFO] | \- org.springframework:spring-jcl:jar:5.0.0.RELEASE:compile
[INFO] +- org.springframework:spring-beans:jar:5.0.0.RELEASE:compile
[INFO] +- org.springframework:spring-websocket:jar:5.0.0.RELEASE:compile
[INFO] +- org.apache.hbase:hbase-client:jar:1.3.1:compile
[INFO] | +- org.apache.hbase:hbase-annotations:jar:1.3.1:compile
[INFO] | | +- com.github.stephenc.findbugs:findbugs-annotations:jar:1.3.9-1:compile
[INFO] | | \- log4j:log4j:jar:1.2.17:compile
[INFO] | +- org.apache.hbase:hbase-common:jar:1.3.1:compile
[INFO] | | +- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] | | \- org.mortbay.jetty:jetty-util:jar:6.1.26:compile
[INFO] | +- org.apache.hbase:hbase-protocol:jar:1.3.1:compile
[INFO] | +- commons-codec:commons-codec:jar:1.9:compile
[INFO] | +- commons-io:commons-io:jar:2.4:compile
[INFO] | +- commons-lang:commons-lang:jar:2.6:compile
[INFO] | +- commons-logging:commons-logging:jar:1.2:compile
[INFO] | +- com.google.guava:guava:jar:12.0.1:compile
[INFO] | +- com.google.protobuf:protobuf-java:jar:2.5.0:compile
[INFO] | +- io.netty:netty-all:jar:4.0.23.Final:compile
[INFO] | +- org.apache.zookeeper:zookeeper:jar:3.4.6:compile
[INFO] | | \- org.slf4j:slf4j-log4j12:jar:1.6.1:compile
[INFO] | +- org.apache.htrace:htrace-core:jar:3.1.0-incubating: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] | +- org.jruby.jcodings:jcodings:jar:1.0.8:compile
[INFO] | +- org.jruby.joni:joni:jar:2.1.2:compile
[INFO] | +- com.yammer.metrics:metrics-core:jar:2.2.0:compile
[INFO] | +- org.apache.hadoop:hadoop-auth:jar:2.5.1:compile
[INFO] | | +- org.apache.httpcomponents:httpclient:jar:4.2.5:compile
[INFO] | | | \- org.apache.httpcomponents:httpcore:jar:4.2.4:compile
[INFO] | | \- org.apache.directory.server:apacheds-kerberos-codec:jar:2.0.0-M15:compile
[INFO] | | +- org.apache.directory.server:apacheds-i18n:jar:2.0.0-M15:compile
[INFO] | | +- org.apache.directory.api:api-asn1-api:jar:1.0.0-M20:compile
[INFO] | | \- org.apache.directory.api:api-util:jar:1.0.0-M20:compile
[INFO] | +- org.apache.hadoop:hadoop-common:jar:2.5.1:compile
[INFO] | | +- org.apache.hadoop:hadoop-annotations:jar:2.5.1:compile
[INFO] | | | \- jdk.tools:jdk.tools:jar:1.6:system
[INFO] | | +- commons-cli:commons-cli:jar:1.2:compile
[INFO] | | +- org.apache.commons:commons-math3:jar:3.1.1:compile
[INFO] | | +- xmlenc:xmlenc:jar:0.52:compile
[INFO] | | +- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] | | +- commons-net:commons-net:jar:3.1:compile
[INFO] | | +- commons-el:commons-el:jar:1.0:runtime
[INFO] | | +- commons-configuration:commons-configuration:jar:1.6:compile
[INFO] | | | +- commons-digester:commons-digester:jar:1.8:compile
[INFO] | | | | \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] | | | \- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile
[INFO] | | +- org.apache.avro:avro:jar:1.7.4:compile
[INFO] | | | \- com.thoughtworks.paranamer:paranamer:jar:2.3:compile
[INFO] | | +- com.jcraft:jsch:jar:0.1.42:compile
[INFO] | | +- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] | | \- org.apache.commons:commons-compress:jar:1.4.1:compile
[INFO] | | \- org.tukaani:xz:jar:1.0:compile
[INFO] | +- org.apache.hadoop:hadoop-mapreduce-client-core:jar:2.5.1:compile
[INFO] | | +- org.apache.hadoop:hadoop-yarn-common:jar:2.5.1:compile
[INFO] | | | +- org.apache.hadoop:hadoop-yarn-api:jar:2.5.1:compile
[INFO] | | | \- javax.xml.bind:jaxb-api:jar:2.2.2:compile
[INFO] | | | +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] | | | \- javax.activation:activation:jar:1.1:compile
[INFO] | | \- io.netty:netty:jar:3.6.2.Final:compile
[INFO] | \- junit:junit:jar:4.12:compile
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] +- org.springframework:spring-webmvc:jar:5.0.0.RELEASE:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:4.0.0:provided
[INFO] +- org.thymeleaf:thymeleaf-spring4:jar:2.1.5.RELEASE:compile
[INFO] | \- org.thymeleaf:thymeleaf:jar:2.1.5.RELEASE:compile
[INFO] | +- ognl:ognl:jar:3.0.8:compile
[INFO] | +- org.javassist:javassist:jar:3.16.1-GA:compile
[INFO] | \- org.unbescape:unbescape:jar:1.1.0.RELEASE:compile
[INFO] +- org.springframework.data:spring-data-hadoop:jar:2.5.0.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-hadoop-core:jar:2.5.0.RELEASE:compile
[INFO] | | +- org.apache.hadoop:hadoop-streaming:jar:2.7.3:compile
[INFO] | | +- org.apache.hadoop:hadoop-distcp:jar:2.7.3:compile
[INFO] | | +- org.apache.hadoop:hadoop-hdfs:jar:2.7.3:compile
[INFO] | | | +- org.mortbay.jetty:jetty:jar:6.1.26:compile
[INFO] | | | +- com.sun.jersey:jersey-core:jar:1.9:compile
[INFO] | | | +- com.sun.jersey:jersey-server:jar:1.9:compile
[INFO] | | | | \- asm:asm:jar:3.1:compile
[INFO] | | | +- commons-daemon:commons-daemon:jar:1.0.13:compile
[INFO] | | | +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] | | | +- xerces:xercesImpl:jar:2.9.1:compile
[INFO] | | | | \- xml-apis:xml-apis:jar:1.3.04:compile
[INFO] | | | \- org.fusesource.leveldbjni:leveldbjni-all:jar:1.8:compile
[INFO] | | \- org.apache.hadoop:hadoop-mapreduce-client-jobclient:jar:2.7.3:compile
[INFO] | | +- org.apache.hadoop:hadoop-mapreduce-client-common:jar:2.7.3:compile
[INFO] | | | +- org.apache.hadoop:hadoop-yarn-client:jar:2.7.3:compile
[INFO] | | | \- org.apache.hadoop:hadoop-yarn-server-common:jar:2.7.3:compile
[INFO] | | +- org.apache.hadoop:hadoop-mapreduce-client-shuffle:jar:2.7.3:compile
[INFO] | | | \- org.apache.hadoop:hadoop-yarn-server-nodemanager:jar:2.7.3:compile
[INFO] | | | +- com.sun.jersey:jersey-client:jar:1.9:compile
[INFO] | | | +- com.sun.jersey:jersey-json:jar:1.9:compile
[INFO] | | | | +- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile
[INFO] | | | | +- org.codehaus.jackson:jackson-jaxrs:jar:1.8.3:compile
[INFO] | | | | \- org.codehaus.jackson:jackson-xc:jar:1.8.3:compile
[INFO] | | | \- com.sun.jersey.contribs:jersey-guice:jar:1.9:compile
[INFO] | | \- com.google.inject.extensions:guice-servlet:jar:3.0:compile
[INFO] | | \- com.google.inject:guice:jar:3.0:compile
[INFO] | | \- javax.inject:javax.inject:jar:1:compile
[INFO] | +- org.springframework.data:spring-data-hadoop-hive:jar:2.5.0.RELEASE:compile
[INFO] | | \- org.springframework.batch:spring-batch-core:jar:3.0.7.RELEASE:compile
[INFO] | | +- com.ibm.jbatch:com.ibm.jbatch-tck-spi:jar:1.0:compile
[INFO] | | | \- javax.batch:javax.batch-api:jar:1.0:compile
[INFO] | | +- com.thoughtworks.xstream:xstream:jar:1.4.7:compile
[INFO] | | | +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO] | | | \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] | | +- org.codehaus.jettison:jettison:jar:1.2:compile
[INFO] | | \- org.springframework.batch:spring-batch-infrastructure:jar:3.0.7.RELEASE:compile
[INFO] | +- org.springframework:spring-context-support:jar:4.3.9.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-hadoop-hbase:jar:2.5.0.RELEASE:compile
[INFO] | +- org.springframework:spring-jdbc:jar:4.3.9.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-hadoop-pig:jar:2.5.0.RELEASE:compile
[INFO] | \- org.springframework.data:spring-data-hadoop-batch:jar:2.5.0.RELEASE:compile
[INFO] +- org.springframework:spring-dao:jar:2.0.8:compile
[INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.9.0:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.0:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] \- org.json:json:jar:20170516:compile
Any thoughts?

From the error, it looks like there is some problem with the versions of spring jar files that you are using
If you look at the documentation of ContentNegotiationManagerFactoryBean class here, the build() method was introduced in the version 5.0
public ContentNegotiationManager build()
Actually build the ContentNegotiationManager.
Since:
5.0
The class ContentNegotiationManagerFactoryBean is present in the org.springframework:spring-web jar file. As per your mvn dependency tree, the version is org.springframework:spring-web:jar:4.3.9.RELEASE
This 4.3.9 version doesn't contain build() method as per the documentation 4.3.9 release . So, you are getting this error.
If you can change org.springframework:spring-web:jar:4.3.9.RELEASE to org.springframework:spring-web:jar:5.0.0.RELEASE, it should solve your problem.

I had a similar problem:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityConfig': Unsatisfied dependency expressed through method 'setContentNegotationStrategy' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcContentNegotiationManager' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.accept.ContentNegotiationManager]: Factory method 'mvcContentNegotiationManager' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.web.accept.ContentNegotiationManagerFactoryBean.build()Lorg/springframework/web/accept/ContentNegotiationManager;
My dependencies in build.gradle:
buildscript {
ext {
springBootVersion = '1.5.9.RELEASE'
}
repositories {
mavenCentral()
maven { url "http://repo.spring.io/libs-release" }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
.....
dependencies {
compile('org.springframework:spring-webmvc:2.5.2.RELEASE')
compile('org.springframework.boot:spring-boot-starter-jersey')
compile('org.springframework.boot:spring-boot-starter-security')
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile('org.springframework.security:spring-security-test')
}
I open File/Project structure/Libraries (i use intellij idea) and checked versions of dependences:
I am not sure but i think then i not clearly specified versions of dependencies Gradle used previous version for this dependencies on default.
Then i specified manually necessary version in build.gradle:
dependencies {
compile 'org.springframework:spring-webmvc:5.0.2.RELEASE'
compile 'org.springframework:spring-web:5.0.2.RELEASE'
compile 'org.springframework:spring-expression:5.0.2.RELEASE'
compile 'org.springframework:spring-aop:5.0.2.RELEASE'
compile 'org.springframework:spring-beans:5.0.2.RELEASE'
compile 'org.springframework:spring-context:5.0.2.RELEASE'
compile 'org.springframework:spring-core:5.0.2.RELEASE'
compile 'org.springframework:spring-test:5.0.2.RELEASE'
compile('org.springframework.boot:spring-boot-starter-jersey')
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.3'
compile 'com.fasterxml.jackson.core:jackson-core:2.9.3'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.9.3'
compile('org.springframework.security:spring-security-web:5.0.0.RELEASE')
compile('org.springframework.security:spring-security-config:5.0.0.RELEASE')
compile('org.springframework.security:spring-security-core:5.0.0.RELEASE')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
It is helped me.

Related

java.lang.NoSuchMethodError: org.springframework.web.reactive.socket.client.ReactorNettyWebSocketClient.<init>(Ljava/util/function/Consumer;)V

I am use spring-cloud-gateay in my service mesh, when start it I have get a error:
Caused by: java.lang.NoSuchMethodError: org.springframework.web.reactive.socket.client.ReactorNettyWebSocketClient.<init>(Ljava/util/function/Consumer;)V
Dependencies:
[INFO] --- maven-dependency-plugin:3.0.2:tree (default-cli) # gateway ---
[INFO] cn.rctech.egg:gateway:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter:jar:2.0.3.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot:jar:2.0.3.RELEASE:compile
[INFO] | | \- org.springframework:spring-context:jar:5.1.6.RELEASE:compile
[INFO] | | +- org.springframework:spring-aop:jar:5.1.6.RELEASE:compile
[INFO] | | +- org.springframework:spring-beans:jar:5.1.6.RELEASE:compile
[INFO] | | \- org.springframework:spring-expression:jar:5.1.6.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.0.3.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-logging:jar:2.0.3.RELEASE:compile
[INFO] | | +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | | | +- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] | | | \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.10.0:compile
[INFO] | | | \- org.apache.logging.log4j:log4j-api:jar:2.10.0:compile
[INFO] | | \- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] | +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] | +- org.springframework:spring-core:jar:5.1.6.RELEASE:compile
[INFO] | | \- org.springframework:spring-jcl:jar:5.1.6.RELEASE:compile
[INFO] | \- org.yaml:snakeyaml:jar:1.19:runtime
[INFO] +- org.springframework.cloud:spring-cloud-starter-gateway:jar:2.0.3.RELEASE:compile
[INFO] | +- org.springframework.cloud:spring-cloud-gateway-core:jar:2.0.3.RELEASE:compile
[INFO] | | \- io.projectreactor.addons:reactor-extra:jar:3.1.6.RELEASE:compile
[INFO] | | \- io.projectreactor:reactor-core:jar:3.1.8.RELEASE:compile
[INFO] | | \- org.reactivestreams:reactive-streams:jar:1.0.2:compile
[INFO] | \- org.springframework.boot:spring-boot-starter-webflux:jar:2.0.3.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:2.0.3.RELEASE:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.7:compile
[INFO] | | | \- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.7:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.7:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.7:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.7:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-reactor-netty:jar:2.0.3.RELEASE:compile
[INFO] | | \- io.projectreactor.ipc:reactor-netty:jar:0.7.8.RELEASE:compile
[INFO] | | +- io.netty:netty-codec-http:jar:4.1.25.Final:compile
[INFO] | | | \- io.netty:netty-codec:jar:4.1.25.Final:compile
[INFO] | | +- io.netty:netty-handler:jar:4.1.25.Final:compile
[INFO] | | | +- io.netty:netty-buffer:jar:4.1.25.Final:compile
[INFO] | | | \- io.netty:netty-transport:jar:4.1.25.Final:compile
[INFO] | | | \- io.netty:netty-resolver:jar:4.1.25.Final:compile
[INFO] | | +- io.netty:netty-handler-proxy:jar:4.1.25.Final:compile
[INFO] | | | \- io.netty:netty-codec-socks:jar:4.1.25.Final:compile
[INFO] | | \- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.25.Final:compile
[INFO] | | +- io.netty:netty-common:jar:4.1.25.Final:compile
[INFO] | | \- io.netty:netty-transport-native-unix-common:jar:4.1.25.Final:compile
[INFO] | +- org.hibernate.validator:hibernate-validator:jar:6.0.10.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] | +- org.springframework:spring-web:jar:5.1.6.RELEASE:compile
[INFO] | +- org.springframework:spring-webflux:jar:5.1.6.RELEASE:compile
[INFO] | \- org.synchronoss.cloud:nio-multipart-parser:jar:1.1.0:compile
[INFO] | \- org.synchronoss.cloud:nio-stream-storage:jar:1.1.3:compile
[INFO] +- com.alibaba.boot:nacos-config-spring-boot-starter:jar:0.2.1:compile
[INFO] | +- com.alibaba.nacos:nacos-spring-context:jar:0.2.3-RC1:compile
[INFO] | | +- com.alibaba.nacos:nacos-client:jar:1.0.0:compile
[INFO] | | | +- com.alibaba.nacos:nacos-common:jar:1.0.0:compile
[INFO] | | | | +- commons-io:commons-io:jar:2.6:compile
[INFO] | | | | \- org.apache.commons:commons-lang3:jar:3.7:compile
[INFO] | | | +- com.alibaba.nacos:nacos-api:jar:1.0.0:compile
[INFO] | | | | \- com.alibaba:fastjson:jar:1.2.47:compile
[INFO] | | | +- com.google.guava:guava:jar:23.0:compile
[INFO] | | | | +- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] | | | | +- com.google.errorprone:error_prone_annotations:jar:2.0.18:compile
[INFO] | | | | +- com.google.j2objc:j2objc-annotations:jar:1.1:compile
[INFO] | | | | \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.14:compile
[INFO] | | | +- commons-codec:commons-codec:jar:1.10:compile
[INFO] | | | +- com.fasterxml.jackson.core:jackson-core:jar:2.9.7:compile
[INFO] | | | \- io.prometheus:simpleclient:jar:0.5.0:compile
[INFO] | | \- com.alibaba.spring:spring-context-support:jar:1.0.1:compile
[INFO] | +- com.alibaba.boot:nacos-config-spring-boot-autoconfigure:jar:0.2.1:compile
[INFO] | \- com.alibaba.boot:nacos-spring-boot-base:jar:0.2.1:compile
[INFO] +- com.alibaba.boot:nacos-discovery-spring-boot-starter:jar:0.2.1:compile
[INFO] | \- com.alibaba.boot:nacos-discovery-spring-boot-autoconfigure:jar:0.2.1:compile
[INFO] \- org.springframework.cloud:spring-cloud-starter:jar:2.0.3.RELEASE:compile
[INFO] +- org.springframework.cloud:spring-cloud-context:jar:2.0.3.RELEASE:compile
[INFO] | \- org.springframework.security:spring-security-crypto:jar:5.0.6.RELEASE:compile
[INFO] +- org.springframework.cloud:spring-cloud-commons:jar:2.0.3.RELEASE:compile
[INFO] \- org.springframework.security:spring-security-rsa:jar:1.0.7.RELEASE:compile
[INFO] \- org.bouncycastle:bcpkix-jdk15on:jar:1.60:compile
[INFO] \- org.bouncycastle:bcprov-jdk15on:jar:1.60:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
After read source code I found The org.springframework.web.reactive.socket.client.ReactorNettyWebSocketClient of org.springframework:spring-webflux:5.1.6.RELEASE is :
public class ReactorNettyWebSocketClient implements WebSocketClient {
private static final Log logger = LogFactory.getLog(ReactorNettyWebSocketClient.class);
private final HttpClient httpClient;
/**
* Default constructor.
*/
public ReactorNettyWebSocketClient() {
this(HttpClient.create());
}
/**
* Constructor that accepts an existing {#link HttpClient} builder.
* #since 5.1
*/
public ReactorNettyWebSocketClient(HttpClient httpClient) {
Assert.notNull(httpClient, "HttpClient is required");
this.httpClient = httpClient;
}
.....
}
It's second constructor above need a HttpClient object to instance, that mismatched with org/springframework/cloud/gateway/config/GatewayAutoConfiguration$NettyConfiguration.class.
#Bean
public ReactorNettyWebSocketClient reactorNettyWebSocketClient(#Qualifier("nettyClientOptions") Consumer<? super HttpClientOptions.Builder> options) {
return new ReactorNettyWebSocketClient(options);
}
This bug is documented on Github.
Here is one of the correct combinations of Versions that will work:
Parent:
<parent>
<groupSId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.X</version> // I tested on <version>2.2.1.RELEASE</version>
</parent>
Cloud Version:
<spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>

Spring bean initialization with autowired simpMessagingTemplate

I'm building a Spring MVC project which, at certain point should be able to read from a Kafka topic and send consumed data to some frontend. To achieve that, I'm using:
Spring KafkaTemplate, in order to consume messages from Kafka Server.
SimpMessagingTemplate, to send each consumed message to frontend, via Spring Websockets.
This is what I have:
KafkaConfig.java
#Configuration
#EnableKafka
public class KafkaConfig {
#Bean
KafkaListenerContainerFactory<ConcurrentMessageListenerContainer<String, String>>
kafkaListenerContainerFactory() {
ConcurrentKafkaListenerContainerFactory<String, String> factory =
new ConcurrentKafkaListenerContainerFactory<>();
factory.setConsumerFactory(consumerFactory());
factory.setConcurrency(3);
factory.getContainerProperties().setPollTimeout(3000);
return factory;
}
#Bean
public ConsumerFactory<String, String> consumerFactory() {
return new DefaultKafkaConsumerFactory<>(consumerConfigs());
}
#Bean
public Map<String, Object> consumerConfigs() {
Map<String, Object> props = new HashMap<>();
props.put("bootstrap.servers", "localhost:9092");
props.put("group.id", "metrics");
props.put("enable.auto.commit", "true");
props.put("auto.commit.interval.ms", "1000");
props.put("session.timeout.ms", "30000");
props.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
props.put("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
return props;
}
#Bean
public KafkaReceiver receiver() {
return new KafkaReceiver();
}
}
KafkaReceiver.java
public class KafkaReceiver {
#Autowired
private SimpMessagingTemplate simpMessagingTemplate;
#KafkaListener(topics = "metrics")
public void receive(ConsumerRecord<?, ?> record) {
MetricRecord m = new MetricRecord(new Long(record.offset()), record.key().toString(), record.value().toString());
this.simpMessagingTemplate.convertAndSend("/metrics/records", m.toString());
}
}
I also have WebSocketConfig in place. At this moment, it is:
#Configuration
#EnableWebSocketMessageBroker
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
#Override
public void configureMessageBroker(MessageBrokerRegistry config) {
config.enableSimpleBroker("/metrics");
config.setApplicationDestinationPrefixes("/metricsApp");
}
#Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/kafka-metrics-websocket").withSockJS();
}
}
This is my dependency tree:
[INFO] +- org.springframework.kafka:spring-kafka:jar:2.0.0.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:5.0.0.RELEASE:compile
[INFO] | +- org.springframework:spring-messaging:jar:5.0.0.RELEASE:compile
[INFO] | +- org.springframework:spring-tx:jar:5.0.0.RELEASE:compile
[INFO] | +- org.springframework.retry:spring-retry:jar:1.2.0.RELEASE:compile
[INFO] | \- org.apache.kafka:kafka-clients:jar:0.11.0.0:compile
[INFO] | +- net.jpountz.lz4:lz4:jar:1.3.0:compile
[INFO] | \- org.xerial.snappy:snappy-java:jar:1.1.2.6:compile
[INFO] +- org.springframework:spring-core:jar:4.3.11.RELEASE:compile
[INFO] | \- commons-logging:commons-logging:jar:1.2:compile
[INFO] +- org.springframework:spring-beans:jar:5.0.0.RELEASE:compile
[INFO] +- org.springframework:spring-websocket:jar:4.3.11.RELEASE:compile
[INFO] | \- org.springframework:spring-web:jar:4.3.11.RELEASE:compile
[INFO] +- org.apache.hbase:hbase-client:jar:1.3.1:compile
[INFO] | +- org.apache.hbase:hbase-annotations:jar:1.3.1:compile
[INFO] | | +- com.github.stephenc.findbugs:findbugs-annotations:jar:1.3.9-1:compile
[INFO] | | \- log4j:log4j:jar:1.2.17:compile
[INFO] | +- org.apache.hbase:hbase-common:jar:1.3.1:compile
[INFO] | | +- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] | | \- org.mortbay.jetty:jetty-util:jar:6.1.26:compile
[INFO] | +- org.apache.hbase:hbase-protocol:jar:1.3.1:compile
[INFO] | +- commons-codec:commons-codec:jar:1.9:compile
[INFO] | +- commons-io:commons-io:jar:2.4:compile
[INFO] | +- commons-lang:commons-lang:jar:2.6:compile
[INFO] | +- com.google.guava:guava:jar:12.0.1:compile
[INFO] | +- com.google.protobuf:protobuf-java:jar:2.5.0:compile
[INFO] | +- io.netty:netty-all:jar:4.0.23.Final:compile
[INFO] | +- org.apache.zookeeper:zookeeper:jar:3.4.6:compile
[INFO] | | \- org.slf4j:slf4j-log4j12:jar:1.6.1:compile
[INFO] | +- org.apache.htrace:htrace-core:jar:3.1.0-incubating: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] | +- org.jruby.jcodings:jcodings:jar:1.0.8:compile
[INFO] | +- org.jruby.joni:joni:jar:2.1.2:compile
[INFO] | +- com.yammer.metrics:metrics-core:jar:2.2.0:compile
[INFO] | +- org.apache.hadoop:hadoop-auth:jar:2.5.1:compile
[INFO] | | +- org.apache.httpcomponents:httpclient:jar:4.2.5:compile
[INFO] | | | \- org.apache.httpcomponents:httpcore:jar:4.2.4:compile
[INFO] | | \- org.apache.directory.server:apacheds-kerberos-codec:jar:2.0.0-M15:compile
[INFO] | | +- org.apache.directory.server:apacheds-i18n:jar:2.0.0-M15:compile
[INFO] | | +- org.apache.directory.api:api-asn1-api:jar:1.0.0-M20:compile
[INFO] | | \- org.apache.directory.api:api-util:jar:1.0.0-M20:compile
[INFO] | +- org.apache.hadoop:hadoop-common:jar:2.5.1:compile
[INFO] | | +- org.apache.hadoop:hadoop-annotations:jar:2.5.1:compile
[INFO] | | | \- jdk.tools:jdk.tools:jar:1.6:system
[INFO] | | +- commons-cli:commons-cli:jar:1.2:compile
[INFO] | | +- org.apache.commons:commons-math3:jar:3.1.1:compile
[INFO] | | +- xmlenc:xmlenc:jar:0.52:compile
[INFO] | | +- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] | | +- commons-net:commons-net:jar:3.1:compile
[INFO] | | +- commons-el:commons-el:jar:1.0:runtime
[INFO] | | +- commons-configuration:commons-configuration:jar:1.6:compile
[INFO] | | | +- commons-digester:commons-digester:jar:1.8:compile
[INFO] | | | | \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] | | | \- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile
[INFO] | | +- org.apache.avro:avro:jar:1.7.4:compile
[INFO] | | | \- com.thoughtworks.paranamer:paranamer:jar:2.3:compile
[INFO] | | +- com.jcraft:jsch:jar:0.1.42:compile
[INFO] | | +- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] | | \- org.apache.commons:commons-compress:jar:1.4.1:compile
[INFO] | | \- org.tukaani:xz:jar:1.0:compile
[INFO] | +- org.apache.hadoop:hadoop-mapreduce-client-core:jar:2.5.1:compile
[INFO] | | +- org.apache.hadoop:hadoop-yarn-common:jar:2.5.1:compile
[INFO] | | | +- org.apache.hadoop:hadoop-yarn-api:jar:2.5.1:compile
[INFO] | | | \- javax.xml.bind:jaxb-api:jar:2.2.2:compile
[INFO] | | | +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] | | | \- javax.activation:activation:jar:1.1:compile
[INFO] | | \- io.netty:netty:jar:3.6.2.Final:compile
[INFO] | \- junit:junit:jar:4.12:compile
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] +- org.springframework:spring-webmvc:jar:4.3.10.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.3.10.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.3.10.RELEASE:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:4.0.0:provided
[INFO] +- org.thymeleaf:thymeleaf-spring4:jar:2.1.5.RELEASE:compile
[INFO] | +- org.thymeleaf:thymeleaf:jar:2.1.5.RELEASE:compile
[INFO] | | +- ognl:ognl:jar:3.0.8:compile
[INFO] | | +- org.javassist:javassist:jar:3.16.1-GA:compile
[INFO] | | \- org.unbescape:unbescape:jar:1.1.0.RELEASE:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.6.6:compile
[INFO] +- org.springframework.data:spring-data-hadoop:jar:2.5.0.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-hadoop-core:jar:2.5.0.RELEASE:compile
[INFO] | | +- org.apache.hadoop:hadoop-streaming:jar:2.7.3:compile
[INFO] | | +- org.apache.hadoop:hadoop-distcp:jar:2.7.3:compile
[INFO] | | +- org.apache.hadoop:hadoop-hdfs:jar:2.7.3:compile
[INFO] | | | +- org.mortbay.jetty:jetty:jar:6.1.26:compile
[INFO] | | | +- com.sun.jersey:jersey-core:jar:1.9:compile
[INFO] | | | +- com.sun.jersey:jersey-server:jar:1.9:compile
[INFO] | | | | \- asm:asm:jar:3.1:compile
[INFO] | | | +- commons-daemon:commons-daemon:jar:1.0.13:compile
[INFO] | | | +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] | | | +- xerces:xercesImpl:jar:2.9.1:compile
[INFO] | | | | \- xml-apis:xml-apis:jar:1.3.04:compile
[INFO] | | | \- org.fusesource.leveldbjni:leveldbjni-all:jar:1.8:compile
[INFO] | | \- org.apache.hadoop:hadoop-mapreduce-client-jobclient:jar:2.7.3:compile
[INFO] | | +- org.apache.hadoop:hadoop-mapreduce-client-common:jar:2.7.3:compile
[INFO] | | | +- org.apache.hadoop:hadoop-yarn-client:jar:2.7.3:compile
[INFO] | | | \- org.apache.hadoop:hadoop-yarn-server-common:jar:2.7.3:compile
[INFO] | | +- org.apache.hadoop:hadoop-mapreduce-client-shuffle:jar:2.7.3:compile
[INFO] | | | \- org.apache.hadoop:hadoop-yarn-server-nodemanager:jar:2.7.3:compile
[INFO] | | | +- com.sun.jersey:jersey-client:jar:1.9:compile
[INFO] | | | +- com.sun.jersey:jersey-json:jar:1.9:compile
[INFO] | | | | +- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile
[INFO] | | | | +- org.codehaus.jackson:jackson-jaxrs:jar:1.8.3:compile
[INFO] | | | | \- org.codehaus.jackson:jackson-xc:jar:1.8.3:compile
[INFO] | | | \- com.sun.jersey.contribs:jersey-guice:jar:1.9:compile
[INFO] | | \- com.google.inject.extensions:guice-servlet:jar:3.0:compile
[INFO] | | \- com.google.inject:guice:jar:3.0:compile
[INFO] | | \- javax.inject:javax.inject:jar:1:compile
[INFO] | +- org.springframework.data:spring-data-hadoop-hive:jar:2.5.0.RELEASE:compile
[INFO] | | \- org.springframework.batch:spring-batch-core:jar:3.0.7.RELEASE:compile
[INFO] | | +- com.ibm.jbatch:com.ibm.jbatch-tck-spi:jar:1.0:compile
[INFO] | | | \- javax.batch:javax.batch-api:jar:1.0:compile
[INFO] | | +- com.thoughtworks.xstream:xstream:jar:1.4.7:compile
[INFO] | | | +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO] | | | \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] | | +- org.codehaus.jettison:jettison:jar:1.2:compile
[INFO] | | \- org.springframework.batch:spring-batch-infrastructure:jar:3.0.7.RELEASE:compile
[INFO] | +- org.springframework:spring-context-support:jar:4.3.9.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-hadoop-hbase:jar:2.5.0.RELEASE:compile
[INFO] | +- org.springframework:spring-jdbc:jar:4.3.9.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-hadoop-pig:jar:2.5.0.RELEASE:compile
[INFO] | \- org.springframework.data:spring-data-hadoop-batch:jar:2.5.0.RELEASE:compile
[INFO] +- org.springframework:spring-dao:jar:2.0.8:compile
[INFO] | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.9.0:compile
[INFO] \- com.fasterxml.jackson.core:jackson-databind:jar:2.9.0:compile
[INFO] \- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
When running this project I get the following error (full log):
java.lang.NullPointerException
at org.springframework.context.annotation.AnnotationBeanNameGenerator.isStereotypeWithNameValue(AnnotationBeanNameGenerator.java:123)
at org.springframework.context.annotation.AnnotationBeanNameGenerator.determineBeanNameFromAnnotation(AnnotationBeanNameGenerator.java:94)
at org.springframework.context.annotation.AnnotationBeanNameGenerator.generateBeanName(AnnotationBeanNameGenerator.java:72)
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.doRegisterBean(AnnotatedBeanDefinitionReader.java:224)
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:145)
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.register(AnnotatedBeanDefinitionReader.java:135)
at org.springframework.web.context.support.AnnotationConfigWebApplicationContext.loadBeanDefinitions(AnnotationConfigWebApplicationContext.java:210)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:133)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:620)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:521)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:890)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:532)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:853)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:344)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1501)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1463)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:785)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:41)
at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:188)
at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:502)
at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:150)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:180)
at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:447)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:64)
at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:610)
at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:529)
at org.eclipse.jetty.util.Scanner.scan(Scanner.java:392)
at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:313)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:150)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:564)
at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:239)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
at org.eclipse.jetty.server.Server.start(Server.java:452)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.Server.doStart(Server.java:419)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1515)
at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1439)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1438)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.jetty.start.Main.invokeMain(Main.java:221)
at org.eclipse.jetty.start.Main.start(Main.java:506)
at org.eclipse.jetty.start.Main.main(Main.java:78)
2017-10-02 16:25:35.967:INFO:oejs.AbstractConnector:main: Started ServerConnector#6b695b06{HTTP/1.1,[http/1.1]}{0.0.0.0:8082}
2017-10-02 16:25:35.970:INFO:oejs.Server:main: Started #7601ms
Any thoughts?
I think there is really more stack trace to determine the root of cause.
On the other hand you have mentioned Spring Websockets, but we really don't see any declaration for that. Something like #EnableWebSocketMessageBroker?
UPDATE
You have a mix of versions:
[INFO] +- org.springframework:spring-beans:jar:5.0.0.RELEASE:compile
[INFO] +- org.springframework:spring-websocket:jar:4.3.11.RELEASE:compile
[INFO] | \- org.springframework:spring-web:jar:4.3.11.RELEASE:compile
Consider to use everything from org.springframework in the version 5.0.

Upgrading Spring Boot from 1.3.7 to 1.4.0 causing NullPointerException in AuthenticatorBase.getJaspicProvider

This is somewhat caused by the tomcat-embed-core version 8.5.4 that comes with the spring-boot-starter-jersey. It generates an error shown below on all integration tests. It will only work if I override the pom to use tomcat-embed-core version 8.0.36. What's weird is, that's the only error message I get.
java.lang.NullPointerException: null
at org.apache.catalina.authenticator.AuthenticatorBase.getJaspicProvider(AuthenticatorBase.java:1140)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:431)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Here's my dependecy tree:
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) # sample-services ---
[INFO] com.sample:sample-services:jar:1.0.0-SNAPSHOT
[INFO] +- com.sample:sample-customer:jar:1.0.0-SNAPSHOT:compile
[INFO] | +- com.sample:sample-core:jar:1.0.0-SNAPSHOT:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.4.0.RELEASE:compile
[INFO] | | | +- org.springframework.boot:spring-boot-starter-aop:jar:1.4.0.RELEASE:compile
[INFO] | | | | \- org.aspectj:aspectjweaver:jar:1.8.9:compile
[INFO] | | | +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.4.0.RELEASE:compile
[INFO] | | | | +- org.apache.tomcat:tomcat-jdbc:jar:8.5.4:compile
[INFO] | | | | | \- org.apache.tomcat:tomcat-juli:jar:8.5.4:compile
[INFO] | | | | \- org.springframework:spring-jdbc:jar:4.3.2.RELEASE:compile
[INFO] | | | +- org.hibernate:hibernate-core:jar:5.0.9.Final:compile
[INFO] | | | | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] | | | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | | | +- org.jboss:jandex:jar:2.0.0.Final:compile
[INFO] | | | | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | | | | \- xml-apis:xml-apis:jar:1.4.01:compile
[INFO] | | | | \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
[INFO] | | | +- org.hibernate:hibernate-entitymanager:jar:5.0.9.Final:compile
[INFO] | | | +- javax.transaction:javax.transaction-api:jar:1.2:compile
[INFO] | | | +- org.springframework.data:spring-data-jpa:jar:1.10.2.RELEASE:compile
[INFO] | | | | \- org.springframework:spring-orm:jar:4.3.2.RELEASE:compile
[INFO] | | | \- org.springframework:spring-aspects:jar:4.3.2.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.4.0.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.1.7:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.1.7:compile
[INFO] | | | +- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile
[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile
[INFO] | | +- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] | | +- com.h2database:h2:jar:1.4.192:compile
[INFO] | | +- org.postgresql:postgresql:jar:9.4.1209.jre7:compile
[INFO] | | +- javax:javaee-api:jar:7.0:compile
[INFO] | | | \- com.sun.mail:javax.mail:jar:1.5.5:compile
[INFO] | | | \- javax.activation:activation:jar:1.1:compile
[INFO] | | +- org.apache.commons:commons-lang3:jar:3.4:compile
[INFO] | | +- commons-codec:commons-codec:jar:1.10:compile
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.4.5:compile
[INFO] | | +- org.joda:joda-money:jar:0.10.0:compile
[INFO] | | \- com.sun.jna:jna:jar:3.0.9:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-data-elasticsearch:jar:1.4.0.RELEASE:compile
[INFO] | | \- org.springframework.data:spring-data-elasticsearch:jar:2.0.2.RELEASE:compile
[INFO] | | +- org.springframework:spring-tx:jar:4.3.2.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:1.12.2.RELEASE:compile
[INFO] | | +- commons-lang:commons-lang:jar:2.6:compile
[INFO] | | \- org.elasticsearch:elasticsearch:jar:2.3.4:compile
[INFO] | | +- org.apache.lucene:lucene-core:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-backward-codecs:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-analyzers-common:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-queries:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-memory:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-highlighter:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-queryparser:jar:5.5.0:compile
[INFO] | | | \- org.apache.lucene:lucene-sandbox:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-suggest:jar:5.5.0:compile
[INFO] | | | \- org.apache.lucene:lucene-misc:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-join:jar:5.5.0:compile
[INFO] | | | \- org.apache.lucene:lucene-grouping:jar:5.5.0:compile
[INFO] | | +- org.apache.lucene:lucene-spatial:jar:5.5.0:compile
[INFO] | | | +- org.apache.lucene:lucene-spatial3d:jar:5.5.0:compile
[INFO] | | | \- com.spatial4j:spatial4j:jar:0.5:compile
[INFO] | | +- org.elasticsearch:securesm:jar:1.0:compile
[INFO] | | +- com.carrotsearch:hppc:jar:0.7.1:compile
[INFO] | | +- org.joda:joda-convert:jar:1.2:compile
[INFO] | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.8.1:compile
[INFO] | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.8.1:compile
[INFO] | | +- io.netty:netty:jar:3.10.5.Final:compile
[INFO] | | +- com.ning:compress-lzf:jar:1.0.2:compile
[INFO] | | +- com.tdunning:t-digest:jar:3.0:compile
[INFO] | | +- org.hdrhistogram:HdrHistogram:jar:2.1.6:compile
[INFO] | | +- commons-cli:commons-cli:jar:1.3.1:compile
[INFO] | | \- com.twitter:jsr166e:jar:1.1.0:compile
[INFO] | +- com.google.guava:guava:jar:19.0:compile
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.2:compile
[INFO] | +- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] | +- commons-io:commons-io:jar:2.5:compile
[INFO] | +- net.sf.uadetector:uadetector-core:jar:0.9.22:compile
[INFO] | | +- net.sf.qualitycheck:quality-check:jar:1.3:compile
[INFO] | | +- com.google.code.findbugs:jsr305:jar:2.0.3:compile
[INFO] | | \- javax.annotation:jsr250-api:jar:1.0:compile
[INFO] | +- net.sf.uadetector:uadetector-resources:jar:2014.10:compile
[INFO] | \- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.8.1:compile
[INFO] +- com.sample:sample-messaging:jar:1.0.0-SNAPSHOT:compile
[INFO] | +- com.amazonaws:aws-java-sdk-sns:jar:1.11.24:compile
[INFO] | \- com.amazonaws:aws-java-sdk-sqs:jar:1.11.24:compile
[INFO] +- org.springframework.boot:spring-boot-starter-jersey:jar:1.4.0.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.4.0.RELEASE:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.17:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.4.0.RELEASE:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.4:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.4:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.4:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-validation:jar:1.4.0.RELEASE:compile
[INFO] | +- org.springframework:spring-web:jar:4.3.2.RELEASE:compile
[INFO] | | +- org.springframework:spring-aop:jar:4.3.2.RELEASE:compile
[INFO] | | +- org.springframework:spring-beans:jar:4.3.2.RELEASE:compile
[INFO] | | \- org.springframework:spring-context:jar:4.3.2.RELEASE:compile
[INFO] | +- org.glassfish.jersey.core:jersey-server:jar:2.23.1:compile
[INFO] | | +- org.glassfish.jersey.core:jersey-client:jar:2.23.1:compile
[INFO] | | +- org.glassfish.jersey.media:jersey-media-jaxb:jar:2.23.1:compile
[INFO] | | +- javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO] | | +- org.glassfish.hk2:hk2-api:jar:2.4.0-b34:compile
[INFO] | | | +- org.glassfish.hk2:hk2-utils:jar:2.4.0-b34:compile
[INFO] | | | \- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.4.0-b34:compile
[INFO] | | \- org.glassfish.hk2:hk2-locator:jar:2.4.0-b34:compile
[INFO] | | \- org.javassist:javassist:jar:3.20.0-GA:compile
[INFO] | +- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.23.1:compile
[INFO] | +- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.23.1:compile
[INFO] | +- org.glassfish.jersey.ext:jersey-spring3:jar:2.23.1:compile
[INFO] | | +- org.glassfish.hk2:hk2:jar:2.4.0-b34:compile
[INFO] | | | +- org.glassfish.hk2:config-types:jar:2.4.0-b34:compile
[INFO] | | | +- org.glassfish.hk2:hk2-core:jar:2.4.0-b34:compile
[INFO] | | | +- org.glassfish.hk2:hk2-config:jar:2.4.0-b34:compile
[INFO] | | | +- org.glassfish.hk2:hk2-runlevel:jar:2.4.0-b34:compile
[INFO] | | | \- org.glassfish.hk2:class-model:jar:2.4.0-b34:compile
[INFO] | | | \- org.glassfish.hk2.external:asm-all-repackaged:jar:2.4.0-b34:compile
[INFO] | | \- org.glassfish.hk2:spring-bridge:jar:2.4.0-b34:compile
[INFO] | \- org.glassfish.jersey.media:jersey-media-json-jackson:jar:2.23.1:compile
[INFO] | +- org.glassfish.jersey.ext:jersey-entity-filtering:jar:2.23.1:compile
[INFO] | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.8.1:compile
[INFO] | \- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.8.1:compile
[INFO] | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.8.1:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.8.1:compile
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.4.0.RELEASE:compile
[INFO] | +- org.hibernate:hibernate-validator:jar:5.2.4.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.3.1:compile
[INFO] | \- org.springframework:spring-webmvc:jar:4.3.2.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.3.2.RELEASE:compile
[INFO] +- com.amazonaws:aws-java-sdk-s3:jar:1.11.24:compile
[INFO] | +- com.amazonaws:aws-java-sdk-kms:jar:1.11.24:compile
[INFO] | \- com.amazonaws:aws-java-sdk-core:jar:1.11.24:compile
[INFO] | +- commons-logging:commons-logging:jar:1.1.3:compile
[INFO] | +- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.8.1:compile
[INFO] | \- joda-time:joda-time:jar:2.9.4:compile
[INFO] +- com.wordnik:swagger-jersey2-jaxrs_2.10:jar:1.3.13:compile
[INFO] | +- com.wordnik:swagger-jaxrs_2.10:jar:1.3.13:compile
[INFO] | | +- com.wordnik:swagger-core_2.10:jar:1.3.13:compile
[INFO] | | | +- com.fasterxml.jackson.module:jackson-module-scala_2.10:jar:2.4.1:compile
[INFO] | | | | \- com.thoughtworks.paranamer:paranamer:jar:2.6:compile
[INFO] | | | +- com.fasterxml.jackson.module:jackson-module-jsonSchema:jar:2.4.1:compile
[INFO] | | | +- com.wordnik:swagger-annotations:jar:1.3.13:compile
[INFO] | | | +- org.json4s:json4s-ext_2.10:jar:3.2.11:compile
[INFO] | | | +- org.json4s:json4s-native_2.10:jar:3.2.11:compile
[INFO] | | | | \- org.json4s:json4s-core_2.10:jar:3.2.11:compile
[INFO] | | | | +- org.json4s:json4s-ast_2.10:jar:3.2.11:compile
[INFO] | | | | \- org.scala-lang:scalap:jar:2.10.0:compile
[INFO] | | | | \- org.scala-lang:scala-compiler:jar:2.10.0:compile
[INFO] | | | \- org.json4s:json4s-jackson_2.10:jar:3.2.11:compile
[INFO] | | \- org.reflections:reflections:jar:0.9.9:compile
[INFO] | | \- com.google.code.findbugs:annotations:jar:2.0.1:compile
[INFO] | \- org.glassfish.jersey.media:jersey-media-multipart:jar:2.1:compile
[INFO] | \- org.jvnet.mimepull:mimepull:jar:1.8:compile
[INFO] +- org.glassfish.jersey.ext:jersey-bean-validation:jar:2.23.1:compile
[INFO] | +- org.glassfish.hk2.external:javax.inject:jar:2.4.0-b34:compile
[INFO] | +- org.glassfish.jersey.core:jersey-common:jar:2.23.1:compile
[INFO] | | +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.23.1:compile
[INFO] | | \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
[INFO] | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | +- javax.el:javax.el-api:jar:2.2.4:compile
[INFO] | +- org.glassfish.web:javax.el:jar:2.2.4:compile
[INFO] | \- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
[INFO] +- com.jayway.restassured:rest-assured:jar:2.9.0:test
[INFO] | +- org.codehaus.groovy:groovy:jar:2.4.7:test
[INFO] | +- org.codehaus.groovy:groovy-xml:jar:2.4.7:test
[INFO] | +- org.apache.httpcomponents:httpmime:jar:4.5.2:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] | +- org.ccil.cowan.tagsoup:tagsoup:jar:1.2.1:test
[INFO] | +- com.jayway.restassured:json-path:jar:2.9.0:test
[INFO] | | +- org.codehaus.groovy:groovy-json:jar:2.4.7:test
[INFO] | | \- com.jayway.restassured:rest-assured-common:jar:2.9.0:test
[INFO] | \- com.jayway.restassured:xml-path:jar:2.9.0:test
[INFO] +- com.jayway.jsonpath:json-path:jar:2.2.0:compile
[INFO] | +- net.minidev:json-smart:jar:2.2.1:compile
[INFO] | | \- net.minidev:accessors-smart:jar:1.1:compile
[INFO] | | \- org.ow2.asm:asm:jar:5.0.3:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.4.0.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:1.4.0.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.4.0.RELEASE:test
[INFO] | +- junit:junit:jar:4.12:test
[INFO] | +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | | \- org.objenesis:objenesis:jar:2.1:test
[INFO] | +- org.skyscreamer:jsonassert:jar:1.3.0:test
[INFO] | +- org.springframework:spring-core:jar:4.3.2.RELEASE:compile
[INFO] | \- org.springframework:spring-test:jar:4.3.2.RELEASE:test
[INFO] +- org.assertj:assertj-core:jar:3.2.0:compile
[INFO] +- org.springframework.boot:spring-boot-configuration-processor:jar:1.4.0.RELEASE:compile
[INFO] | \- org.json:json:jar:20140107:compile
[INFO] +- org.neo4j:neo4j-cypher-compiler-2.2:jar:2.2.5:compile
[INFO] | +- org.scala-lang:scala-library:jar:2.10.5:compile
[INFO] | +- org.scala-lang:scala-reflect:jar:2.10.5:compile
[INFO] | +- org.parboiled:parboiled-scala_2.10:jar:1.1.7:compile
[INFO] | | \- org.parboiled:parboiled-core:jar:1.1.7:compile
[INFO] | \- com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.4:compile
[INFO] \- org.springframework.boot:spring-boot-devtools:jar:1.4.0.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:compile
[INFO] \- org.springframework.boot:spring-boot-autoconfigure:jar:1.4.0.RELEASE:compile
And here's my Application class:
#EntityScan(basePackageClasses = { Application.class, Jsr310JpaConverters.class })
#EnableScheduling
#EnableAsync
#SpringBootApplication(scanBasePackages = "com.sample")
public class Application extends Loggable implements AsyncConfigurer {
/**
* This forces the SNS topics to be created and/or linked.
*/
#Autowired
#SuppressWarnings("all")
private TopicFactory topicFactory;
/**
* It all begins here.
*/
public static void main(String[] args) throws Exception {
SpringApplication application = new SpringApplication(Application.class);
application.setBanner(new SampleBanner());
application.run(args);
}
/**
* Returns the #Async executor.
*/
#Override
public Executor getAsyncExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(4);
executor.setMaxPoolSize(4);
executor.setQueueCapacity(0);
executor.setThreadNamePrefix("Async-");
executor.initialize();
return executor;
}
/**
* Returns the uncaught exception handler for #Async operations.
*/
#Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
return (e, method, params) -> log.error("Uncaught async error", e);
}
}
If someone could point me out where to start or what's causing it to fail, it would be of great help.
Possible fixes:
1) Set authConfigFactory to default AuthConfigFactory implementation used by Tomcat 8.5 (example basic implementation):
package com.example;
import org.apache.catalina.authenticator.jaspic.AuthConfigFactoryImpl;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import javax.security.auth.message.config.AuthConfigFactory;
#SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
if (AuthConfigFactory.getFactory() == null) {
AuthConfigFactory.setFactory(new AuthConfigFactoryImpl());
}
SpringApplication.run(DemoApplication.class, args);
}
}
or
2) Remove duplicated AuthConfigFactory class from your classpath. In my case there were two different implementations of the same class:
org.apache.tomcat.embed/tomcat-embed-core/8.5.4/tomcat-embed-core-8.5.4.jar!/javax/security/auth/message/config/AuthConfigFactory.class
javax/javaee-api/7.0/javaee-api-7.0.jar!/javax/security/auth/message/config/AuthConfigFactory.class
javaee-api-7.0.jar has it's own AuthConfigFactory implementation which is not fully compatible with Tomcat 8.5 and causes that NullPointerException (in Tomcat's version there is constant which defines default jaspic implementation class)
Remove javaee-api dependency (or any other which contains different AuthConfigFactory implementation) from your gradle/mvn project (if you can)
or
3) Downgrade Tomcat to 8.0 or 7.0:
http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#howto-use-tomcat-7
Explanation:
The problem is related with Tomcat upgrade (from 8.0.x to 8.5.x) which has been made during Spring Boot upgrade from 1.3.x to 1.4.
The problem is that Tomcat 8.5 introduces jaspic support (https://tomcat.apache.org/tomcat-8.5-doc/config/jaspic.html) and provides it's own implementation of AuthConfigFactory. This implementation defines default jaspic auth factory implementation:
private static final String DEFAULT_JASPI_AUTHCONFIGFACTORYIMPL =
"org.apache.catalina.authenticator.jaspic.AuthConfigFactoryImpl";
which is not defined in other implementations (e.g. that one from javaee-api-7.0) and causes NullPointerException because no AuthConfigFactory were instantiated.

SDN4 Config - java.lang.annotation.AnnotationFormatError: Invalid default: ...EnableNeo4jRepositories.repositoryBaseClass()

I'm getting the following error with Spring Data Neo4j 4. I think it could be a dependency conflict but I'm not sure what.
java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124) at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:183) at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:123) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:228) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:217) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:276) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:278) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:236) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [C:\*****\*****-spa\core\target\test-classes\nz\co\*****\TestNeo4jConfig.class]; nested exception is java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories.repositoryBaseClass()
The highlight of the above seems to be.
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [C:\thescene\thescene-spa\core\target\test-classes\nz\co\thescene\TestNeo4jConfig.class]; nested exception is java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories.repositoryBaseClass()
My spring dependencies are:
[INFO] +- org.springframework:spring-beans:jar:4.2.1.RELEASE:compile
[INFO] +- org.springframework:spring-aop:jar:4.2.1.RELEASE:compile
[INFO] +- org.springframework:spring-expression:jar:4.2.1.RELEASE:compile
[INFO] +- org.springframework:spring-core:jar:4.2.1.RELEASE:compile
[INFO] +- org.springframework:spring-web:jar:4.2.1.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:4.2.1.RELEASE:compile
[INFO] +- org.springframework:spring-context-support:jar:4.2.1.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-logging:jar:1.3.0.M5:compile
[INFO] +- org.springframework.boot:spring-boot-starter-aop:jar:1.3.0.M5:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.2.6.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.2.6.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.2.6.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-crypto:jar:3.2.7.RELEASE:compile
[INFO] +- org.springframework.data:spring-data-neo4j:jar:4.0.0.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:4.2.1.RELEASE:compile
[INFO] +- org.springframework.data:spring-data-commons:jar:1.9.2.RELEASE:compile
[INFO] +- org.springframework.data:spring-data-neo4j:test-jar:tests:4.0.0.RELEASE:test
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.3.0.M5:test
[INFO] +- org.springframework:spring-test:jar:4.2.1.RELEASE:test
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.2.6.RELEASE:compile
[INFO] | \- org.springframework.boot:spring-boot-starter-tomcat:jar:1.2.6.RELEASE:compile
[INFO] +- org.springframework.security.oauth:spring-security-oauth2:jar:2.0.7.RELEASE:compile
[INFO] | +- org.springframework.security:spring-security-core:jar:4.0.2.RELEASE:compile
[INFO] | +- org.springframework.security:spring-security-config:jar:4.0.2.RELEASE:compile
[INFO] | +- org.springframework.security:spring-security-web:jar:4.0.2.RELEASE:compile
[INFO] \- org.springframework.social:spring-social-core:jar:1.2.0.BUILD-SNAPSHOT:compile
My neo4j dependencies are:
[INFO] +- org.springframework.data:spring-data-neo4j:jar:4.0.0.RELEASE:compile
[INFO] | +- org.neo4j:neo4j-ogm:jar:1.1.2:compile
[INFO] +- org.neo4j:neo4j-kernel:jar:2.2.5:compile
[INFO] | +- org.neo4j:neo4j-primitive-collections:jar:2.2.5:compile
[INFO] | \- org.neo4j:neo4j-csv:jar:2.2.5:compile
[INFO] +- org.neo4j:neo4j-io:jar:2.2.5:compile
[INFO] | \- org.neo4j:neo4j-unsafe:jar:2.2.5:compile
[INFO] +- org.neo4j.test:neo4j-harness:jar:2.2.5:test
[INFO] | +- org.neo4j.app:neo4j-server:jar:2.2.5:compile
[INFO] | | +- org.neo4j:neo4j-cypher:jar:2.2.5:compile
[INFO] | | | +- org.neo4j:neo4j-lucene-index:jar:2.2.5:compile
[INFO] | | | +- org.neo4j:neo4j-graph-matching:jar:2.2.5:compile
[INFO] | | | +- org.neo4j:neo4j-graph-algo:jar:2.2.5:compile
[INFO] | | | +- org.neo4j:neo4j-cypher-compiler-1.9:jar:2.0.4:compile
[INFO] | | | +- org.neo4j:neo4j-cypher-compiler-2.0:jar:2.0.4:compile
[INFO] | | | +- org.neo4j:neo4j-cypher-compiler-2.1:jar:2.1.8:compile
[INFO] | | | +- org.neo4j:neo4j-cypher-compiler-2.2:jar:2.2.5:compile
[INFO] | | +- org.neo4j.app:neo4j-browser:jar:2.2.5:compile
[INFO] | | \- org.neo4j:neo4j-shell:jar:2.2.5:compile
[INFO] | +- org.neo4j:neo4j-kernel:test-jar:tests:2.2.5:test
[INFO] | +- org.neo4j:neo4j-io:test-jar:tests:2.2.5:test
[INFO] +- org.springframework.data:spring-data-neo4j:test-jar:tests:4.0.0.RELEASE:test
[INFO] +- org.neo4j:neo4j-ogm:test-jar:tests:1.1.2:test
[INFO] | \- org.neo4j:server-api:jar:2.2.5:compile
[INFO] | \- org.neo4j.3rdparty.javax.ws.rs:jsr311-api:jar:1.1.2.r612:compile
Here are all the rest:
[INFO] nz.co.*****:*****-core:jar:0.0.1-SNAPSHOT
[INFO] +- nz.co.*****:*****-model:jar:0.0.1-SNAPSHOT:compile
[INFO] | \- org.hibernate:hibernate-validator:jar:5.1.3.Final:compile
[INFO] | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile
[INFO] | \- com.fasterxml:classmate:jar:1.0.0:compile
[INFO] | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | \- commons-logging:commons-logging:jar:1.2:compile
[INFO] | +- ch.qos.logback:logback-classic:jar:1.1.3:compile
[INFO] | | \- ch.qos.logback:logback-core:jar:1.1.3:compile
[INFO] | +- org.slf4j:jul-to-slf4j:jar:1.7.12:compile
[INFO] | \- org.slf4j:log4j-over-slf4j:jar:1.7.12:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.14:compile
[INFO] | +- org.aspectj:aspectjrt:jar:1.8.6:compile
[INFO] | \- org.aspectj:aspectjweaver:jar:1.8.6:compile
[INFO] +- com.voodoodyne.jackson.jsog:jackson-jsog:jar:1.1:compile
[INFO] +- org.projectlombok:lombok:jar:1.16.4:compile
[INFO] +- com.squareup.okhttp:okhttp:jar:2.5.0:compile
[INFO] | \- com.squareup.okio:okio:jar:1.6.0:compile
[INFO] | | | +- org.scala-lang:scala-library:jar:2.10.5:compile
[INFO] | | | +- org.scala-lang:scala-reflect:jar:2.10.5:compile
[INFO] | | | | \- org.apache.lucene:lucene-core:jar:3.6.2:compile
[INFO] | | | +- org.parboiled:parboiled-scala_2.10:jar:1.1.7:compile
[INFO] | | | | \- org.parboiled:parboiled-core:jar:1.1.7:compile
[INFO] | | | +- net.sf.opencsv:opencsv:jar:2.3:compile
[INFO] | | | \- com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.4:compile
[INFO] | | +- ch.qos.logback:logback-access:jar:1.1.3:compile
[INFO] | | +- org.codehaus.janino:janino:jar:2.6.1:compile
[INFO] | | | \- org.codehaus.janino:commons-compiler:jar:2.6.1:compile
[INFO] | | +- org.eclipse.jetty:jetty-server:jar:9.2.13.v20150730:compile
[INFO] | | | +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO] | | | +- org.eclipse.jetty:jetty-http:jar:9.2.13.v20150730:compile
[INFO] | | | | \- org.eclipse.jetty:jetty-util:jar:9.2.13.v20150730:compile
[INFO] | | | \- org.eclipse.jetty:jetty-io:jar:9.2.13.v20150730:compile
[INFO] | | +- org.eclipse.jetty:jetty-webapp:jar:9.2.13.v20150730:compile
[INFO] | | | +- org.eclipse.jetty:jetty-xml:jar:9.2.13.v20150730:compile
[INFO] | | | \- org.eclipse.jetty:jetty-servlet:jar:9.2.13.v20150730:compile
[INFO] | | | \- org.eclipse.jetty:jetty-security:jar:9.2.13.v20150730:compile
[INFO] | | +- com.sun.jersey:jersey-server:jar:1.13:compile
[INFO] | | | \- asm:asm:jar:3.1:compile
[INFO] | | +- com.sun.jersey:jersey-servlet:jar:1.13:compile
[INFO] | | +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.13:compile
[INFO] | | +- org.rrd4j:rrd4j:jar:2.2:compile
[INFO] | | +- org.mozilla:rhino:jar:1.7R4:compile
[INFO] | | +- bouncycastle:bcprov-jdk16:jar:140:compile
[INFO] | | +- com.sun.jersey.contribs:jersey-multipart:jar:1.19:compile
[INFO] | | | \- org.jvnet.mimepull:mimepull:jar:1.9.3:compile
[INFO] | | \- org.apache.servicemix.bundles:org.apache.servicemix.bundles.jline:jar:0.9.94_1:compile
[INFO] | +- commons-configuration:commons-configuration:jar:1.10:compile
[INFO] | +- commons-digester:commons-digester:jar:2.1:compile
[INFO] | | \- commons-beanutils:commons-beanutils:jar:1.9.2:compile
[INFO] | \- com.sun.jersey:jersey-client:jar:1.13:test
[INFO] | \- com.sun.jersey:jersey-core:jar:1.13:compile
[INFO] +- javax.inject:javax.inject:jar:1:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.7.12:compile
[INFO] +- org.slf4j:jcl-over-slf4j:jar:1.7.12:compile
[INFO] +- org.jasypt:jasypt:jar:1.9.2:compile
[INFO] +- com.fasterxml.jackson.datatype:jackson-datatype-json-org:jar:2.5.0:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.5.4:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.5.4:compile
[INFO] | \- org.apache.geronimo.bundles:json:jar:20090211_1:compile
[INFO] +- com.thoughtworks.xstream:xstream:jar:1.4.2:compile
[INFO] | +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO] | \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.5.4:compile
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.3.2:compile
[INFO] | | \- org.apache.httpcomponents:httpcore:jar:4.4.1:compile
[INFO] | \- commons-lang:commons-lang:jar:2.6:compile
[INFO] | +- org.mockito:mockito-core:jar:2.0.2-beta:test
[INFO] | | \- org.objenesis:objenesis:jar:2.1:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] | \- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] +- junit:junit:jar:4.12:test
[INFO] +- org.hamcrest:hamcrest-all:jar:1.3:compile
[INFO] +- org.jbehave:jbehave-core:jar:4.0.1:test
[INFO] | +- org.hamcrest:hamcrest-integration:jar:1.3:test
[INFO] | +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] | +- commons-io:commons-io:jar:2.4:compile
[INFO] | +- org.codehaus.plexus:plexus-utils:jar:3.0.10:test
[INFO] | +- org.freemarker:freemarker:jar:2.3.22:test
[INFO] | \- com.thoughtworks.paranamer:paranamer:jar:2.4:test
[INFO] +- org.jbehave:jbehave-gherkin:jar:4.0.3:compile
[INFO] | \- info.cukes:gherkin:jar:2.11.2:compile
[INFO] +- nz.co.*****:*****-server-plugins:jar:0.0.1-SNAPSHOT:test
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.26:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.26:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.26:compile
[INFO] | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.26:compile
[INFO] | +- commons-codec:commons-codec:jar:1.6: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
Does anybody have any idea on how to solve this? Does anybody see anything amiss?
I solved this in the end. I was importing the wrong version of spring-data-commons.

Upgrading from Spring 3.0.3.RELEASE results in: java.lang.NoSuchFieldError: USER_DECLARED_METHODS

I have a Spring-MVC 3.0 web application built with Maven. All Spring dependency versions are defined with a maven property <spring.version>3.0.3.RELEASE</spring.version>. When I change the version to either 3.0.4.RELEASE or 3.0.5.RELEASE, then the web application fails with the following exception:
ERROR: [DispatcherServlet] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0': Initialization of bean failed; nested exception is java.lang.NoSuchFieldError: USER_DECLARED_METHODS
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:433)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:612)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:510)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:110)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:222)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:132)
at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:371)
at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:307)
at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.java:203)
at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:184)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:195)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:140)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:314)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:151)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:445)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:168)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
I've found one relevant hit on Google http://forum.springsource.org/showthread.php?p=328767 but it did not help me, as I've checked my Spring versions in my pom and done numerous clean builds on the project. I'm running the webapp via mvn jetty:run.
[EDIT] Here is the dependency tree as requested by michael-lange...
[INFO] au.org.ala:bie-admin:war:1.0-SNAPSHOT
[INFO] +- au.org.ala:bie-hbase:jar:1.0-SNAPSHOT:compile
[INFO] | +- org.gbif:ecat-common:jar:1.1-SNAPSHOT:compile
[INFO] | +- org.gbif:dwc-archive:jar:1.2-SNAPSHOT:compile
[INFO] | | +- com.trustice:tar:jar:2.5:compile
[INFO] | | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | +- jaxen:jaxen:jar:1.1-beta-6:compile
[INFO] | | | +- xerces:xmlParserAPIs:jar:2.6.2:compile
[INFO] | | | \- xom:xom:jar:1.0b3:compile
[INFO] | | | +- com.ibm.icu:icu4j:jar:2.6.1:compile
[INFO] | | | \- org.ccil.cowan.tagsoup:tagsoup:jar:0.9.7:compile
[INFO] | | +- com.google.guava:guava:jar:r03:compile
[INFO] | | +- org.apache.commons:commons-compress:jar:1.0:compile
[INFO] | | \- com.google.inject:guice:jar:2.0:compile
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | +- org.apache.hadoop:hbase:jar:0.20.4:compile
[INFO] | +- org.apache.hadoop:zookeeper:jar:3.2.2:compile
[INFO] | +- org.apache.hadoop:hadoop-core:jar:0.20.2:compile
[INFO] | +- org.apache.hadoop:hadoop-ant:jar:0.20.2:compile
[INFO] | +- org.apache.hadoop:hadoop-tools:jar:0.20.2:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.5.2:compile
[INFO] | +- org.slf4j:slf4j-log4j12:jar:1.4.3:compile
[INFO] | +- commons-cli:commons-cli:jar:1.2:compile
[INFO] | +- org.apache.lucene:lucene-core:jar:2.9.2:compile
[INFO] | +- org.apache.solr:solr-core:jar:1.4.0:compile
[INFO] | | +- org.apache.lucene:lucene-analyzers:jar:2.9.1:compile
[INFO] | | +- org.apache.lucene:lucene-highlighter:jar:2.9.1:compile
[INFO] | | +- org.apache.lucene:lucene-queries:jar:2.9.1:compile
[INFO] | | +- org.apache.lucene:lucene-snowball:jar:2.9.1:compile
[INFO] | | +- org.apache.lucene:lucene-memory:jar:2.9.1:compile
[INFO] | | +- org.apache.lucene:lucene-misc:jar:2.9.1:compile
[INFO] | | +- org.apache.lucene:lucene-spellchecker:jar:2.9.1:compile
[INFO] | | +- org.apache.solr:solr-commons-csv:jar:1.4.0:compile
[INFO] | | +- woodstox:wstx-asl:jar:3.2.7:compile
[INFO] | | \- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:compile
[INFO] | +- org.apache.solr:solr-solrj:jar:1.4.0:compile
[INFO] | | \- org.codehaus.woodstox:wstx-asl:jar:3.2.7:compile
[INFO] | | \- stax:stax-api:jar:1.0.1:compile
[INFO] | +- org.apache.cassandra:apache-cassandra:jar:0.6.1:compile
[INFO] | +- org.apache.thrift:thrift:jar:0.2.0:compile
[INFO] | +- pelops:pelops:jar:0.804:compile
[INFO] | +- org.geotools:gt-main:jar:2.5-RC1:compile
[INFO] | | +- org.geotools:gt-api:jar:2.5-RC1:compile
[INFO] | | +- com.vividsolutions:jts:jar:1.9:compile
[INFO] | | \- jdom:jdom:jar:1.0:compile
[INFO] | +- org.geotools:gt-shapefile:jar:2.5-RC1:compile
[INFO] | | +- org.geotools:gt-referencing:jar:2.5-RC1:compile
[INFO] | | | +- java3d:vecmath:jar:1.3.1:compile
[INFO] | | | \- org.geotools:gt-metadata:jar:2.5-RC1:compile
[INFO] | | | +- org.opengis:geoapi:jar:2.2-M1:compile
[INFO] | | | \- net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2:compile
[INFO] | | \- velocity:velocity:jar:1.4:compile
[INFO] | | \- velocity:velocity-dep:jar:1.4:runtime
[INFO] | +- org.geotools:gt-epsg-hsql:jar:2.5-RC1:compile
[INFO] | | \- hsqldb:hsqldb:jar:1.8.0.7:compile
[INFO] | +- postgresql:postgresql:jar:8.1-407.jdbc3:compile
[INFO] | +- javax.servlet:servlet-api:jar:2.4:compile
[INFO] | +- javax.inject:javax.inject:jar:1:compile
[INFO] | +- org.openrdf.sesame:sesame-rio-rdfxml:jar:2.2:compile
[INFO] | | +- org.openrdf.sesame:sesame-model:jar:2.2:compile
[INFO] | | | +- info.aduna.commons:aduna-commons-collections:jar:2.2:compile
[INFO] | | | | \- info.aduna.commons:aduna-commons-concurrent:jar:2.2:compile
[INFO] | | | \- info.aduna.commons:aduna-commons-iteration:jar:2.2:compile
[INFO] | | +- info.aduna.commons:aduna-commons-net:jar:2.1:compile
[INFO] | | \- info.aduna.commons:aduna-commons-xml:jar:2.1:compile
[INFO] | +- org.openrdf.sesame:sesame-rio-api:jar:2.2:compile
[INFO] | | \- info.aduna.commons:aduna-commons-lang:jar:2.2:compile
[INFO] | +- org.openrdf.sesame:sesame-rio-ntriples:jar:2.2:compile
[INFO] | +- org.openrdf.sesame:sesame-rio-n3:jar:2.2:compile
[INFO] | +- org.springframework:spring-core:jar:3.0.0.RELEASE:compile
[INFO] | | \- org.springframework:spring-asm:jar:3.0.0.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:3.0.0.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:3.0.0.RELEASE:compile
[INFO] | | \- org.springframework:spring-expression:jar:3.0.0.RELEASE:compile
[INFO] | +- org.springframework:spring-oxm:jar:3.0.0.RELEASE:compile
[INFO] | +- org.openrdf.sesame:sesame-rio-turtle:jar:2.2:compile
[INFO] | | +- info.aduna.commons:aduna-commons-io:jar:2.3:compile
[INFO] | | \- info.aduna.commons:aduna-commons-text:jar:2.1:compile
[INFO] | \- au.org.ala:ala-name-matching:jar:1.0-SNAPSHOT:compile
[INFO] | +- org.gbif:ecat-checklistbank:jar:1.0-SNAPSHOT:compile
[INFO] | | +- junit:junit:jar:4.4:compile
[INFO] | | +- uk.co.flamingpenguin.jewelcli:jewelcli:jar:0.6:compile
[INFO] | | +- gnu.trove:trove:jar:2.0.4:compile
[INFO] | | \- org.freemarker:freemarker:jar:2.3.15:compile
[INFO] | +- portal:portal-core:jar:1.0-SNAPSHOT:compile
[INFO] | | +- org.springframework:spring-dao:jar:2.0:compile
[INFO] | | +- org.springframework:spring-support:jar:2.0:compile
[INFO] | | +- org.springframework:spring-aop:jar:2.0:compile
[INFO] | | +- org.springframework:spring-aop-cache:jar:2.0:compile
[INFO] | | +- org.apache.velocity:velocity:jar:1.6:compile
[INFO] | | | \- oro:oro:jar:2.0.8:compile
[INFO] | | +- soap:soap:jar:2.3.1:compile
[INFO] | | +- quartz:quartz:jar:1.6.0:compile
[INFO] | | +- javax.transaction:jta:jar:1.0.1B:compile
[INFO] | | +- dom4j:dom4j-core:jar:1.4-dev-8:compile
[INFO] | | +- commons-math:commons-math:jar:1.1:compile
[INFO] | | | \- commons-discovery:commons-discovery:jar:0.2:compile
[INFO] | | \- saxpath:saxpath:jar:1.0-FCS:compile
[INFO] | \- au.com.bytecode:opencsv:jar:2.2:compile
[INFO] +- au.org.ala:bie-repository:jar:1.0-SNAPSHOT:compile
[INFO] | +- au.org.ala:ala-logger:jar:1.0-SNAPSHOT:compile
[INFO] | +- org.springframework:spring-orm:jar:3.0.0.RELEASE:compile
[INFO] | | \- org.springframework:spring-tx:jar:3.0.0.RELEASE:compile
[INFO] | +- org.springframework:spring-jdbc:jar:3.0.0.RELEASE:compile
[INFO] | +- commons-collections:commons-collections:jar:3.2:compile
[INFO] | +- commons-dbcp:commons-dbcp:jar:1.2.1:compile
[INFO] | | +- commons-pool:commons-pool:jar:1.2:compile
[INFO] | | \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] | +- commons-validator:commons-validator:jar:1.3.1:compile
[INFO] | | \- commons-digester:commons-digester:jar:1.6:compile
[INFO] | +- net.sourceforge.htmlunit:htmlunit:jar:2.5:compile
[INFO] | | +- xalan:xalan:jar:2.7.1:compile
[INFO] | | | \- xalan:serializer:jar:2.7.1:compile
[INFO] | | +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.5:compile
[INFO] | | +- net.sourceforge.nekohtml:nekohtml:jar:1.9.12:compile
[INFO] | | \- net.sourceforge.cssparser:cssparser:jar:0.9.5:compile
[INFO] | | \- org.w3c.css:sac:jar:1.3:compile
[INFO] | +- net.sf.opencsv:opencsv:jar:2.1:compile
[INFO] | +- org.jdom:jdom:jar:1.1:compile
[INFO] | +- pdfbox:pdfbox:jar:0.7.3:compile
[INFO] | | +- org.fontbox:fontbox:jar:0.1.0:compile
[INFO] | | +- org.jempbox:jempbox:jar:0.2.0:compile
[INFO] | | +- bouncycastle:bcmail-jdk14:jar:136:compile
[INFO] | | \- bouncycastle:bcprov-jdk14:jar:136:compile
[INFO] | +- javax.media:jai-core:jar:1.1.3:compile
[INFO] | +- javax.media:jai-codec:jar:1.1.3:compile
[INFO] | \- javax.media:jai-imageio:jar:1.1:compile
[INFO] +- au.org.ala:ala-common-ui:jar:1.0-SNAPSHOT:compile
[INFO] | \- org.jasig.cas:cas-client-core:jar:3.1.10:compile
[INFO] +- au.org.ala:ala-cas-client:jar:1.0-SNAPSHOT:compile
[INFO] +- org.junit:com.springsource.org.junit:jar:4.7.0:test
[INFO] +- org.springframework:org.springframework.test:jar:3.0.5.RELEASE:test
[INFO] +- org.springframework:org.springframework.aop:jar:3.0.5.RELEASE:compile
[INFO] | \- org.aopalliance:com.springsource.org.aopalliance:jar:1.0.0:compile
[INFO] +- org.springframework:org.springframework.beans:jar:3.0.5.RELEASE:compile
[INFO] | \- org.springframework:org.springframework.asm:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:org.springframework.context:jar:3.0.5.RELEASE:compile
[INFO] | \- org.springframework:org.springframework.expression:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:org.springframework.context.support:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:org.springframework.core:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:org.springframework.jdbc:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:org.springframework.orm:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:org.springframework.transaction:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:org.springframework.web:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:org.springframework.web.servlet:jar:3.0.5.RELEASE:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.6:compile
[INFO] +- org.apache.el:com.springsource.org.apache.el:jar:6.0.20:compile
[INFO] +- javax.servlet:com.springsource.javax.servlet:jar:2.5.0:provided
[INFO] +- javax.servlet:com.springsource.javax.servlet.jsp:jar:2.1.0:provided
[INFO] +- javax.servlet:com.springsource.javax.servlet.jsp.jstl:jar:1.2.0:compile
[INFO] +- org.apache.taglibs:com.springsource.org.apache.taglibs.standard:jar:1.1.2:compile
[INFO] +- log4j:log4j:jar:1.2.15:compile
[INFO] | +- javax.mail:mail:jar:1.4:compile
[INFO] | | \- javax.activation:activation:jar:1.1:compile
[INFO] | +- javax.jms:jms:jar:1.1:compile
[INFO] | +- com.sun.jdmk:jmxtools:jar:1.2.1:compile
[INFO] | \- com.sun.jmx:jmxri:jar:1.2.1:compile
[INFO] +- commons-lang:commons-lang:jar:2.4:compile
[INFO] +- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] | +- commons-logging:commons-logging:jar:1.0.4:compile
[INFO] | \- commons-codec:commons-codec:jar:1.2:compile
[INFO] +- commons-io:commons-io:jar:1.4:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.2.1:compile
[INFO] +- commons-beanutils:commons-beanutils:jar:1.8.3:compile
[INFO] +- org.codehaus.jackson:jackson-core-asl:jar:1.4.1:compile
[INFO] +- org.codehaus.jackson:jackson-mapper-asl:jar:1.4.1:compile
[INFO] +- opensymphony:sitemesh:jar:2.4.2:compile
[INFO] +- javax.validation:validation-api:jar:1.0.0.GA:compile
[INFO] \- org.hibernate:com.springsource.org.hibernate.validator:jar:4.0.0.GA:compile
[INFO] +- javax.validation:com.springsource.javax.validation:jar:1.0.0.GA:compile
[INFO] \- org.slf4j:com.springsource.slf4j.api:jar:1.5.6:compile
It turned out two of our own dependencies both had dependencies on Spring 3.0.0.RELEASE. Adding an exclusion to each of these as:
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
</exclusions>
fixed the problem.
This smells like a Spring bug to me as I did not see this problem using 3.0.1, 3.0.2 or 3.0.3.
In response to your last comment, you can use the 'dependencyManagement' section of the POM to try to mitigate the Spring 3.0.0 requirement of your internal dependencies. This should force everything to use Spring 3.0.5.RELEASE if you place the proper 'dependency' elements under your dependencyManagement section.

Resources