I am new to spring boot and trying out few examples demonstrated on Spring's site.
I get above error while trying this simple example - https://spring.io/guides/gs/relational-data-access/ .
I am facing a compiler error saying - 'The method execute(String) from the type JdbcTemplate refers to the missing type DataAccessException'.
Image -
https://i.stack.imgur.com/8PL0m.jpg
I did search other resources to get rid of this issue where spring-tx/ spring.transations such jars were suggested to attach. Nothing has worked in my case.
POM.xml has following dependancy -
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
</parent>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<scope>test</scope>
</dependency>
<!-- Added for COnsuming Restful services guide -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- Following three Added for Validating form validate with spring -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-el</artifactId>
</dependency>
<!-- Following two are Added for relational data access using spring guide -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-tx -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
</project>
Please help me out if anyone can ? Thanks a ton!
Updating the maven dependency tree for spring-boot-starter-jdbc:
com.kurshit.springrest:SpringRest:war:0.0.1-SNAPSHOT
+- org.springframework.boot:spring-boot-starter-web:jar:1.5.9.RELEASE:compile
| +- org.springframework.boot:spring-boot-starter:jar:1.5.9.RELEASE:compile
| | +- org.springframework.boot:spring-boot:jar:1.5.9.RELEASE:compile
| | | +- (org.springframework:spring-core:jar:4.3.13.RELEASE:compile - omitted for duplicate)
| | | \- (org.springframework:spring-context:jar:4.3.13.RELEASE:compile - omitted for duplicat
| | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.9.RELEASE:compile
| | | \- (org.springframework.boot:spring-boot:jar:1.5.9.RELEASE:compile - omitted for duplica
| | +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.9.RELEASE:compile
| | | +- ch.qos.logback:logback-classic:jar:1.1.11:compile
| | | | +- ch.qos.logback:logback-core:jar:1.1.11:compile
| | | | \- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.6.6; omitted for
| | | +- org.slf4j:jcl-over-slf4j:jar:1.7.25:compile
| | | | \- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.7.22; omitted for
| | | +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
| | | | \- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.7.22; omitted for
| | | \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
| | | \- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.7.22; omitted for
| | +- org.springframework:spring-core:jar:4.3.13.RELEASE:compile
| | \- org.yaml:snakeyaml:jar:1.17:runtime
| +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.5.9.RELEASE:compile
| | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.23:compile
| | | \- org.apache.tomcat:tomcat-annotations-api:jar:8.5.23:compile
| | +- (org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.23:compile - omitted for duplicate)
| | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.23:compile
| | \- (org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.23:compile - omitted for duplicate
| +- (org.hibernate:hibernate-validator:jar:5.3.6.Final:compile - omitted for duplicate)
| +- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.10:compile - omitted for duplicate)
| +- org.springframework:spring-web:jar:4.3.13.RELEASE:compile
| | +- org.springframework:spring-aop:jar:4.3.13.RELEASE:compile
| | | +- (org.springframework:spring-beans:jar:4.3.13.RELEASE:compile - omitted for duplicate)
| | | \- (org.springframework:spring-core:jar:4.3.13.RELEASE:compile - omitted for duplicate)
| | +- org.springframework:spring-beans:jar:4.3.13.RELEASE:compile
| | | \- (org.springframework:spring-core:jar:4.3.13.RELEASE:compile - omitted for duplicate)
| | +- org.springframework:spring-context:jar:4.3.13.RELEASE:compile
| | | +- (org.springframework:spring-aop:jar:4.3.13.RELEASE:compile - omitted for duplicate)
| | | +- (org.springframework:spring-beans:jar:4.3.13.RELEASE:compile - omitted for duplicate)
| | | +- (org.springframework:spring-core:jar:4.3.13.RELEASE:compile - omitted for duplicate)
| | | \- (org.springframework:spring-expression:jar:4.3.13.RELEASE:compile - omitted for dupli
| | \- (org.springframework:spring-core:jar:4.3.13.RELEASE:compile - omitted for duplicate)
| \- org.springframework:spring-webmvc:jar:4.3.13.RELEASE:compile
| +- (org.springframework:spring-aop:jar:4.3.13.RELEASE:compile - omitted for duplicate)
| +- (org.springframework:spring-beans:jar:4.3.13.RELEASE:compile - omitted for duplicate)
| +- (org.springframework:spring-context:jar:4.3.13.RELEASE:compile - omitted for duplicate)
| +- (org.springframework:spring-core:jar:4.3.13.RELEASE:compile - omitted for duplicate)
| +- org.springframework:spring-expression:jar:4.3.13.RELEASE:compile
| | \- (org.springframework:spring-core:jar:4.3.13.RELEASE:compile - omitted for duplicate)
| \- (org.springframework:spring-web:jar:4.3.13.RELEASE:compile - omitted for duplicate)
+- org.springframework.boot:spring-boot-starter-test:jar:1.5.9.RELEASE:test
| +- org.springframework.boot:spring-boot-test:jar:1.5.9.RELEASE:test
| | \- (org.springframework.boot:spring-boot:jar:1.5.9.RELEASE:test - omitted for duplicate)
| +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.5.9.RELEASE:test
| | +- (org.springframework.boot:spring-boot-test:jar:1.5.9.RELEASE:test - omitted for duplicat
| | \- (org.springframework.boot:spring-boot-autoconfigure:jar:1.5.9.RELEASE:test - omitted for
| +- (com.jayway.jsonpath:json-path:jar:2.2.0:test - omitted for duplicate)
| +- junit:junit:jar:4.12:test
| | \- (org.hamcrest:hamcrest-core:jar:1.3:test - version managed from 1.1; omitted for duplica
| +- org.assertj:assertj-core:jar:2.6.0:test
| +- org.mockito:mockito-core:jar:1.10.19:test
| | +- (org.hamcrest:hamcrest-core:jar:1.3:test - version managed from 1.1; omitted for duplica
| | \- org.objenesis:objenesis:jar:2.1:test
| +- org.hamcrest:hamcrest-core:jar:1.3:test
| +- org.hamcrest:hamcrest-library:jar:1.3:test
| | \- (org.hamcrest:hamcrest-core:jar:1.3:test - version managed from 1.1; omitted for duplica
| +- org.skyscreamer:jsonassert:jar:1.4.0:test
| | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
| +- (org.springframework:spring-core:jar:4.3.13.RELEASE:compile - scope updated from test; omit
| \- org.springframework:spring-test:jar:4.3.13.RELEASE:test
| \- (org.springframework:spring-core:jar:4.3.13.RELEASE:test - omitted for duplicate)
+- com.jayway.jsonpath:json-path:jar:2.2.0:test
| +- net.minidev:json-smart:jar:2.2.1:test
| | \- net.minidev:accessors-smart:jar:1.1:test
| | \- org.ow2.asm:asm:jar:5.0.3:test
| \- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.7.16; scope updated from t
+- com.fasterxml.jackson.core:jackson-databind:jar:2.8.10:compile
| +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
| \- com.fasterxml.jackson.core:jackson-core:jar:2.8.10:compile
+- org.springframework.boot:spring-boot-starter-thymeleaf:jar:1.5.9.RELEASE:compile
| +- (org.springframework.boot:spring-boot-starter:jar:1.5.9.RELEASE:compile - omitted for dupli
| +- (org.springframework.boot:spring-boot-starter-web:jar:1.5.9.RELEASE:compile - omitted for d
| +- org.thymeleaf:thymeleaf-spring4:jar:2.1.6.RELEASE:compile
| | +- org.thymeleaf:thymeleaf:jar:2.1.6.RELEASE:compile
| | | +- ognl:ognl:jar:3.0.8:compile
| | | +- org.javassist:javassist:jar:3.21.0-GA:compile (version managed from 3.16.1-GA)
| | | +- org.unbescape:unbescape:jar:1.1.0.RELEASE:compile
| | | \- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.6.6; omitted for dup
| | \- org.slf4j:slf4j-api:jar:1.7.25:compile
| \- nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:jar:1.4.0:compile
| +- org.codehaus.groovy:groovy:jar:2.4.13:compile (version managed from 2.4.3)
| \- (org.thymeleaf:thymeleaf:jar:2.1.6.RELEASE:compile - version managed from 2.1.4.RELEASE;
+- org.hibernate:hibernate-validator:jar:5.3.6.Final:compile
| +- javax.validation:validation-api:jar:1.1.0.Final:compile
| +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile (version managed from 3.3.0.Final)
| \- com.fasterxml:classmate:jar:1.3.4:compile (version managed from 1.3.1)
+- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.23:compile
+- org.springframework.boot:spring-boot-starter-jdbc:jar:1.5.9.RELEASE:compile
| +- (org.springframework.boot:spring-boot-starter:jar:1.5.9.RELEASE:compile - omitted for dupli
| +- org.apache.tomcat:tomcat-jdbc:jar:8.5.23:compile
| | \- org.apache.tomcat:tomcat-juli:jar:8.5.23:compile
| \- org.springframework:spring-jdbc:jar:4.3.13.RELEASE:compile
| +- (org.springframework:spring-beans:jar:4.3.13.RELEASE:compile - omitted for duplicate)
| +- (org.springframework:spring-core:jar:4.3.13.RELEASE:compile - omitted for duplicate)
| \- org.springframework:spring-tx:jar:4.3.13.RELEASE:compile
| +- (org.springframework:spring-beans:jar:4.3.13.RELEASE:compile - omitted for duplicate)
| \- (org.springframework:spring-core:jar:4.3.13.RELEASE:compile - omitted for duplicate)
\- com.h2database:h2:jar:1.4.196:compile
Add the following dependency (you might have to adjust the version to be compatible with your Spring Boot version)
<!-- https://mvnrepository.com/artifact/org.springframework/spring-tx -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>5.0.2.RELEASE</version>
</dependency>
Edited:
Deleting the conflicting dependancies from maven repo got me rid of this compilation error.
Related
In order to fix CVE-2022-41881 I want to update the dependency for netty under org.springframework.boot:spring-boot-starter-reactor-netty:jar:2.7.1 from version 1.0.20 to 1.1.1
This is the section of the dependency tree before the change:
[INFO] | +- org.springframework.boot:spring-boot-starter-reactor-netty:jar:2.7.1:compile
[INFO] | | \- io.projectreactor.netty:reactor-netty-http:jar:1.0.20:compile
[INFO] | | +- io.netty:netty-codec-http:jar:4.1.78.Final:compile
[INFO] | | | +- io.netty:netty-common:jar:4.1.78.Final:compile
[INFO] | | | +- io.netty:netty-buffer:jar:4.1.78.Final:compile
[INFO] | | | +- io.netty:netty-transport:jar:4.1.78.Final:compile
[INFO] | | | +- io.netty:netty-codec:jar:4.1.78.Final:compile
[INFO] | | | \- io.netty:netty-handler:jar:4.1.78.Final:compile
[INFO] | | +- io.netty:netty-codec-http2:jar:4.1.78.Final:compile
[INFO] | | +- io.netty:netty-resolver-dns:jar:4.1.78.Final:compile
[INFO] | | | +- io.netty:netty-resolver:jar:4.1.78.Final:compile
[INFO] | | | \- io.netty:netty-codec-dns:jar:4.1.78.Final:compile
[INFO] | | +- io.netty:netty-resolver-dns-native-macos:jar:osx-x86_64:4.1.78.Final:compile
[INFO] | | | \- io.netty:netty-resolver-dns-classes-macos:jar:4.1.78.Final:compile
[INFO] | | +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.78.Final:compile
[INFO] | | | +- io.netty:netty-transport-native-unix-common:jar:4.1.78.Final:compile
[INFO] | | | \- io.netty:netty-transport-classes-epoll:jar:4.1.78.Final:compile
[INFO] | | \- io.projectreactor.netty:reactor-netty-core:jar:1.0.20:compile
[INFO] | | \- io.netty:netty-handler-proxy:jar:4.1.78.Final:compile
[INFO] | | \- io.netty:netty-codec-socks:jar:4.1.78.Final:compile
When forcing the use of a newer dependency for reactor-netty-http like this:
<dependency>
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty-http</artifactId>
<version>1.1.1</version>
</dependency>
I end up with this dependency tree:
[INFO] | | \- io.projectreactor.netty:reactor-netty-http:jar:1.1.1:compile
[INFO] | | +- io.netty:netty-codec-http:jar:4.1.78.Final:compile
[INFO] | | | +- io.netty:netty-common:jar:4.1.78.Final:compile
[INFO] | | | +- io.netty:netty-buffer:jar:4.1.78.Final:compile
[INFO] | | | +- io.netty:netty-transport:jar:4.1.78.Final:compile
[INFO] | | | +- io.netty:netty-codec:jar:4.1.78.Final:compile
[INFO] | | | \- io.netty:netty-handler:jar:4.1.78.Final:compile
[INFO] | | +- io.netty:netty-codec-http2:jar:4.1.78.Final:compile
[INFO] | | +- io.netty:netty-resolver-dns:jar:4.1.78.Final:compile
[INFO] | | | +- io.netty:netty-resolver:jar:4.1.78.Final:compile
[INFO] | | | \- io.netty:netty-codec-dns:jar:4.1.78.Final:compile
[INFO] | | +- io.netty:netty-resolver-dns-native-macos:jar:osx-x86_64:4.1.78.Final:compile
[INFO] | | | \- io.netty:netty-resolver-dns-classes-macos:jar:4.1.78.Final:compile
[INFO] | | +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.78.Final:compile
[INFO] | | | +- io.netty:netty-transport-native-unix-common:jar:4.1.78.Final:compile
[INFO] | | | \- io.netty:netty-transport-classes-epoll:jar:4.1.78.Final:compile
[INFO] | | \- io.projectreactor.netty:reactor-netty-core:jar:1.0.20:compile
[INFO] | | \- io.netty:netty-handler-proxy:jar:4.1.78.Final:compile
[INFO] | | \- io.netty:netty-codec-socks:jar:4.1.78.Final:compile
As you can see the reactor-netty-http has the correct version, but all the dependencies underneath are still in the same version also according to Maven central they should have 4.1.86.Final
These dependencies are only defined through reactor-netty-http, so there should not be anything else that forces it to a lower version.
Any idea why an outdated version is used here?
The Netty version is controlled by Spring Boot. In order to update it, in your pom.xml add the property below
<properties>
<netty.version>4.1.86.Final</netty.version>
</properties>
See more here
If you are using the spring-boot-dependencies via import scope (BOM) in your project instead of the spring-boot-starter-parent as parent of your project. You have to beware of the following that you have to define the netty-bom before the spring-boot-dependencies bom in your dependencyManagement.
The following will overwrite the versions of the netty parts correctly:
<dependencyManagement>
...
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-bom</artifactId>
<version>4.1.86.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
I have:
<dependencies>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-xml -->
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.13.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.module/jackson-module-jaxb-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId>
<version>2.13.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.2</version>
</dependency>
<dependency>
<groupId>com.company.commons</groupId>
<artifactId>commons-batch</artifactId>
<version>${company.commons.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>com.company.project</groupId>
<artifactId>project-domain</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
</dependencies>
in company-commons I have:
<dependencies>
<dependency>
<groupId>com.company.commons</groupId>
<artifactId>company-domain</artifactId>
<version>2.9.0-SNAPSHOT</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-quartz -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-batch -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-batch</artifactId>
<version>${spring.boot.version}</version>
</dependency>
</dependencies>
and in company-domain I have:
<dependencies>
<!-- https://mvnrepository.com/artifact/org.zalando/problem-spring-web-starter -->
<dependency>
<groupId>org.zalando</groupId>
<artifactId>problem-spring-web</artifactId>
<version>0.27.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.0.1-jre</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-jdbc -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-integration -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-crypto -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-crypto</artifactId>
<version>4.2.2.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-net/commons-net -->
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.6</version>
</dependency>
</dependencies>
${spring.boot.version} is 2.2.0.RELEASE
In a Spring Boot application and the following piece:
final InputStream stream = new URL(url).openStream();
final Workbook workbook = new HSSFWorkbook(stream);
fails with:
java.lang.NoSuchMethodError: org.apache.logging.log4j.Logger.atDebug()Lorg/apache/logging/log4j/LogBuilder;
at org.apache.poi.openxml4j.opc.PackageRelationshipCollection.parseRelationshipsPart(PackageRelationshipCollection.java:309)
at org.apache.poi.openxml4j.opc.PackageRelationshipCollection.<init>(PackageRelationshipCollection.java:160)
at org.apache.poi.openxml4j.opc.PackageRelationshipCollection.<init>(PackageRelationshipCollection.java:130)
at org.apache.poi.openxml4j.opc.PackagePart.loadRelationships(PackagePart.java:565)
at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:745)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:315)
at org.apache.poi.ooxml.util.PackageHelper.open(PackageHelper.java:59)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:289)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:285)
at com.company.project.MyParser.parse(MyParser.java:35)
at com.company.project.MyReader.process(MyReader.java:44)
at com.company.project.MySlaveStepReader.open(MySlaveStepReader.java:60)
at com.company.project.MySlaveStepReader$$FastClassBySpringCGLIB$$d02f818a.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:769)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
at com.company.project.MySlaveStepReader$$EnhancerBySpringCGLIB$$e46cbc57.open(<generated>)
at org.springframework.batch.item.support.CompositeItemStream.open(CompositeItemStream.java:103)
at org.springframework.batch.core.step.item.ChunkMonitor.open(ChunkMonitor.java:114)
at org.springframework.batch.item.support.CompositeItemStream.open(CompositeItemStream.java:103)
at org.springframework.batch.core.step.tasklet.TaskletStep.open(TaskletStep.java:311)
at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:205)
at jdk.internal.reflect.GeneratedMethodAccessor223.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy121.execute(Unknown Source)
at org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler$1.call(TaskExecutorPartitionHandler.java:138)
at org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler$1.call(TaskExecutorPartitionHandler.java:135)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
at org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler.doHandle(TaskExecutorPartitionHandler.java:103)
at org.springframework.batch.core.partition.support.AbstractPartitionHandler.handle(AbstractPartitionHandler.java:61)
at org.springframework.batch.core.partition.support.PartitionStep.doExecute(PartitionStep.java:106)
at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:208)
at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148)
at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:68)
at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:68)
at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:169)
at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:144)
at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:137)
at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:319)
at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:147)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:140)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy114.run(Unknown Source)
at com.company.project.MyTaskLauncher$MyTaskLauncherBean.executeInternal(MyTaskLauncher.java:71)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
The output for mvn dependency:tree is:
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # project-batch ---
[INFO] com.company.project:project-batch:jar:0.1.0-SNAPSHOT
[INFO] +- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.13.2:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.13.2:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.2:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.13.2:compile
[INFO] | +- org.codehaus.woodstox:stax2-api:jar:4.2.1:compile
[INFO] | \- com.fasterxml.woodstox:woodstox-core:jar:6.2.7:compile
[INFO] +- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.13.2:compile
[INFO] | +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile
[INFO] | \- jakarta.activation:jakarta.activation-api:jar:1.2.1:compile
[INFO] +- org.apache.poi:poi:jar:5.2.2:compile
[INFO] | +- commons-codec:commons-codec:jar:1.15:compile
[INFO] | +- org.apache.commons:commons-collections4:jar:4.4:compile
[INFO] | +- org.apache.commons:commons-math3:jar:3.6.1:compile
[INFO] | +- commons-io:commons-io:jar:2.11.0:compile
[INFO] | +- com.zaxxer:SparseBitSet:jar:1.2:compile
[INFO] | \- org.apache.logging.log4j:log4j-api:jar:2.17.2:compile
[INFO] +- com.company.commons:commons-batch:jar:2.9.0-SNAPSHOT:compile
[INFO] | +- com.company.commons:commons-domain:jar:2.9.0-SNAPSHOT:compile
[INFO] | | +- org.zalando:problem-spring-web:jar:0.27.0:compile
[INFO] | | | +- org.zalando:problem-violations:jar:0.27.0:compile
[INFO] | | | +- org.zalando:problem-spring-common:jar:0.27.0:compile
[INFO] | | | +- org.apiguardian:apiguardian-api:jar:1.1.2:compile
[INFO] | | | +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] | | | +- org.slf4j:slf4j-api:jar:1.7.32:compile
[INFO] | | | +- org.zalando:problem:jar:0.26.0:compile
[INFO] | | | +- org.zalando:jackson-datatype-problem:jar:0.26.0:compile
[INFO] | | | +- org.zalando:faux-pas:jar:0.9.0:compile
[INFO] | | | \- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] | | +- com.google.guava:guava:jar:31.0.1-jre:compile
[INFO] | | | +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] | | | +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] | | | +- org.checkerframework:checker-qual:jar:3.12.0:compile
[INFO] | | | +- com.google.errorprone:error_prone_annotations:jar:2.7.1:compile
[INFO] | | | \- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] | | +- commons-beanutils:commons-beanutils:jar:1.9.3:compile
[INFO] | | | +- commons-logging:commons-logging:jar:1.2:compile
[INFO] | | | \- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.2.0.RELEASE:compile
[INFO] | | | +- com.zaxxer:HikariCP:jar:3.4.1:compile
[INFO] | | | \- org.springframework:spring-jdbc:jar:5.2.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-integration:jar:2.2.0.RELEASE:compile
[INFO] | | | \- org.springframework.integration:spring-integration-core:jar:5.2.0.RELEASE:compile
[INFO] | | | +- io.projectreactor:reactor-core:jar:3.3.0.RELEASE:compile
[INFO] | | | | \- org.reactivestreams:reactive-streams:jar:1.0.3:compile
[INFO] | | | +- org.springframework.retry:spring-retry:jar:1.2.4.RELEASE:compile
[INFO] | | | \- org.springframework:spring-messaging:jar:5.2.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-actuator:jar:2.2.0.RELEASE:compile
[INFO] | | | +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.2.0.RELEASE:compile
[INFO] | | | | \- org.springframework.boot:spring-boot-actuator:jar:2.2.0.RELEASE:compile
[INFO] | | | \- io.micrometer:micrometer-core:jar:1.3.0:compile
[INFO] | | | +- org.hdrhistogram:HdrHistogram:jar:2.1.11:compile
[INFO] | | | \- org.latencyutils:LatencyUtils:jar:2.0.3:compile
[INFO] | | +- org.springframework.security:spring-security-crypto:jar:4.2.2.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-data-jpa:jar:2.2.0.RELEASE:compile
[INFO] | | | +- jakarta.persistence:jakarta.persistence-api:jar:2.2.3:compile
[INFO] | | | +- jakarta.transaction:jakarta.transaction-api:jar:1.3.3:compile
[INFO] | | | +- org.hibernate:hibernate-core:jar:5.4.6.Final:compile
[INFO] | | | | +- org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile
[INFO] | | | | +- org.javassist:javassist:jar:3.24.0-GA:compile
[INFO] | | | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | | | +- org.jboss:jandex:jar:2.0.5.Final:compile
[INFO] | | | | +- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] | | | | +- org.dom4j:dom4j:jar:2.1.1:compile
[INFO] | | | | +- org.hibernate.common:hibernate-commons-annotations:jar:5.1.0.Final:compile
[INFO] | | | | \- org.glassfish.jaxb:jaxb-runtime:jar:2.3.1:compile
[INFO] | | | | +- org.glassfish.jaxb:txw2:jar:2.3.1:compile
[INFO] | | | | +- com.sun.istack:istack-commons-runtime:jar:3.0.7:compile
[INFO] | | | | +- org.jvnet.staxex:stax-ex:jar:1.8:compile
[INFO] | | | | \- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.15:compile
[INFO] | | | +- org.springframework.data:spring-data-jpa:jar:2.2.0.RELEASE:compile
[INFO] | | | | +- org.springframework.data:spring-data-commons:jar:2.2.0.RELEASE:compile
[INFO] | | | | \- org.springframework:spring-orm:jar:5.2.0.RELEASE:compile
[INFO] | | | \- org.springframework:spring-aspects:jar:5.2.0.RELEASE:compile
[INFO] | | \- commons-net:commons-net:jar:3.6:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-quartz:jar:2.2.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter:jar:2.2.0.RELEASE:compile
[INFO] | | | +- org.springframework.boot:spring-boot:jar:2.2.0.RELEASE:compile
[INFO] | | | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.2.0.RELEASE:compile
[INFO] | | | +- org.springframework.boot:spring-boot-starter-logging:jar:2.2.0.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.apache.logging.log4j:log4j-to-slf4j:jar:2.12.1:compile
[INFO] | | | | \- org.slf4j:jul-to-slf4j:jar:1.7.28:compile
[INFO] | | | +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] | | | \- org.yaml:snakeyaml:jar:1.25:runtime
[INFO] | | +- org.springframework:spring-context-support:jar:5.2.0.RELEASE:compile
[INFO] | | | +- org.springframework:spring-beans:jar:5.2.0.RELEASE:compile
[INFO] | | | \- org.springframework:spring-context:jar:5.2.0.RELEASE:compile
[INFO] | | +- org.springframework:spring-tx:jar:5.2.0.RELEASE:compile
[INFO] | | \- org.quartz-scheduler:quartz:jar:2.3.1:compile
[INFO] | | \- com.mchange:mchange-commons-java:jar:0.2.15:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-batch:jar:2.2.0.RELEASE:compile
[INFO] | | \- org.springframework.batch:spring-batch-core:jar:4.2.0.RELEASE:compile
[INFO] | | +- javax.batch:javax.batch-api:jar:1.0:compile
[INFO] | | +- org.codehaus.jettison:jettison:jar:1.2:compile
[INFO] | | \- org.springframework.batch:spring-batch-infrastructure:jar:4.2.0.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-web:jar:2.2.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-json:jar:2.2.0.RELEASE:compile
[INFO] | | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.10.0:compile
[INFO] | | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.10.0:compile
[INFO] | | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.10.0:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.2.0.RELEASE:compile
[INFO] | | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.27:compile
[INFO] | | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.27:compile
[INFO] | | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.27:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-validation:jar:2.2.0.RELEASE:compile
[INFO] | | | +- jakarta.validation:jakarta.validation-api:jar:2.0.1:compile
[INFO] | | | \- org.hibernate.validator:hibernate-validator:jar:6.0.17.Final:compile
[INFO] | | +- org.springframework:spring-web:jar:5.2.0.RELEASE:compile
[INFO] | | \- org.springframework:spring-webmvc:jar:5.2.0.RELEASE:compile
[INFO] | | \- org.springframework:spring-expression:jar:5.2.0.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-test:jar:2.2.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-test:jar:2.2.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.2.0.RELEASE:compile
[INFO] | | +- com.jayway.jsonpath:json-path:jar:2.4.0:compile
[INFO] | | | \- net.minidev:json-smart:jar:2.3:compile
[INFO] | | | \- net.minidev:accessors-smart:jar:1.2:compile
[INFO] | | | \- org.ow2.asm:asm:jar:5.0.4:compile
[INFO] | | +- org.junit.jupiter:junit-jupiter:jar:5.5.2:compile
[INFO] | | | +- org.junit.jupiter:junit-jupiter-api:jar:5.5.2:compile
[INFO] | | | | +- org.opentest4j:opentest4j:jar:1.2.0:compile
[INFO] | | | | \- org.junit.platform:junit-platform-commons:jar:1.5.2:compile
[INFO] | | | +- org.junit.jupiter:junit-jupiter-params:jar:5.5.2:compile
[INFO] | | | \- org.junit.jupiter:junit-jupiter-engine:jar:5.5.2:runtime
[INFO] | | +- org.junit.vintage:junit-vintage-engine:jar:5.5.2:compile
[INFO] | | | +- org.junit.platform:junit-platform-engine:jar:1.5.2:compile
[INFO] | | | \- junit:junit:jar:4.12:compile
[INFO] | | +- org.mockito:mockito-junit-jupiter:jar:3.1.0:compile
[INFO] | | +- org.assertj:assertj-core:jar:3.13.2:compile
[INFO] | | +- org.hamcrest:hamcrest:jar:2.1:compile
[INFO] | | +- org.mockito:mockito-core:jar:3.1.0:compile
[INFO] | | | +- net.bytebuddy:byte-buddy:jar:1.9.10:compile
[INFO] | | | +- net.bytebuddy:byte-buddy-agent:jar:1.9.10:compile
[INFO] | | | \- org.objenesis:objenesis:jar:2.6:compile
[INFO] | | +- org.skyscreamer:jsonassert:jar:1.5.0:compile
[INFO] | | | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:compile
[INFO] | | +- org.springframework:spring-core:jar:5.2.0.RELEASE:compile
[INFO] | | | \- org.springframework:spring-jcl:jar:5.2.0.RELEASE:compile
[INFO] | | +- org.springframework:spring-test:jar:5.2.0.RELEASE:compile
[INFO] | | \- org.xmlunit:xmlunit-core:jar:2.6.3:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-cache:jar:2.2.0.RELEASE:compile
[INFO] | \- org.springframework.boot:spring-boot-starter-aop:jar:2.2.0.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:5.2.0.RELEASE:compile
[INFO] | \- org.aspectj:aspectjweaver:jar:1.9.4:compile
[INFO] +- org.apache.commons:commons-csv:jar:1.8:compile
[INFO] +- com.company.project:project-domain:jar:0.1.0-SNAPSHOT:compile
[INFO] \- org.projectlombok:lombok:jar:1.18.22:provided
The solution as described here and playing with versions yields to no result.
What am I missing?
The spring-boot-starter version 2.2.0 dependency was bringing log4j related dependencies with 2.12.1 version, which, did not have atDebug() method. So:
<dependencyManagement>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-to-slf4j -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>2.17.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.17.2</version>
</dependency>
</dependencies>
</dependencyManagement>
resolved the issue.
I have this exception when launching my application via eclipse plugin:
"Run as" > "GWT Development Mode with jetty"
Environment:
- GWT SDK 2.8
- spring-boot 1.5.2.RELEASE
- jetty 9.4.2
- GWT Eclipse Plugin 3.0.0
Context: migrate a GWT 2.6 application to GWT 2.8 and using spring-boot
application pom generated with GWT webAppCreator
Here is the stack trace:
**Exception in thread "main" java.lang.NoSuchMethodError:
org.eclipse.jetty.websocket.server.WebSocketServerFactory.<init>(Ljavax/servlet/ServletContext;)V**
at org.eclipse.jetty.websocket.server.NativeWebSocketConfiguration.<init>(NativeWebSocketConfiguration.java:53)
at org.eclipse.jetty.websocket.server.NativeWebSocketServletContainerInitializer.getDefaultFrom(NativeWebSocketServletContainerInitializer.java:36)
at org.eclipse.jetty.websocket.server.NativeWebSocketServletContainerInitializer.onStartup(NativeWebSocketServletContainerInitializer.java:46)
at org.eclipse.jetty.plus.annotation.ContainerInitializer.callStartup(ContainerInitializer.java:140)
at org.eclipse.jetty.annotations.ServletContainerInitializersStarter.doStart(ServletContainerInitializersStarter.java:63)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:329)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1480)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1442)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:799)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:540)
at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:550)
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.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
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:105)
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 com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:759)
at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:634)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:923)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:706)
at com.google.gwt.dev.DevMode.main(DevMode.java:430)
Why my application fails to start?
Here is my pom and dependency tree .
Thank you for your help
pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<!-- POM file generated with GWT webAppCreator -->
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.fonems.webapp</groupId>
<artifactId>Fonemswebapp</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>com.mycompany.fonems.webapp.Fonemswebapp</name>
<parent> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.RELEASE</version>
</parent>
<properties>
<!-- Setting maven.compiler.source to something different to 1.8
needs that you configure the sourceLevel in gwt-maven-plugin since
GWT compiler 2.8 requires 1.8 (see gwt-maven-plugin block below) -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- Don't let your Mac use a crazy non-standard encoding -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<smartgwt.version>3.1</smartgwt.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- ensure all GWT deps use the same version (unless overridden) -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt</artifactId>
<version>2.8.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.mycompany.fonems</groupId>
<artifactId>fonems-fwk-server-common</artifactId>
<version>0.0.104-SNAPSHOT</version>
<exclusions>
<exclusion>
<artifactId>xercesImpl</artifactId>
<groupId>xerces</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.mycompany.fonems</groupId>
<artifactId>fonems-refonte-dao</artifactId>
<version>0.0.104-SNAPSHOT</version>
<exclusions>
<exclusion>
<artifactId>javax.el-api</artifactId>
<groupId>javax.el</groupId>
</exclusion>
<exclusion>
<artifactId>xercesImpl</artifactId>
<groupId>xerces</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>xercesImpl</artifactId>
<groupId>xerces</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.smartgwt</groupId>
<artifactId>smartgwt</artifactId>
<version>${smartgwt.version}</version>
</dependency>
<dependency>
<groupId>com.smartgwt</groupId>
<artifactId>smartgwt-skins</artifactId>
<version>${smartgwt.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>mycompany.drh</groupId>
<artifactId>newncauth</artifactId>
<version>${mycompany.drh.version}</version>
</dependency>
<dependency>
<groupId>mycompany.drh</groupId>
<artifactId>mycompany.droits-habilitations.rmi</artifactId>
<version>${mycompany.drh.rmi.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<!-- Output classes directly into the webapp, so that IDEs and "mvn process-classes" update them in DevMode -->
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<plugins>
<!-- GWT Maven Plugin-->
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0-rc-6</version>
<executions>
<execution>
<goals>
<goal>import-sources</goal>
<goal>compile</goal>
<goal>import-test-sources</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<moduleName>com.mycompany.fonems.webapp.Fonemswebapp</moduleName>
<moduleShortName>Fonemswebapp</moduleShortName>
<failOnError>true</failOnError>
<!-- GWT compiler 2.8 requires 1.8, hence define sourceLevel here if you use
a different source language for java compilation -->
<sourceLevel>1.8</sourceLevel>
<!-- Compiler configuration -->
<compilerArgs>
<!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->
<arg>-compileReport</arg>
<arg>-XcompilerMetrics</arg>
</compilerArgs>
<!-- DevMode configuration -->
<warDir>${project.build.directory}/${project.build.finalName}</warDir>
<classpathScope>compile+runtime</classpathScope>
<!-- URL(s) that should be opened by DevMode (gwt:devmode). -->
<startupUrls>
<startupUrl>Fonemswebapp.html</startupUrl>
</startupUrls>
<!-- <webappDirectory>${outputFolder}</webappDirectory> -->
</configuration>
</plugin>
<!-- Skip normal test execution, we use gwt:test instead -->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
dependency tree:
------------------------------------------------------------------------
Building com.mycompany.fonems.webapp.Fonemswebapp 1.0-SNAPSHOT
------------------------------------------------------------------------
--- maven-dependency-plugin:2.10:tree (default-cli) # Fonemswebapp ---
com.mycompany.fonems.webapp:Fonemswebapp:war:1.0-SNAPSHOT
+- com.mycompany.fonems:fonems-fwk-server-common:jar:0.0.104-SNAPSHOT:compile
| +- commons-configuration:commons-configuration:jar:1.9:compile
| | \- commons-logging:commons-logging:jar:1.1.1:compile
| +- commons-beanutils:commons-beanutils:jar:1.9.3:compile
| +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
| | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
| +- joda-time:joda-time:jar:2.9.7:compile
| +- org.apache.commons:commons-lang3:jar:3.1:compile
| +- commons-io:commons-io:jar:2.4:compile
| +- commons-lang:commons-lang:jar:2.6:compile
| +- commons-collections:commons-collections:jar:3.2.2:compile
| +- org.springframework:spring-tx:jar:4.3.7.RELEASE:compile
| +- org.springframework:spring-context:jar:4.3.7.RELEASE:compile
| | +- org.springframework:spring-aop:jar:4.3.7.RELEASE:compile
| | \- org.springframework:spring-expression:jar:4.3.7.RELEASE:compile
| +- javax.xml.bind:jaxb-api:jar:2.2.12:compile
| +- javax.validation:validation-api:jar:1.1.0.Final:compile
| +- com.google.guava:guava:jar:18.0:compile
| +- commons-betwixt:commons-betwixt:jar:0.8:compile
| | +- commons-beanutils:commons-beanutils-core:jar:1.7.0:compile
| | \- commons-digester:commons-digester:jar:2.1:compile
| +- net.sf.dozer:dozer:jar:5.4.0:compile
| +- org.slf4j:jcl-over-slf4j:jar:1.7.24:compile
| +- uk.org.lidalia:sysout-over-slf4j:jar:1.0.2:compile
| +- org.slf4j:slf4j-api:jar:1.7.24:compile
| \- ch.qos.logback:logback-classic:jar:1.1.11:compile
| \- ch.qos.logback:logback-core:jar:1.1.11:compile
+- com.mycompany.fonems:fonems-refonte-dao:jar:0.0.104-SNAPSHOT:compile
| +- com.zaxxer:HikariCP:jar:2.5.1:compile
| +- org.lazyluke:log4jdbc-remix:jar:0.2.7:compile
| +- com.mycompany.fonems:fonems-config:jar:0.0.104-SNAPSHOT:compile
| +- com.mycompany.fonems:fonems-refonte-model:jar:0.0.104-SNAPSHOT:compile
| | +- org.jvnet.jaxb2_commons:jaxb2-basics-runtime:jar:0.6.4:compile
| | +- openaccess:comFidessaInf:jar:3.0.1:compile
| | +- org.springframework.boot:spring-boot-starter-validation:jar:1.5.2.RELEASE:compile
| | | +- org.springframework.boot:spring-boot-starter:jar:1.5.2.RELEASE:compile
| | | | +- org.springframework.boot:spring-boot:jar:1.5.2.RELEASE:compile
| | | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.2.RELEASE:compile
| | | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.2.RELEASE:compile
| | | | | +- org.slf4j:jul-to-slf4j:jar:1.7.24:compile
| | | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.24:compile
| | | | \- org.yaml:snakeyaml:jar:1.17:runtime
| | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.11:compile
| | | \- org.hibernate:hibernate-validator:jar:5.3.4.Final:compile
| | | \- com.fasterxml:classmate:jar:1.3.3:compile
| | \- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.5.2.RELEASE:compile
| | +- org.springframework.boot:spring-boot-starter-aop:jar:1.5.2.RELEASE:compile
| | | \- org.aspectj:aspectjweaver:jar:1.8.9:compile
| | +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.5.2.RELEASE:compile
| | +- org.hibernate:hibernate-core:jar:5.0.12.Final:compile
| | | +- antlr:antlr:jar:2.7.7:compile
| | | \- org.jboss:jandex:jar:2.0.0.Final:compile
| | +- org.springframework.data:spring-data-jpa:jar:1.11.1.RELEASE:compile
| | | +- org.springframework.data:spring-data-commons:jar:1.13.1.RELEASE:compile
| | | \- org.springframework:spring-orm:jar:4.3.7.RELEASE:compile
| | \- org.springframework:spring-aspects:jar:4.3.7.RELEASE:compile
| +- org.springframework:spring-core:jar:4.3.7.RELEASE:compile
| +- org.springframework:spring-test:jar:4.3.7.RELEASE:compile
| +- org.springframework:spring-jdbc:jar:4.3.7.RELEASE:compile
| +- org.springframework:spring-beans:jar:4.3.7.RELEASE:compile
| +- org.hsqldb:hsqldb:jar:2.3.3:compile
| +- commons-dbcp:commons-dbcp:jar:1.4:compile
| | \- commons-pool:commons-pool:jar:1.6:compile
| +- com.oracle:ojdbc7:jar:12.1.0.2:compile
| \- de.jpdigital:hibernate5-ddl-maven-plugin:jar:1.0.0:compile
| +- org.apache.maven:maven-artifact:jar:3.3.9:compile
| +- org.apache.maven:maven-core:jar:3.3.9:compile
| | +- org.apache.maven:maven-model:jar:3.3.9:compile
| | +- org.apache.maven:maven-settings:jar:3.3.9:compile
| | +- org.apache.maven:maven-settings-builder:jar:3.3.9:compile
| | | \- org.apache.maven:maven-builder-support:jar:3.3.9:compile
| | +- org.apache.maven:maven-repository-metadata:jar:3.3.9:compile
| | +- org.apache.maven:maven-model-builder:jar:3.3.9:compile
| | +- org.apache.maven:maven-aether-provider:jar:3.3.9:compile
| | | \- org.eclipse.aether:aether-spi:jar:1.0.2.v20150114:compile
| | +- org.eclipse.aether:aether-impl:jar:1.0.2.v20150114:compile
| | +- org.eclipse.aether:aether-api:jar:1.0.2.v20150114:compile
| | +- org.eclipse.aether:aether-util:jar:1.0.2.v20150114:compile
| | +- org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.2:compile
| | | +- javax.enterprise:cdi-api:jar:1.0:compile
| | | | \- javax.annotation:jsr250-api:jar:1.0:compile
| | | \- org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.2:compile
| | +- com.google.inject:guice:jar:no_aop:4.0:compile
| | | +- javax.inject:javax.inject:jar:1:compile
| | | \- aopalliance:aopalliance:jar:1.0:compile
| | +- org.codehaus.plexus:plexus-interpolation:jar:1.21:compile
| | +- org.codehaus.plexus:plexus-classworlds:jar:2.5.2:compile
| | +- org.codehaus.plexus:plexus-component-annotations:jar:1.6:compile
| | \- org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
| | \- org.sonatype.plexus:plexus-cipher:jar:1.4:compile
| +- org.apache.maven:maven-plugin-api:jar:3.3.9:compile
| +- org.apache.maven:maven-project:jar:3.0-alpha-2:compile
| | +- org.apache.maven:maven-compat:jar:3.0-alpha-2:compile
| | | \- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-4:compile
| | +- org.codehaus.plexus:plexus-container-default:jar:1.0-beta-3.0.5:compile
| | | +- org.apache.xbean:xbean-reflect:jar:3.4:compile
| | | | +- log4j:log4j:jar:1.2.12:compile
| | | | \- commons-logging:commons-logging-api:jar:1.1:compile
| | | \- com.google.code.google-collections:google-collect:jar:snapshot-20080530:compile
| | +- org.codehaus.woodstox:wstx-asl:jar:3.2.6:compile
| | | \- stax:stax-api:jar:1.0.1:compile
| | +- org.sonatype.spice:model-builder:jar:1.3:compile
| | \- org.apache.maven:maven-project-builder:jar:3.0-alpha-2:compile
| +- org.codehaus.plexus:plexus-utils:jar:3.0.24:compile
| +- org.hibernate:hibernate-entitymanager:jar:5.0.12.Final:compile
| | +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile
| | +- dom4j:dom4j:jar:1.6.1:compile
| | +- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
| | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
| | +- org.javassist:javassist:jar:3.21.0-GA:compile
| | \- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
| +- org.hibernate:hibernate-envers:jar:5.0.12.Final:compile
| +- org.reflections:reflections:jar:0.9.10:compile
| | \- com.google.code.findbugs:annotations:jar:2.0.1:compile
| \- javax.transaction:javax.transaction-api:jar:1.2:compile
+- com.google.gwt:gwt-servlet:jar:2.8.0:runtime
+- com.google.gwt:gwt-user:jar:2.8.0:provided
| +- com.google.jsinterop:jsinterop-annotations:jar:1.0.1:provided
| +- com.google.jsinterop:jsinterop-annotations:jar:sources:1.0.1:provided
| +- javax.validation:validation-api:jar:sources:1.0.0.GA:provided
| +- javax.servlet:javax.servlet-api:jar:3.1.0:provided
| \- org.w3c.css:sac:jar:1.3:provided
+- com.google.gwt:gwt-dev:jar:2.8.0:provided
| +- com.google.code.gson:gson:jar:2.8.0:provided
| +- org.ow2.asm:asm:jar:5.0.3:provided
| +- org.ow2.asm:asm-util:jar:5.0.3:provided
| | \- org.ow2.asm:asm-tree:jar:5.0.3:provided
| +- org.ow2.asm:asm-commons:jar:5.0.3:provided
| +- colt:colt:jar:1.2.0:provided
| +- ant:ant:jar:1.6.5:provided
| +- com.ibm.icu:icu4j:jar:50.1.1:provided
| +- tapestry:tapestry:jar:4.0.2:provided
| +- net.sourceforge.htmlunit:htmlunit:jar:2.21:provided
| | +- xalan:xalan:jar:2.7.2:provided
| | | \- xalan:serializer:jar:2.7.2:provided
| | +- org.apache.httpcomponents:httpclient:jar:4.5.3:provided
| | | \- org.apache.httpcomponents:httpcore:jar:4.4.6:provided
| | +- org.apache.httpcomponents:httpmime:jar:4.5.3:provided
| | +- commons-codec:commons-codec:jar:1.10:provided
| | +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.17:provided
| | +- net.sourceforge.htmlunit:neko-htmlunit:jar:2.21:provided
| | +- net.sourceforge.cssparser:cssparser:jar:0.9.18:provided
| | \- org.eclipse.jetty.websocket:websocket-client:jar:9.4.2.v20170220:provided
| | +- org.eclipse.jetty:jetty-client:jar:9.4.2.v20170220:provided
| | \- org.eclipse.jetty.websocket:websocket-common:jar:9.2.14.v20151106:provided
| | \- org.eclipse.jetty.websocket:websocket-api:jar:9.2.14.v20151106:provided
| +- org.eclipse.jetty:jetty-webapp:jar:9.4.2.v20170220:provided
| | +- org.eclipse.jetty:jetty-xml:jar:9.4.2.v20170220:provided
| | \- org.eclipse.jetty:jetty-servlet:jar:9.4.2.v20170220:provided
| | \- org.eclipse.jetty:jetty-security:jar:9.4.2.v20170220:provided
| | \- org.eclipse.jetty:jetty-server:jar:9.4.2.v20170220:provided
| +- org.eclipse.jetty:jetty-servlets:jar:9.4.2.v20170220:provided
| | +- org.eclipse.jetty:jetty-continuation:jar:9.4.2.v20170220:provided
| | +- org.eclipse.jetty:jetty-http:jar:9.4.2.v20170220:provided
| | +- org.eclipse.jetty:jetty-util:jar:9.4.2.v20170220:provided
| | \- org.eclipse.jetty:jetty-io:jar:9.4.2.v20170220:provided
| +- org.eclipse.jetty:jetty-annotations:jar:9.4.2.v20170220:provided
| | +- org.eclipse.jetty:jetty-plus:jar:9.4.2.v20170220:provided
| | | \- org.eclipse.jetty:jetty-jndi:jar:9.2.14.v20151106:provided
| | \- javax.annotation:javax.annotation-api:jar:1.2:provided
| \- org.eclipse.jetty:apache-jsp:jar:9.4.2.v20170220:provided
| +- org.eclipse.jetty.toolchain:jetty-schemas:jar:3.1:provided
| +- org.mortbay.jasper:apache-jsp:jar:8.5.9.1:provided
| | \- org.mortbay.jasper:apache-el:jar:8.0.33:provided
| \- org.eclipse.jdt.core.compiler:ecj:jar:4.4.2:provided
+- com.smartgwt:smartgwt:jar:3.1:compile
+- com.smartgwt:smartgwt-skins:jar:3.1:compile
+- mycompany.drh:newncauth:jar:2.0.0:compile
+- mycompany.drh:mycompany.droits-habilitations.rmi:jar:02.10.01:compile
+- junit:junit:jar:4.12:test
| \- org.hamcrest:hamcrest-core:jar:1.3:test
\- org.projectlombok:lombok:jar:1.16.14:compile
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
I tested the solutions proposed by Andy, but not successful, always the same exception
test 1 proposed by Andy (add property jetty.version 9.2.14.v20151106)
pom modification:
+1 line
<properties>
<jetty.version>9.2.14.v20151106</jetty.version>
</properties>
dependency tree modifications (other lines are unchanged compared to the first tree dependency):
+- com.google.gwt:gwt-dev:jar:2.8.0:provided
| +- com.google.code.gson:gson:jar:2.8.0:provided
| +- org.ow2.asm:asm:jar:5.0.3:provided
| +- org.ow2.asm:asm-util:jar:5.0.3:provided
| | \- org.ow2.asm:asm-tree:jar:5.0.3:provided
| +- org.ow2.asm:asm-commons:jar:5.0.3:provided
| +- colt:colt:jar:1.2.0:provided
| +- ant:ant:jar:1.6.5:provided
| +- com.ibm.icu:icu4j:jar:50.1.1:provided
| +- tapestry:tapestry:jar:4.0.2:provided
| +- net.sourceforge.htmlunit:htmlunit:jar:2.21:provided
| | +- xalan:xalan:jar:2.7.2:provided
| | | \- xalan:serializer:jar:2.7.2:provided
| | +- org.apache.httpcomponents:httpclient:jar:4.5.3:provided
| | | \- org.apache.httpcomponents:httpcore:jar:4.4.6:provided
| | +- org.apache.httpcomponents:httpmime:jar:4.5.3:provided
| | +- commons-codec:commons-codec:jar:1.10:provided
| | +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.17:provided
| | +- net.sourceforge.htmlunit:neko-htmlunit:jar:2.21:provided
| | +- net.sourceforge.cssparser:cssparser:jar:0.9.18:provided
| | \- org.eclipse.jetty.websocket:websocket-client:jar:9.2.14.v20151106:provided
| | \- org.eclipse.jetty.websocket:websocket-common:jar:9.2.14.v20151106:provided
| | \- org.eclipse.jetty.websocket:websocket-api:jar:9.2.14.v20151106:provided
| +- org.eclipse.jetty:jetty-webapp:jar:9.2.14.v20151106:provided
| | +- org.eclipse.jetty:jetty-xml:jar:9.2.14.v20151106:provided
| | \- org.eclipse.jetty:jetty-servlet:jar:9.2.14.v20151106:provided
| | \- org.eclipse.jetty:jetty-security:jar:9.2.14.v20151106:provided
| +- org.eclipse.jetty:jetty-servlets:jar:9.2.14.v20151106:provided
| | +- org.eclipse.jetty:jetty-continuation:jar:9.2.14.v20151106:provided
| | +- org.eclipse.jetty:jetty-http:jar:9.2.14.v20151106:provided
| | +- org.eclipse.jetty:jetty-util:jar:9.2.14.v20151106:provided
| | \- org.eclipse.jetty:jetty-io:jar:9.2.14.v20151106:provided
| +- org.eclipse.jetty:jetty-annotations:jar:9.2.14.v20151106:provided
| | +- org.eclipse.jetty:jetty-plus:jar:9.2.14.v20151106:provided
| | | \- org.eclipse.jetty:jetty-jndi:jar:9.2.14.v20151106:provided
| | \- javax.annotation:javax.annotation-api:jar:1.2:provided
| \- org.eclipse.jetty:apache-jsp:jar:9.2.14.v20151106:provided
| +- org.eclipse.jetty:jetty-server:jar:9.2.14.v20151106:provided
| +- org.eclipse.jetty.toolchain:jetty-schemas:jar:3.1.M0:provided
| \- org.mortbay.jasper:apache-jsp:jar:8.0.9.M3:provided
| \- org.mortbay.jasper:apache-el:jar:8.0.33:provided
+- com.smartgwt:smartgwt:jar:3.1:compile
+- com.smartgwt:smartgwt-skins:jar:3.1:compile
test 2 proposed by Andy (force dependencies in 9.2.14 to 9.4.2.v20170220)
pom modifications:
<dependencyManagement>
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-common</artifactId>
<version>9.4.2.v20170220</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-api</artifactId>
<version>9.4.2.v20170220</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jndi</artifactId>
<version>9.4.2.v20170220</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
dependency tree modifications (other lines are unchanged compared to the first tree dependency):
+- com.google.gwt:gwt-user:jar:2.8.0:provided
...
| | \- org.eclipse.jetty.websocket:websocket-common:jar:9.4.2.v20170220:provided
| | \- org.eclipse.jetty.websocket:websocket-api:jar:9.4.2.v20170220:provided
...
| | | \- org.eclipse.jetty:jetty-jndi:jar:9.4.2.v20170220:provided
last test logs:
11:17:35,004 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
11:17:35,020 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Will scan for changes in [file:/C:/Dev/Appli/fonems-webapp/fonemswebapp/src/mai
n/webapp/WEB-INF/classes/logback.xml]
11:17:35,020 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Setting ReconfigureOnChangeTask scanning period to 1 minutes
11:17:35,020 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter#2:52 - RuntimeException in Action for tag [configuration] java.lang.NullPointerException
at java.lang.NullPointerException
at java.lang.ClassLoader.resolveClass0(Native Method)
at java.lang.ClassLoader.resolveClass(ClassLoader.java:964)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:523)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at ch.qos.logback.classic.util.EnvUtil.isGroovyAvailable(EnvUtil.java:36)
at ch.qos.logback.classic.joran.action.ConfigurationAction.begin(ConfigurationAction.java:68)
at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:269)
at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:145)
at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:128)
at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
...
at com.google.gwt.dev.DevMode.main(DevMode.java:430)
11:17:35,020 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator#6af1c1b - Registering current configuration as safe fallback point
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
Exception in thread "main" java.lang.NoSuchMethodError: org.eclipse.jetty.websocket.server.WebSocketServerFactory.<init>(Ljavax/servlet/ServletContext;)V
at org.eclipse.jetty.websocket.server.NativeWebSocketConfiguration.<init>(NativeWebSocketConfiguration.java:53)
------------------------------------------------------------------------
I did an other test: I delete spring-boot dependency: result=same exception. Moreover, the dependency tree shows all jetty atrifacts in version 9.2.14.v20151106
Moreover, I try to search the class org.eclipse.jetty.websocket.server.WebSocketServerFactory in jars but not found. Where is it present? Why this class is mentionned in logs?
Thank you for your help
You have a mixture of Jetty versions on the class path: 9.4.2.v20170220 and 9.2.14.v20151106. The former is what Spring Boot 1.5.2 uses by default. I would guess that latter is from the import of com.google.gwt:gwt.
You could override the jetty.version property that Spring Boot uses to set its value to 9.2.14.v20151106, thereby using 9.2.14 everywhere. Alternatively, you could declare your own dependency management for the modules that are currently using 9.2.14 to upgrade them to 9.4.2.
If I upgrade spring-boot version to 1.5.3.RELEASE, it seems to be ok: no such exception appears.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.3.RELEASE</version>
</parent>
Nevertheless, an another exception occured:
ServiceConfigurationError: org.apache.juli.logging.Log: Provider org.eclipse.jetty.apache.jsp.JuliLog not a subtype
To fix it, I have excluded jetty apache-jsp dependency from gwt-dev dependency
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>apache-jsp</artifactId>
<groupId>org.eclipse.jetty</groupId>
</exclusion>
</exclusions>
</dependency>
I just upgraded all my spring boot services from 1.3.6.RELEASE to 1.4.0.RELEASE. Now all of them crash at startup with a :
Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/factory/ObjectProvider
at java.lang.Class.getDeclaredConstructors0(Native Method) ~[na:1.8.0_91]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671) ~[na:1.8.0_91]
at java.lang.Class.getDeclaredConstructors(Class.java:2020) ~[na:1.8.0_91]
at org.springframework.cglib.proxy.Enhancer.generateClass(Enhancer.java:566) ~[spring-core-4.3.2.RELEASE.jar:4.3.2.RELEASE]
Here is one of my service dependency tree:
[INFO] com.onedesk:history-service:jar:0.0.1-SNAPSHOT
[INFO] +- com.onedesk.shared:dto:jar:1.0-SNAPSHOT:compile
[INFO] | \- com.onedesk.shared:core:jar:1.0-SNAPSHOT:compile
[INFO] +- com.onedesk.shared:endpoints:jar:1.0-SNAPSHOT:compile
[INFO] | +- (com.onedesk.shared:dto:jar:1.0-SNAPSHOT:compile - omitted for duplicate)
[INFO] | +- org.springframework:spring-context:jar:4.2.6.RELEASE:compile (version managed from 4.2.7.RELEASE)
[INFO] | | +- org.springframework:spring-aop:jar:4.2.6.RELEASE:compile
[INFO] | | | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | | | +- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile - omitted for duplicate)
[INFO] | | | \- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | | +- org.springframework:spring-beans:jar:4.2.6.RELEASE:compile
[INFO] | | | \- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | | \- org.springframework:spring-expression:jar:4.2.6.RELEASE:compile
[INFO] | | \- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | +- org.springframework:spring-web:jar:4.2.6.RELEASE:compile (version managed from 4.2.7.RELEASE)
[INFO] | | +- (org.springframework:spring-aop:jar:4.2.6.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 4.2.7.RELEASE; omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | \- log4j:log4j:jar:1.2.17:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:1.4.0.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.4.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:compile
[INFO] | | | +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | | | \- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 4.3.2.RELEASE; omitted for duplicate)
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.4.0.RELEASE:compile
[INFO] | | | \- (org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[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:slf4j-api:jar:1.7.21:compile - version managed from 1.6.6; omitted for duplicate)
[INFO] | | | +- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
[INFO] | | | | \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.20; omitted for duplicate)
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile
[INFO] | | | | \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.20; omitted for duplicate)
[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile
[INFO] | | | \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.20; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | | \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] | \- org.springframework.boot:spring-boot-actuator:jar:1.4.0.RELEASE:compile
[INFO] | +- (org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework.boot:spring-boot-autoconfigure:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[INFO] | +- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | \- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 4.3.2.RELEASE; omitted for duplicate)
[INFO] +- org.projectlombok:lombok:jar:1.16.10:compile
[INFO] +- org.springframework.boot:spring-boot-starter-remote-shell:jar:1.4.0.RELEASE:compile
[INFO] | +- (org.springframework.boot:spring-boot-starter:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework.boot:spring-boot-starter-actuator:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[INFO] | +- org.crashub:crash.cli:jar:1.3.2:compile
[INFO] | +- org.crashub:crash.connectors.ssh:jar:1.3.2:compile
[INFO] | | +- (org.crashub:crash.shell:jar:1.3.2:compile - omitted for duplicate)
[INFO] | | +- org.apache.sshd:sshd-core:jar:0.11.0:compile
[INFO] | | | \- (org.apache.mina:mina-core:jar:2.0.7:compile - omitted for duplicate)
[INFO] | | +- org.apache.sshd:sshd-pam:jar:0.11.0:compile
[INFO] | | | +- (org.apache.sshd:sshd-core:jar:0.11.0:compile - omitted for duplicate)
[INFO] | | | \- net.sf.jpam:jpam:jar:1.1:compile
[INFO] | | +- org.bouncycastle:bcprov-jdk15on:jar:1.51:compile
[INFO] | | +- org.bouncycastle:bcpkix-jdk15on:jar:1.51:compile
[INFO] | | | \- (org.bouncycastle:bcprov-jdk15on:jar:1.51:compile - omitted for duplicate)
[INFO] | | \- org.apache.mina:mina-core:jar:2.0.7:compile
[INFO] | | \- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] | +- org.crashub:crash.embed.spring:jar:1.3.2:compile
[INFO] | | +- (org.crashub:crash.shell:jar:1.3.2:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 3.1.1.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 3.1.1.RELEASE; omitted for duplicate)
[INFO] | | \- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile - version managed from 3.1.1.RELEASE; omitted for duplicate)
[INFO] | +- org.crashub:crash.plugins.cron:jar:1.3.2:compile
[INFO] | | +- (org.crashub:crash.shell:jar:1.3.2:compile - omitted for duplicate)
[INFO] | | \- it.sauronsoftware.cron4j:cron4j:jar:2.2.5:compile
[INFO] | +- org.crashub:crash.plugins.mail:jar:1.3.2:compile
[INFO] | | \- (org.crashub:crash.shell:jar:1.3.2:compile - omitted for duplicate)
[INFO] | +- org.crashub:crash.shell:jar:1.3.2:compile
[INFO] | | \- (org.crashub:crash.cli:jar:1.3.2:compile - omitted for duplicate)
[INFO] | +- org.codehaus.groovy:groovy:jar:2.4.7:compile
[INFO] | \- com.sun.mail:javax.mail:jar:1.5.5:compile
[INFO] | \- javax.activation:activation:jar:1.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.4.0.RELEASE:compile
[INFO] | +- (org.springframework.boot:spring-boot-starter:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[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.apache.tomcat.embed:tomcat-embed-core:jar:8.5.4:compile - omitted for duplicate)
[INFO] | +- org.hibernate:hibernate-validator:jar:5.2.4.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile (version managed from 3.2.1.Final)
[INFO] | | \- com.fasterxml:classmate:jar:1.3.1:compile (version managed from 1.1.0)
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.1:compile (version managed from 2.8.0)
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.8.1:compile
[INFO] | +- (org.springframework:spring-web:jar:4.2.6.RELEASE:compile - version managed from 4.3.2.RELEASE; omitted for duplicate)
[INFO] | \- org.springframework:spring-webmvc:jar:4.2.6.RELEASE:compile (version managed from 4.3.2.RELEASE)
[INFO] | +- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile - version managed from 3.1.1.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 3.1.1.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-expression:jar:4.2.6.RELEASE:compile - omitted for duplicate)
[INFO] | \- (org.springframework:spring-web:jar:4.2.6.RELEASE:compile - version managed from 4.3.2.RELEASE; omitted for duplicate)
[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:jar:1.4.0.RELEASE:test - omitted for duplicate)
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.4.0.RELEASE:test
[INFO] | | +- (org.springframework.boot:spring-boot-test:jar:1.4.0.RELEASE:test - omitted for duplicate)
[INFO] | | \- (org.springframework.boot:spring-boot-autoconfigure:jar:1.4.0.RELEASE:test - omitted for duplicate)
[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 - omitted for conflict with 5.0.4)
[INFO] | | \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.16; scope updated from test; omitted for duplicate)
[INFO] | +- junit:junit:jar:4.12:test
[INFO] | | \- (org.hamcrest:hamcrest-core:jar:1.3:test - version managed from 1.1; omitted for duplicate)
[INFO] | +- org.assertj:assertj-core:jar:2.5.0:test
[INFO] | +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | | +- (org.hamcrest:hamcrest-core:jar:1.3:test - version managed from 1.1; omitted for duplicate)
[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] | | \- (org.hamcrest:hamcrest-core:jar:1.3:test - version managed from 1.1; omitted for duplicate)
[INFO] | +- org.skyscreamer:jsonassert:jar:1.3.0:test
[INFO] | | \- (org.json:json:jar:20140107:test - version managed from 20090211; omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; scope updated from test; omitted for duplicate)
[INFO] | \- org.springframework:spring-test:jar:4.2.6.RELEASE:test (version managed from 4.3.2.RELEASE)
[INFO] | \- (org.springframework:spring-core:jar:4.3.2.RELEASE:test - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] +- org.springframework.boot:spring-boot-configuration-processor:jar:1.4.0.RELEASE:compile
[INFO] | +- org.json:json:jar:20140107:compile
[INFO] | \- org.springframework:spring-core:jar:4.3.2.RELEASE:compile
[INFO] \- org.springframework.cloud:spring-cloud-starter-eureka:jar:1.1.0.RELEASE:compile
[INFO] +- (org.springframework.boot:spring-boot-starter-web:jar:1.4.0.RELEASE:compile - version managed from 1.3.5.RELEASE; omitted for duplicate)
[INFO] +- org.springframework.cloud:spring-cloud-starter:jar:1.1.0.RELEASE:compile
[INFO] | +- (org.springframework.boot:spring-boot-starter:jar:1.4.0.RELEASE:compile - version managed from 1.3.4.RELEASE; omitted for duplicate)
[INFO] | +- org.springframework.cloud:spring-cloud-context:jar:1.1.0.RELEASE:compile
[INFO] | | \- org.springframework.security:spring-security-crypto:jar:4.0.4.RELEASE:compile
[INFO] | +- org.springframework.cloud:spring-cloud-commons:jar:1.1.0.RELEASE:compile
[INFO] | | \- (org.springframework.security:spring-security-crypto:jar:4.0.4.RELEASE:compile - omitted for duplicate)
[INFO] | \- org.springframework.security:spring-security-rsa:jar:1.0.1.RELEASE:compile
[INFO] | +- (org.springframework.security:spring-security-crypto:jar:4.0.4.RELEASE:compile - version managed from 3.2.7.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.1.6.RELEASE; omitted for duplicate)
[INFO] | \- (org.bouncycastle:bcpkix-jdk15on:jar:1.47:compile - omitted for conflict with 1.51)
[INFO] +- org.springframework.cloud:spring-cloud-netflix-core:jar:1.1.0.RELEASE:compile
[INFO] | +- (org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:compile - version managed from 1.3.5.RELEASE; omitted for duplicate)
[INFO] | \- (org.springframework.boot:spring-boot-autoconfigure:jar:1.4.0.RELEASE:compile - version managed from 1.3.5.RELEASE; omitted for duplicate)
[INFO] +- org.springframework.cloud:spring-cloud-netflix-eureka-client:jar:1.1.0.RELEASE:compile
[INFO] | \- (org.springframework.cloud:spring-cloud-netflix-core:jar:1.1.0.RELEASE:compile - omitted for duplicate)
[INFO] +- com.netflix.eureka:eureka-client:jar:1.4.6:compile
[INFO] | +- org.codehaus.jettison:jettison:jar:1.3.7:runtime
[INFO] | | \- stax:stax-api:jar:1.0.1:runtime
[INFO] | +- com.netflix.netflix-commons:netflix-eventbus:jar:0.3.0:runtime
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.21:runtime - version managed from 1.6.4; omitted for duplicate)
[INFO] | | +- (com.netflix.servo:servo-core:jar:0.10.1:runtime - version managed from 0.5.3; omitted for duplicate)
[INFO] | | \- (com.netflix.archaius:archaius-core:jar:0.7.4:runtime - version managed from 0.7.3; omitted for duplicate)
[INFO] | +- (com.thoughtworks.xstream:xstream:jar:1.4.2:runtime - omitted for duplicate)
[INFO] | +- (com.netflix.archaius:archaius-core:jar:0.7.4:compile - version managed from 0.7.3; scope updated from runtime; omitted for duplicate)
[INFO] | +- javax.ws.rs:jsr311-api:jar:1.1.1:runtime
[INFO] | +- com.netflix.servo:servo-core:jar:0.10.1:runtime
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.21:runtime - version managed from 1.7.12; omitted for duplicate)
[INFO] | | +- (com.google.guava:guava:jar:18.0:runtime - version managed from 16.0.1; omitted for duplicate)
[INFO] | | \- com.netflix.servo:servo-internal:jar:0.10.1:runtime
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.21:runtime - version managed from 1.7.12; omitted for duplicate)
[INFO] | | \- (com.google.guava:guava:jar:18.0:runtime - version managed from 16.0.1; omitted for duplicate)
[INFO] | +- com.sun.jersey:jersey-core:jar:1.19.1:runtime (version managed from 1.19)
[INFO] | | \- (javax.ws.rs:jsr311-api:jar:1.1.1:runtime - omitted for duplicate)
[INFO] | +- com.sun.jersey:jersey-client:jar:1.19.1:runtime (version managed from 1.19)
[INFO] | | \- (com.sun.jersey:jersey-core:jar:1.19.1:runtime - version managed from 1.19; omitted for duplicate)
[INFO] | +- com.sun.jersey.contribs:jersey-apache-client4:jar:1.19.1:runtime (version managed from 1.19)
[INFO] | | +- (org.apache.httpcomponents:httpclient:jar:4.5.2:runtime - version managed from 4.3.4; omitted for duplicate)
[INFO] | | \- (com.sun.jersey:jersey-client:jar:1.19.1:runtime - version managed from 1.19; omitted for duplicate)
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.2:runtime
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.4.5:runtime (version managed from 4.4.4)
[INFO] | | \- commons-codec:commons-codec:jar:1.10:runtime (version managed from 1.9)
[INFO] | +- com.google.inject:guice:jar:4.0:runtime
[INFO] | | +- javax.inject:javax.inject:jar:1:runtime
[INFO] | | +- (aopalliance:aopalliance:jar:1.0:runtime - omitted for duplicate)
[INFO] | | \- (com.google.guava:guava:jar:18.0:runtime - version managed from 16.0.1; omitted for duplicate)
[INFO] | +- com.netflix.governator:governator-api:jar:1.12.10:runtime
[INFO] | | \- (javax.inject:javax.inject:jar:1:runtime - omitted for duplicate)
[INFO] | +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.8.1:runtime - version managed from 2.5.4; omitted for duplicate)
[INFO] | +- (com.fasterxml.jackson.core:jackson-core:jar:2.8.1:runtime - version managed from 2.5.4; omitted for duplicate)
[INFO] | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:runtime - version managed from 2.5.4; omitted for duplicate)
[INFO] +- com.netflix.eureka:eureka-core:jar:1.4.6:compile
[INFO] | +- (com.netflix.eureka:eureka-client:jar:1.4.6:runtime - omitted for duplicate)
[INFO] | +- com.amazonaws:aws-java-sdk-core:jar:1.10.30:runtime (version managed from 1.9.3)
[INFO] | | +- (org.apache.httpcomponents:httpclient:jar:4.5.2:runtime - version managed from 4.3.6; omitted for duplicate)
[INFO] | | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:runtime - version managed from 2.5.3; omitted for duplicate)
[INFO] | +- com.amazonaws:aws-java-sdk-ec2:jar:1.10.30:runtime (version managed from 1.9.3)
[INFO] | | \- (com.amazonaws:aws-java-sdk-core:jar:1.10.30:runtime - version managed from 1.9.3; omitted for duplicate)
[INFO] | +- com.amazonaws:aws-java-sdk-autoscaling:jar:1.9.3:runtime
[INFO] | | \- (com.amazonaws:aws-java-sdk-core:jar:1.10.30:runtime - version managed from 1.9.3; omitted for duplicate)
[INFO] | +- com.amazonaws:aws-java-sdk-sts:jar:1.9.3:runtime
[INFO] | | \- (com.amazonaws:aws-java-sdk-core:jar:1.10.30:runtime - version managed from 1.9.3; omitted for duplicate)
[INFO] | +- com.amazonaws:aws-java-sdk-route53:jar:1.9.3:runtime
[INFO] | | \- (com.amazonaws:aws-java-sdk-core:jar:1.10.30:runtime - version managed from 1.9.3; omitted for duplicate)
[INFO] | +- com.netflix.governator:governator:jar:1.12.10:runtime
[INFO] | | +- (com.netflix.governator:governator-api:jar:1.12.10:runtime - omitted for duplicate)
[INFO] | | +- com.netflix.governator:governator-core:jar:1.12.10:runtime
[INFO] | | | +- (com.netflix.governator:governator-api:jar:1.12.10:runtime - omitted for duplicate)
[INFO] | | | +- (javax.inject:javax.inject:jar:1:runtime - omitted for duplicate)
[INFO] | | | +- (org.slf4j:slf4j-api:jar:1.7.21:runtime - version managed from 1.6.3; omitted for duplicate)
[INFO] | | | \- (com.google.inject:guice:jar:4.0:runtime - omitted for duplicate)
[INFO] | | +- org.ow2.asm:asm:jar:5.0.4:runtime
[INFO] | | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:runtime - version managed from 2.4.3; omitted for duplicate)
[INFO] | +- (com.thoughtworks.xstream:xstream:jar:1.4.2:runtime - omitted for duplicate)
[INFO] | +- (javax.ws.rs:jsr311-api:jar:1.1.1:runtime - omitted for duplicate)
[INFO] | \- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:runtime
[INFO] | +- javax.xml.stream:stax-api:jar:1.0-2:runtime
[INFO] | \- org.codehaus.woodstox:stax2-api:jar:3.1.4:runtime
[INFO] +- org.springframework.cloud:spring-cloud-starter-archaius:jar:1.1.0.RELEASE:compile
[INFO] | +- (org.springframework.cloud:spring-cloud-starter:jar:1.1.0.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework.cloud:spring-cloud-netflix-core:jar:1.1.0.RELEASE:compile - omitted for duplicate)
[INFO] | +- com.netflix.archaius:archaius-core:jar:0.7.4:compile
[INFO] | | +- com.google.code.findbugs:jsr305:jar:3.0.1:runtime
[INFO] | | +- (commons-configuration:commons-configuration:jar:1.8:runtime - omitted for duplicate)
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.21:runtime - version managed from 1.6.4; omitted for duplicate)
[INFO] | | +- (com.google.guava:guava:jar:18.0:runtime - version managed from 16.0; omitted for duplicate)
[INFO] | | +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.8.1:runtime - version managed from 2.4.3; omitted for duplicate)
[INFO] | | +- (com.fasterxml.jackson.core:jackson-core:jar:2.8.1:runtime - version managed from 2.4.3; omitted for duplicate)
[INFO] | | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:runtime - version managed from 2.4.3; omitted for duplicate)
[INFO] | +- commons-configuration:commons-configuration:jar:1.8:compile
[INFO] | | +- commons-lang:commons-lang:jar:2.6:compile
[INFO] | | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] | +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.8.1:compile - version managed from 2.6.6; omitted for duplicate)
[INFO] | +- (com.fasterxml.jackson.core:jackson-core:jar:2.8.1:compile - version managed from 2.6.6; omitted for duplicate)
[INFO] | +- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:compile - version managed from 2.6.6; omitted for duplicate)
[INFO] | \- com.google.guava:guava:jar:18.0:compile
It seems that there is a spring version issue there but I have not idea where it comes from. Here is my pom.xml.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.onedesk</groupId>
<artifactId>history-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>history-service</name>
<description>history service</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>com.onedesk.shared</groupId>
<artifactId>dto</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.onedesk.shared</groupId>
<artifactId>endpoints</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-remote-shell</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>Brixton.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
So the issue was in dependencyManagement:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>Brixton.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
I just needed to replace to:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId> <!--changed-->
<version>Brixton.SR4</version> <!--changed-->
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
You need to setup a dependencyManagement section in your pom.xml with Spring Boot's BOM dependency. Check it out here. But basically you need to add this:
<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.4.0.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
After that drop the version in all your spring-related dependencies and the versions will be managed by the above dependency.
--- Edit ---
Based on your comments try modifying your dependencies:
<dependency>
<groupId>com.onedesk.shared</groupId>
<artifactId>dto</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.onedesk.shared</groupId>
<artifactId>endpoints</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
to this:
<dependency>
<groupId>com.onedesk.shared</groupId>
<artifactId>dto</artifactId>
<version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.onedesk.shared</groupId>
<artifactId>endpoints</artifactId>
<version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
I assume this is the villain:
[INFO] +- com.onedesk.shared:endpoints:jar:1.0-SNAPSHOT:compile
[INFO] | +- (com.onedesk.shared:dto:jar:1.0-SNAPSHOT:compile - omitted for duplicate)
[INFO] | +- org.springframework:spring-context:jar:4.2.6.RELEASE:compile (version managed from 4.2.7.RELEASE)
[INFO] | | +- org.springframework:spring- aop:jar:4.2.6.RELEASE:compile
[INFO] | | | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | | | +- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile
At the end of the dependency chain is Spring Beans with version 4.2.6.
The ObjectProvider, which class isn't found, is available since version 4.3, as you can see in the API:
http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/beans/factory/ObjectProvider.html
You should upgrade the dependency from this artifact com.onedesk.shared:endpoints:jar to spring-context with version 4.3
Even after implementing the accepted solution, I was still having this problem. It turned out the camel dependency manager also needed to be upgraded:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-parent</artifactId>
<version>2.18.0</version> <--- was 2.17.2
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
We have a war that expose rest service over jersey 2.6 with validation based on hibernate-4.2.7 validation (implements validation-api-1.0.0.GA).
Everything worked fine before we upgraded to java 8 and tc-server 3.1.X.
After upgrading to java 8 it looks like something was broken in the validation api.
We get
java.lang.NoSuchMethodError: javax.validation.Configuration.getBootstrapConfiguration()Ljavax/validation/BootstrapConfiguration;
When we sent a rest request form the client.
The weirdest thing is that this behavior is not consist
When I add or remove jars from the dependencies it sometimes work and sometimes not.
And we get the following exception
SEVERE [tomcat-http--1] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [jerseyServlet] in context with path [/Analyzer] threw exception [A MultiException has 1 exceptions. They are:
1. java.lang.NoSuchMethodError: javax.validation.Configuration.getBootstrapConfiguration()Ljavax/validation/BootstrapConfiguration;
] with root cause
java.lang.NoSuchMethodError: javax.validation.Configuration.getBootstrapConfiguration()Ljavax/validation/BootstrapConfiguration;
at org.glassfish.jersey.server.validation.internal.ValidationBinder$ConfiguredValidatorProvider.getTraversableResolver(ValidationBinder.java:287)
at org.glassfish.jersey.server.validation.internal.ValidationBinder$ConfiguredValidatorProvider.getDefaultValidatorContext(ValidationBinder.java:268)
at org.glassfish.jersey.server.validation.internal.ValidationBinder$ConfiguredValidatorProvider.getDefaultValidator(ValidationBinder.java:248)
at org.glassfish.jersey.server.validation.internal.ValidationBinder$ConfiguredValidatorProvider.provide(ValidationBinder.java:199)
at org.glassfish.jersey.server.validation.internal.ValidationBinder$ConfiguredValidatorProvider.provide(ValidationBinder.java:173)
at org.jvnet.hk2.internal.FactoryCreator.create(FactoryCreator.java:96)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:456)
at org.jvnet.hk2.internal.PerLookupContext.findOrCreate(PerLookupContext.java:69)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2445)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:621)
at org.jvnet.hk2.internal.IterableProviderImpl.get(IterableProviderImpl.java:107)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:135)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$VoidOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:136)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:104)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:406)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:350)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:106)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:259)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:319)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:236)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1028)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:373)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:381)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:344)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:219)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at SourceResolverFilter.doFilter(SourceResolverFilter.java:71)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:277)
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)
Looking at the stack trace you can see that jersey is calling Configuration.getBootstrapConfiguration which is provided in validation-api-1.1.0.Final but not in validation-api-1.0.0.GA.
Our dependencies tree (excluding product specific jars) looks like
--- maven-dependency-plugin:2.10:tree (default-cli) ---
excluded war-SNAPSHOT
+- excluded jar
| +- excluded jar
| | \- org.hibernate:hibernate-validator:jar:4.2.0.Final:compile
| +- org.springframework:spring-context:jar:4.0.2.RELEASE:compile
| | +- org.springframework:spring-aop:jar:4.0.2.RELEASE:compile
| | | \- aopalliance:aopalliance:jar:1.0:compile
| | +- org.springframework:spring-beans:jar:4.0.2.RELEASE:compile
| | +- org.springframework:spring-core:jar:4.0.2.RELEASE:compile
| | \- org.springframework:spring-expression:jar:4.0.2.RELEASE:compile
| +- org.glassfish.jersey.core:jersey-server:jar:2.6:compile
| | +- org.glassfish.jersey.core:jersey-common:jar:2.6:compile
| | | +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.6:compile
| | | \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
| | +- org.glassfish.jersey.core:jersey-client:jar:2.6:compile
| | +- javax.ws.rs:javax.ws.rs-api:jar:2.0:compile
| | +- javax.annotation:javax.annotation-api:jar:1.2:compile
| | +- org.glassfish.hk2:hk2-api:jar:2.2.0:compile
| | | +- org.glassfish.hk2:hk2-utils:jar:2.2.0:compile
| | | \- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.2.0:compile
| | +- org.glassfish.hk2.external:javax.inject:jar:2.2.0:compile
| | +- org.glassfish.hk2:hk2-locator:jar:2.2.0:compile
| | \- javax.validation:validation-api:jar:1.0.0.GA:compile
| +- org.glassfish.jersey.media:jersey-media-json-jackson:jar:2.6:compile
| | +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
| | +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
| | +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.13:compile
| | \- org.codehaus.jackson:jackson-xc:jar:1.9.13:compile
| +- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.6:compile
| | \- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.6:compile
| +- org.glassfish.jersey.ext:jersey-spring3:jar:2.6:compile
| | +- org.glassfish.hk2:hk2:jar:2.2.0:compile
| | | +- org.glassfish.hk2:config-types:jar:2.2.0:compile
| | | +- org.glassfish.hk2:core:jar:2.2.0:compile
| | | +- org.glassfish.hk2:hk2-config:jar:2.2.0:compile
| | | | \- org.jvnet:tiger-types:jar:1.4:compile
| | | +- org.glassfish.hk2:hk2-runlevel:jar:2.2.0:compile
| | | \- org.glassfish.hk2:class-model:jar:2.2.0:compile
| | +- org.glassfish.hk2:spring-bridge:jar:2.2.0:compile
| | \- org.springframework:spring-web:jar:4.0.2.RELEASE:compile
| \- org.glassfish.jersey.ext:jersey-bean-validation:jar:2.6:compile
+- log4j:log4j:jar:1.2.17:compile
+- commons-logging:commons-logging:jar:1.1.1:compile
+- org.jasypt:jasypt-spring31:jar:1.9.0:compile
| \- org.jasypt:jasypt:jar:1.9.0:compile
+- excluded jar
| +- excluded jar
| | +- commons-configuration:commons-configuration:jar:1.5:compile
| | | +- commons-collections:commons-collections:jar:3.2.1:compile
| | | +- commons-lang:commons-lang:jar:2.4:compile
| | | +- commons-digester:commons-digester:jar:1.8:compile
| | | | \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
| | | \- commons-beanutils:commons-beanutils-core:jar:1.7.0:compile
| | +- commons-codec:commons-codec:jar:1.6:compile
| | \- org.apache.commons:commons-lang3:jar:3.3.2:compile
| +- excluded jar
| +- excluded jar
| | \- net.sf.ehcache:ehcache-core:jar:2.4.7:compile
| +- org.hibernate:hibernate-core:jar:4.2.7.Final:compile
| | +- antlr:antlr:jar:2.7.7:compile
| | +- org.jboss.logging:jboss-logging:jar:3.1.0.GA:compile
| | +- dom4j:dom4j:jar:1.6.1:compile
| | +- org.javassist:javassist:jar:3.18.0-GA:compile
| | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.1.Final:compile
| | +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
| | \- org.hibernate.common:hibernate-commons-annotations:jar:4.0.2.Final:compile
| +- org.springframework:spring-orm:jar:4.0.2.RELEASE:compile
| | +- org.springframework:spring-jdbc:jar:4.0.2.RELEASE:compile
| | \- org.springframework:spring-tx:jar:4.0.2.RELEASE:compile
| +- javax.servlet:servlet-api:jar:3.0:provided
| +- excluded jar
| | \- excluded jar
| +- excluded jar
| \- com.zaxxer:HikariCP-java6:jar:2.3.7:compile
| \- org.slf4j:slf4j-api:jar:1.7.6:compile
+- excluded jar-SNAPSHOT:compile
| \- excluded jar
+- excluded jar-SNAPSHOT:compile
| \- excluded jar
+- excluded jar-SNAPSHOT:compile
| \- excluded jar
| +- excluded jar
| | +- org.springframework.security:spring-security-core:jar:3.2.5.RELEASE:compile
| | \- excluded jar
| | +- excluded jar
| | \- excluded jar
| | \- excluded jar
| | \- com.springsource.insight:insight-annotation:jar:1.8.3.RELEASE:compile
| +- com.thoughtworks.xstream:xstream:jar:1.4.8:compile
| | +- xmlpull:xmlpull:jar:1.1.3.1:compile
| | \- xpp3:xpp3_min:jar:1.1.4c:compile
| +- com.thoughtworks.xstream:xstream-hibernate:jar:1.4.8:compile
| +- org.objectweb.asm.util:asm-util:jar:4.0:compile
| +- net.sf.cglib:cglib:jar:3.0:compile
| +- com.esotericsoftware.kryo:kryo:jar:2.19:compile
| | +- com.esotericsoftware.reflectasm:reflectasm:jar:shaded:1.07:compile
| | | \- org.ow2.asm:asm:jar:4.0:compile
| | \- com.esotericsoftware.minlog:minlog:jar:1.2:compile
| +- org.springframework.integration:spring-integration-core:jar:4.1.0.RELEASE:compile
| | +- org.projectreactor:reactor-core:jar:1.1.4.RELEASE:compile
| | | +- com.goldmansachs:gs-collections:jar:5.1.0:compile
| | | | \- com.goldmansachs:gs-collections-api:jar:5.1.0:compile
| | | +- com.lmax:disruptor:jar:3.2.1:compile
| | | \- io.gatling:jsr166e:jar:1.0:compile
| | +- org.springframework:spring-messaging:jar:4.1.2.RELEASE:compile
| | \- org.springframework.retry:spring-retry:jar:1.1.1.RELEASE:compile
| +- org.springframework.amqp:spring-rabbit:jar:1.4.5.RELEASE:compile
| +- org.springframework.amqp:spring-amqp:jar:1.4.5.RELEASE:compile
| +- org.springframework.security:spring-security-remoting:jar:3.2.5.RELEASE:compile
| +- com.rabbitmq:amqp-client:jar:3.5.3:compile
| \- org.springframework.integration:spring-integration-amqp:jar:4.1.0.RELEASE:compile
+- junit:junit:jar:4.11:test
| \- org.hamcrest:hamcrest-core:jar:1.3:test
+- org.mockito:mockito-core:jar:1.9.5:test
| \- org.objenesis:objenesis:jar:1.2:compile
\- excluded jar
+- excluded jar
\- org.springframework:spring-context-support:jar:4.0.2.RELEASE:compile
Any idea why sometimes jersey via hk2 insist on calling validation-api-1.1.0-Final method and sometime 1.0.0.GA as expected.
I know that validation is Auto-discovered in jersey is there a way to force it to use validation-api-1.0.0.GA implementation?
P.S. - I noticed that bean-validation-2.2.0 has a copy of the javax.validation.* packages from validation-api-1.1.0.Final (why???) but as you see from the dependency tree We specifically excluded it.
UPDATE:
Digging deeper into the code it looks like jersey-bean-validation:2.6 is actually compiled against validation-api-1.1.0.Final and statically calling the
getBootstrapConfiguration() method. Actually in the mvnrepository.com dependency it goes back to jersey-bean-validation:2.0 version deepening on validation-api-1.1.0.Final
Looking at the org.glassfish.jersey.server.validation.internal.ValidationBinder class
You can see that private ConfiguredValidator getDefaultValidator() method calls getBootstrapConfiguration(); upon calling the private method getTraversableResolver().
So it looks like the only options that somehow in the provide method I have a ContextResolver that cause the code to branch on a different path a voiding the call to
getBootstrapConfiguration
public ConfiguredValidator provide() {
ContextResolver contextResolver = this.providers.getContextResolver(ValidationConfig.class, MediaType.WILDCARD_TYPE);
if(contextResolver == null) {
return this.getDefaultValidator();
} else {
//not calling the getBootstrapConfiguration() method
}
I debugged two cases one that works and one that does not.
When the service works I noticed that ValidationBinder is injecting
org.hibernate.validator.internal.engine.ConfigurationImpl.class to configuration field
This implementation comes from the bean-validation-2.2.0 jar and implements the getBootstrapConfiguration() method
When the service does not works I ValidationBinder is injecting
org.hibernate.validator.engine.ConfigurationImpl to configuration field
Which comes from the hibernate-validation-4.2.0 jar.
I tried to force the setting by binding the Configuration to org.hibernate.validator.internal.engine.ConfigurationImpl.class
e.g.
public class JerseyConfig extends ResourceConfig {
public JerseyConfig() {
register(new AbstractBinder() {
#Override
protected void configure() {
bind(org.hibernate.validator.internal.engine.ConfigurationImpl.class).to(Configuration.class);
}
});
}
but this did not resolved my issue.
Following my investigations and the fact that I did not get any answer here (although I suggested a bounty) and not in the jersey forum.
One can assume that I was merely lucky that this functionally worked in java 7 (all the time) and in java 8 (part time) probably to some bugs/magical classpath order.
What worked for me was to upgrade to hibernate-validator 5.0.0 and validator-api-1.1.0.Final.
according to this thread, jersey 2.6 seems to be the last version of jersey that supported java 6. updating the jersey version should work too.
i updated my jersey version to 2.26, (the latest version at the time) and added the following dependencies to maven...then everything was good...
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>2.27</version>
</dependency>