I recently deployed a Spring Boot application that is scheduled to run every day in order to parse new data from a Cassandra cluster. After around 20 hours of work (some million read/write accesses to Cassandra) some memory issues arise and at each iteration (the exception is caught within the loop) I have this error:
java.lang.RuntimeException: java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
at org.springframework.data.mapping.model.ClassGeneratingPropertyAccessorFactory.createAccessorClass(ClassGeneratingPropertyAccessorFactory.java:170)
at org.springframework.data.mapping.model.ClassGeneratingPropertyAccessorFactory.potentiallyCreateAndRegisterPersistentPropertyAccessorClass(ClassGeneratingPropertyAccessorFactory.java:154)
at org.springframework.data.mapping.model.ClassGeneratingPropertyAccessorFactory.getPropertyAccessor(ClassGeneratingPropertyAccessorFactory.java:80)
at org.springframework.data.mapping.model.BasicPersistentEntity.getPropertyAccessor(BasicPersistentEntity.java:425)
at org.springframework.data.cassandra.convert.MappingCassandraConverter.getConvertingAccessor(MappingCassandraConverter.java:611)
at org.springframework.data.cassandra.convert.MappingCassandraConverter.readEntityFromRow(MappingCassandraConverter.java:172)
at org.springframework.data.cassandra.convert.MappingCassandraConverter.readRow(MappingCassandraConverter.java:149)
at com.myapp.utils.CassandraIterable$1.next(CassandraIterable.java:35)
at com.myapp.service.packer.PositionParsingService.parse(PositionParsingService.java:60)
at com.myapp.service.packer.PositionLoadService.update(PositionLoadService.java:202)
at com.myapp.service.packer.PositionLoadService.updateVehicle(PositionLoadService.java:129)
at com.myapp.service.packer.PositionLoadService.updateAllVehicles(PositionLoadService.java:99)
at com.myapp.service.packer.PositionLoadService.updateAllVehicles(PositionLoadService.java:84)
at com.myapp.service.packer.PositionLoadService$$FastClassBySpringCGLIB$$2605bc6c.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:721)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:115)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
at org.springframework.data.mapping.model.ClassGeneratingPropertyAccessorFactory$Evil.defineClass(ClassGeneratingPropertyAccessorFactory.java:1480)
at org.springframework.data.mapping.model.ClassGeneratingPropertyAccessorFactory$PropertyAccessorClassGenerator.generateCustomAccessorClass(ClassGeneratingPropertyAccessorFactory.java:282)
at org.springframework.data.mapping.model.ClassGeneratingPropertyAccessorFactory.createAccessorClass(ClassGeneratingPropertyAccessorFactory.java:168)
... 21 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.data.mapping.model.ClassGeneratingPropertyAccessorFactory$Evil.defineClass(ClassGeneratingPropertyAccessorFactory.java:1476)
... 23 common frames omitted
Caused by: java.lang.OutOfMemoryError: Compressed class space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
... 28 common frames omitted
By analysing the memory dumps produced after the issue occurred I had this report:
From Java mission control, after I run a garbage collection, I get:
I don't think my code is directly responsible for the leak, even though there could be something it isn't releasing when it should or there could be some config issue I overlooked.
I tried to upgrade java from JDK SE 8u60 to 8u121 and to upgrade Spring boot to version 1.5.2.RELEASE. Here's the complete list of dependencies:
com.myapp:jar:0.0.1-SNAPSHOT
+- org.springframework.boot:spring-boot-starter-data-jpa: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 - omitted for duplicate)
| | +- (org.springframework.boot:spring-boot-autoconfigure:jar:1.5.2.RELEASE:compile - omitted for duplicate)
| | +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.2.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.24:compile - version managed from 1.7.22; omitted for duplicate)
| | | +- org.slf4j:jcl-over-slf4j:jar:1.7.24:compile
| | | | \- (org.slf4j:slf4j-api:jar:1.7.24:compile - version managed from 1.7.22; omitted for duplicate)
| | | +- org.slf4j:jul-to-slf4j:jar:1.7.24:compile
| | | | \- (org.slf4j:slf4j-api:jar:1.7.24:compile - version managed from 1.7.22; omitted for duplicate)
| | | \- org.slf4j:log4j-over-slf4j:jar:1.7.24:compile
| | | \- (org.slf4j:slf4j-api:jar:1.7.24:compile - version managed from 1.7.22; omitted for duplicate)
| | +- org.springframework:spring-core:jar:4.3.7.RELEASE:compile
| | \- org.yaml:snakeyaml:jar:1.17:runtime
| +- org.springframework.boot:spring-boot-starter-aop:jar:1.5.2.RELEASE:compile
| | +- (org.springframework.boot:spring-boot-starter:jar:1.5.2.RELEASE:compile - omitted for duplicate)
| | +- org.springframework:spring-aop:jar:4.3.7.RELEASE:compile
| | | +- (org.springframework:spring-beans:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | | \- (org.springframework:spring-core:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | \- org.aspectj:aspectjweaver:jar:1.8.9:compile
| +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.5.2.RELEASE:compile
| | +- (org.springframework.boot:spring-boot-starter:jar:1.5.2.RELEASE:compile - omitted for duplicate)
| | +- org.apache.tomcat:tomcat-jdbc:jar:8.5.11:compile
| | | \- org.apache.tomcat:tomcat-juli:jar:8.5.11:compile
| | \- org.springframework:spring-jdbc:jar:4.3.7.RELEASE:compile
| | +- (org.springframework:spring-beans:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | +- (org.springframework:spring-core:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | \- (org.springframework:spring-tx:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| +- org.hibernate:hibernate-core:jar:5.0.12.Final:compile
| | +- org.jboss.logging:jboss-logging:jar:3.3.0.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 (version managed from 3.18.1-GA)
| | +- antlr:antlr:jar:2.7.7:compile
| | +- org.jboss:jandex:jar:2.0.0.Final:compile
| | +- dom4j:dom4j:jar:1.6.1:compile
| | \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
| | \- (org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile - omitted for duplicate)
| +- org.hibernate:hibernate-entitymanager:jar:5.0.12.Final:compile
| | +- (org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile - omitted for duplicate)
| | +- (org.hibernate:hibernate-core:jar:5.0.12.Final:compile - omitted for duplicate)
| | +- (dom4j:dom4j:jar:1.6.1:compile - omitted for duplicate)
| | +- (org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile - omitted for duplicate)
| | +- (org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile - omitted for duplicate)
| | \- (org.javassist:javassist:jar:3.21.0-GA:compile - version managed from 3.18.1-GA; omitted for duplicate)
| +- javax.transaction:javax.transaction-api:jar:1.2: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-core:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | | +- (org.springframework:spring-beans:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | | +- (org.slf4j:slf4j-api:jar:1.7.24:compile - version managed from 1.7.22; omitted for duplicate)
| | | \- (org.slf4j:jcl-over-slf4j:jar:1.7.24:runtime - omitted for duplicate)
| | +- org.springframework:spring-orm:jar:4.3.7.RELEASE:compile
| | | +- (org.springframework:spring-beans:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | | +- (org.springframework:spring-core:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | | +- (org.springframework:spring-jdbc:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | | \- (org.springframework:spring-tx:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | +- org.springframework:spring-context:jar:4.3.7.RELEASE:compile
| | | +- (org.springframework:spring-aop:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | | +- (org.springframework:spring-beans:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | | +- (org.springframework:spring-core:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | | \- (org.springframework:spring-expression:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | +- (org.springframework:spring-aop:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | +- (org.springframework:spring-tx:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | +- org.springframework:spring-beans:jar:4.3.7.RELEASE:compile
| | | \- (org.springframework:spring-core:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | +- (org.springframework:spring-core:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | +- org.slf4j:slf4j-api:jar:1.7.24:compile
| | \- (org.slf4j:jcl-over-slf4j:jar:1.7.24:compile - scope updated from runtime; omitted for duplicate)
| \- org.springframework:spring-aspects:jar:4.3.7.RELEASE:compile
| \- (org.aspectj:aspectjweaver:jar:1.8.9:compile - omitted for duplicate)
+- org.springframework.boot:spring-boot-starter-web:jar:1.5.2.RELEASE:compile
| +- (org.springframework.boot:spring-boot-starter:jar:1.5.2.RELEASE:compile - omitted for duplicate)
| +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.5.2.RELEASE:compile
| | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.11:compile
| | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.11:compile
| | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.11:compile
| | \- (org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.11:compile - omitted for duplicate)
| +- org.hibernate:hibernate-validator:jar:5.3.4.Final:compile
| | +- javax.validation:validation-api:jar:1.1.0.Final:compile
| | +- (org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile - omitted for duplicate)
| | \- com.fasterxml:classmate:jar:1.3.3:compile (version managed from 1.3.1)
| +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.7:compile
| | +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile - omitted for duplicate)
| | \- (com.fasterxml.jackson.core:jackson-core:jar:2.8.7:compile - omitted for duplicate)
| +- org.springframework:spring-web:jar:4.3.7.RELEASE:compile
| | +- (org.springframework:spring-aop:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | +- (org.springframework:spring-beans:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | +- (org.springframework:spring-context:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | \- (org.springframework:spring-core:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| \- org.springframework:spring-webmvc:jar:4.3.7.RELEASE:compile
| +- (org.springframework:spring-aop:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| +- (org.springframework:spring-beans:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| +- (org.springframework:spring-context:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| +- (org.springframework:spring-core:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| +- org.springframework:spring-expression:jar:4.3.7.RELEASE:compile
| | \- (org.springframework:spring-core:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| \- (org.springframework:spring-web:jar:4.3.7.RELEASE:compile - omitted for duplicate)
+- org.springframework.boot:spring-boot-starter-data-cassandra:jar:1.5.2.RELEASE:compile
| +- (org.springframework.boot:spring-boot-starter:jar:1.5.2.RELEASE:compile - omitted for duplicate)
| +- org.springframework:spring-tx:jar:4.3.7.RELEASE:compile
| | +- (org.springframework:spring-beans:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | \- (org.springframework:spring-core:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| \- org.springframework.data:spring-data-cassandra:jar:1.5.1.RELEASE:compile
| +- org.springframework.data:spring-cql:jar:1.5.1.RELEASE:compile
| | +- (org.springframework:spring-context:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | +- (org.springframework:spring-beans:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | +- (org.springframework:spring-core:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | +- (org.springframework:spring-expression:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | +- (org.springframework:spring-tx:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | +- (org.springframework.data:spring-data-commons:jar:1.13.1.RELEASE:compile - omitted for duplicate)
| | +- (com.datastax.cassandra:cassandra-driver-core:jar:3.1.4:compile - version managed from 3.1.3; omitted for duplicate)
| | +- (com.google.guava:guava:jar:19.0:compile - omitted for conflict with 16.0.1)
| | +- (org.slf4j:slf4j-api:jar:1.7.24:compile - version managed from 1.7.7; omitted for duplicate)
| | \- (org.slf4j:jcl-over-slf4j:jar:1.7.24:runtime - omitted for duplicate)
| +- (org.springframework:spring-expression:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| +- (org.springframework.data:spring-data-commons:jar:1.13.1.RELEASE:compile - omitted for duplicate)
| +- (com.datastax.cassandra:cassandra-driver-core:jar:3.1.4:compile - version managed from 3.1.3; omitted for duplicate)
| +- (org.slf4j:slf4j-api:jar:1.7.24:compile - version managed from 1.7.7; omitted for duplicate)
| \- (org.slf4j:jcl-over-slf4j:jar:1.7.24:compile - scope updated from runtime; omitted for duplicate)
+- org.springframework.boot:spring-boot-devtools:jar:1.5.2.RELEASE:compile
| +- org.springframework.boot:spring-boot:jar:1.5.2.RELEASE:compile
| | +- (org.springframework:spring-core:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| | \- (org.springframework:spring-context:jar:4.3.7.RELEASE:compile - omitted for duplicate)
| \- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.2.RELEASE:compile
| \- (org.springframework.boot:spring-boot:jar:1.5.2.RELEASE:compile - omitted for duplicate)
+- com.datastax.cassandra:cassandra-driver-mapping:jar:3.1.4:compile
| \- com.datastax.cassandra:cassandra-driver-core:jar:3.1.4:compile
| +- io.netty:netty-handler:jar:4.0.37.Final:compile
| | +- io.netty:netty-buffer:jar:4.0.37.Final:compile
| | | \- io.netty:netty-common:jar:4.0.37.Final:compile
| | +- io.netty:netty-transport:jar:4.0.37.Final:compile
| | | \- (io.netty:netty-buffer:jar:4.0.37.Final:compile - omitted for duplicate)
| | \- io.netty:netty-codec:jar:4.0.37.Final:compile
| | \- (io.netty:netty-transport:jar:4.0.37.Final:compile - omitted for duplicate)
| +- com.google.guava:guava:jar:16.0.1:compile
| +- io.dropwizard.metrics:metrics-core:jar:3.1.3:compile (version managed from 3.1.2)
| | \- (org.slf4j:slf4j-api:jar:1.7.24:compile - version managed from 1.7.7; omitted for duplicate)
| +- com.github.jnr:jnr-ffi:jar:2.0.7:compile
| | +- com.github.jnr:jffi:jar:1.2.10:compile
| | +- com.github.jnr:jffi:jar:native:1.2.10:runtime
| | +- org.ow2.asm:asm:jar:5.0.3:compile
| | +- org.ow2.asm:asm-commons:jar:5.0.3:compile
| | | \- (org.ow2.asm:asm-tree:jar:5.0.3:compile - omitted for duplicate)
| | +- org.ow2.asm:asm-analysis:jar:5.0.3:compile
| | | \- (org.ow2.asm:asm-tree:jar:5.0.3:compile - omitted for duplicate)
| | +- org.ow2.asm:asm-tree:jar:5.0.3:compile
| | | \- (org.ow2.asm:asm:jar:5.0.3:compile - omitted for duplicate)
| | +- org.ow2.asm:asm-util:jar:5.0.3:compile
| | | \- (org.ow2.asm:asm-tree:jar:5.0.3:compile - omitted for duplicate)
| | \- com.github.jnr:jnr-x86asm:jar:1.0.2:compile
| \- com.github.jnr:jnr-posix:jar:3.0.27:compile
| +- (com.github.jnr:jnr-ffi:jar:2.0.7:compile - omitted for duplicate)
| \- com.github.jnr:jnr-constants:jar:0.9.0:compile
+- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.8.7:compile
| +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
| +- com.fasterxml.jackson.core:jackson-core:jar:2.8.7:compile
| \- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.7:compile - omitted for duplicate)
+- com.oracle.jdbc:ojdbc7:jar:12.1.0.2:compile
| +- com.oracle.jdbc:xdb6:jar:12.1.0.2:compile
| +- com.oracle.jdbc:orai18n:jar:12.1.0.2:compile
| +- com.oracle.jdbc:xmlparserv2:jar:12.1.0.2:compile
| +- com.oracle.jdbc:oraclepki:jar:12.1.0.2:compile
| +- com.oracle.jdbc:osdt_cert:jar:12.1.0.2:compile
| \- com.oracle.jdbc:osdt_core:jar:12.1.0.2:compile
+- com.mycompany:Pandora-json:jar:2.1.0-SNAPSHOT:compile
| +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile - version managed from 2.5.4; omitted for duplicate)
| +- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.7:compile - version managed from 2.5.4; omitted for duplicate)
| +- com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.8.7:compile (version managed from 2.5.4)
| | +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile - version managed from 2.5.4; omitted for duplicate)
| | +- (com.fasterxml.jackson.core:jackson-core:jar:2.8.7:compile - omitted for duplicate)
| | +- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.7:compile - version managed from 2.5.4; omitted for duplicate)
| | \- (joda-time:joda-time:jar:2.9.7:compile - version managed from 2.7; omitted for duplicate)
| \- com.fasterxml.jackson.datatype:jackson-datatype-guava:jar:2.8.7:compile (version managed from 2.4.0)
| +- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.7:compile - version managed from 2.5.4; omitted for duplicate)
| +- (com.fasterxml.jackson.core:jackson-core:jar:2.8.7:compile - omitted for duplicate)
| \- (com.google.guava:guava:jar:16.0:compile - omitted for conflict with 16.0.1)
+- javax.inject:javax.inject:jar:1:compile
+- joda-time:joda-time:jar:2.9.7:compile
+- org.projectlombok:lombok:jar:1.16.14:compile
+- org.springframework.boot:spring-boot-starter-test:jar:1.5.2.RELEASE:test
| +- org.springframework.boot:spring-boot-test:jar:1.5.2.RELEASE:test
| | \- (org.springframework.boot:spring-boot:jar:1.5.2.RELEASE:test - omitted for duplicate)
| +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.5.2.RELEASE:test
| | +- (org.springframework.boot:spring-boot-test:jar:1.5.2.RELEASE:test - omitted for duplicate)
| | \- (org.springframework.boot:spring-boot-autoconfigure:jar:1.5.2.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 - omitted for duplicate)
| | \- (org.slf4j:slf4j-api:jar:1.7.24:test - version managed from 1.7.16; omitted for duplicate)
| +- junit:junit:jar:4.12:test
| | \- (org.hamcrest:hamcrest-core:jar:1.3:test - version managed from 1.1; omitted for duplicate)
| +- (org.assertj:assertj-core:jar:2.6.0:test - omitted for conflict with 3.6.2)
| +- org.mockito:mockito-core:jar:1.10.19:test
| | +- (org.hamcrest:hamcrest-core:jar:1.3:test - version managed from 1.1; omitted for duplicate)
| | \- 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 duplicate)
| +- 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.7.RELEASE:compile - scope updated from test; omitted for duplicate)
| \- org.springframework:spring-test:jar:4.3.7.RELEASE:test
| \- (org.springframework:spring-core:jar:4.3.7.RELEASE:test - omitted for duplicate)
+- commons-lang:commons-lang:jar:2.2:compile
+- org.assertj:assertj-core:jar:3.6.2:compile
+- org.mockito:mockito-all:jar:1.10.19:test
+- net.sourceforge.dynamicreports:dynamicreports-core:jar:4.1.1:compile
| +- net.sf.jasperreports:jasperreports:jar:6.2.2:compile
| | +- commons-beanutils:commons-beanutils:jar:1.9.3:compile (version managed from 1.9.0)
| | | \- (commons-collections:commons-collections:jar:3.2.2:compile - omitted for duplicate)
| | +- commons-collections:commons-collections:jar:3.2.2:compile
| | +- commons-digester:commons-digester:jar:2.1:compile
| | | \- (commons-beanutils:commons-beanutils:jar:1.9.3:compile - version managed from 1.8.3; omitted for duplicate)
| | +- commons-logging:commons-logging:jar:1.1.1:compile
| | +- com.lowagie:itext:jar:2.1.7.js5:compile
| | | \- bouncycastle:bcprov-jdk14:jar:138:compile
| | +- org.jfree:jcommon:jar:1.0.23:compile
| | +- org.jfree:jfreechart:jar:1.0.19:compile
| | | \- (org.jfree:jcommon:jar:1.0.23:compile - omitted for duplicate)
| | +- org.eclipse.jdt.core.compiler:ecj:jar:4.3.1:compile
| | +- (com.fasterxml.jackson.core:jackson-core:jar:2.8.7:compile - version managed from 2.1.4; omitted for duplicate)
| | +- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.7:compile - version managed from 2.1.4; omitted for duplicate)
| | +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile - version managed from 2.1.4; omitted for duplicate)
| | \- com.google.zxing:core:jar:2.3.0:compile
| +- org.apache.commons:commons-lang3:jar:3.1:compile
| +- net.sf.barcode4j:barcode4j:jar:2.0:compile
| | +- avalon-framework:avalon-framework-impl:jar:4.2.0:compile
| | \- xml-apis:xml-apis:jar:1.4.01:compile (version managed from 1.3.04)
| \- org.apache.xmlgraphics:batik-bridge:jar:1.8:compile
| +- org.apache.xmlgraphics:batik-anim:jar:1.8:compile
| | +- (org.apache.xmlgraphics:batik-awt-util:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-css:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-dom:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-ext:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-parser:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-svg-dom:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-util:jar:1.8:compile - omitted for duplicate)
| | +- (xml-apis:xml-apis:jar:1.4.01:compile - version managed from 1.3.04; omitted for duplicate)
| | \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate)
| +- org.apache.xmlgraphics:batik-awt-util:jar:1.8:compile
| | \- (org.apache.xmlgraphics:batik-util:jar:1.8:compile - omitted for duplicate)
| +- org.apache.xmlgraphics:batik-css:jar:1.8:compile
| | +- (org.apache.xmlgraphics:batik-ext:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-util:jar:1.8:compile - omitted for duplicate)
| | +- (xml-apis:xml-apis:jar:1.4.01:compile - version managed from 1.3.04; omitted for duplicate)
| | \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate)
| +- org.apache.xmlgraphics:batik-dom:jar:1.8:compile
| | +- (org.apache.xmlgraphics:batik-css:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-ext:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-util:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-xml:jar:1.8:compile - omitted for duplicate)
| | +- (xml-apis:xml-apis:jar:1.4.01:compile - version managed from 1.3.04; omitted for duplicate)
| | \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate)
| +- org.apache.xmlgraphics:batik-ext:jar:1.8:compile
| | \- (xml-apis:xml-apis:jar:1.4.01:compile - version managed from 1.3.04; omitted for duplicate)
| +- org.apache.xmlgraphics:batik-gvt:jar:1.8:compile
| | +- (org.apache.xmlgraphics:batik-awt-util:jar:1.8:compile - omitted for duplicate)
| | \- (org.apache.xmlgraphics:batik-util:jar:1.8:compile - omitted for duplicate)
| +- org.apache.xmlgraphics:batik-parser:jar:1.8:compile
| | +- (org.apache.xmlgraphics:batik-awt-util:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-util:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-xml:jar:1.8:compile - omitted for duplicate)
| | \- (xml-apis:xml-apis:jar:1.4.01:compile - version managed from 1.3.04; omitted for duplicate)
| +- org.apache.xmlgraphics:batik-script:jar:1.8:compile
| | +- (org.apache.xmlgraphics:batik-anim:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-util:jar:1.8:compile - omitted for duplicate)
| | \- (xml-apis:xml-apis:jar:1.4.01:compile - version managed from 1.3.04; omitted for duplicate)
| +- org.apache.xmlgraphics:batik-svg-dom:jar:1.8:compile
| | +- (org.apache.xmlgraphics:batik-awt-util:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-css:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-dom:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-ext:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-parser:jar:1.8:compile - omitted for duplicate)
| | +- (org.apache.xmlgraphics:batik-util:jar:1.8:compile - omitted for duplicate)
| | +- (xml-apis:xml-apis:jar:1.4.01:compile - version managed from 1.3.04; omitted for duplicate)
| | \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate)
| +- org.apache.xmlgraphics:batik-util:jar:1.8:compile
| +- org.apache.xmlgraphics:batik-xml:jar:1.8:compile
| | \- (org.apache.xmlgraphics:batik-util:jar:1.8:compile - omitted for duplicate)
| +- (xml-apis:xml-apis:jar:1.4.01:compile - version managed from 1.3.04; omitted for duplicate)
| \- xml-apis:xml-apis-ext:jar:1.3.04:compile
+- org.apache.poi:poi:jar:3.14:compile
| \- commons-codec:commons-codec:jar:1.10:compile
\- org.apache.poi:poi-ooxml:jar:3.14:compile
+- (org.apache.poi:poi:jar:3.14:compile - omitted for duplicate)
+- org.apache.poi:poi-ooxml-schemas:jar:3.14:compile
| \- org.apache.xmlbeans:xmlbeans:jar:2.6.0:compile
| \- stax:stax-api:jar:1.0.1:compile
\- com.github.virtuald:curvesapi:jar:1.03:compile
I finally managed to fix the issue. What was causing it was the fact that I was re-instantiating MappingCassandraConverter for each instance of CassandraIterable.
public class CassandraIterable<T> implements Iterable<T> {
private final Iterator<Row> iterator;
private final Class<T> entityType;
private final MappingCassandraConverter converter = new MappingCassandraConverter ();
...
}
while I should have created it once and passed it to the Iterable:
public class CassandraIterable<T> implements Iterable<T> {
private final Iterator<Row> iterator;
private final Class<T> entityType;
private final MappingCassandraConverter converter;
public CassandraIterable(Iterator<Row> iterator, Class<T> entityType, MappingCassandraConverter converter) {
this.iterator = iterator;
this.entityType = entityType;
this.converter = converter;
}
#Override
public Iterator<T> iterator() {
return
new Iterator<T>() {
#Override
public boolean hasNext() {
return
iterator.hasNext();
}
#Override
public T next() {
return
converter.readRow(entityType, iterator.next());
}
};
}
}
MappingCassandraConverter wasn't garbage collected (I presume that the Cassandra session was pointing to it) and the accessor to my class was probably pointed by the the converter.
The reason why I couldn't find the leak is that there wasn't a specific Type involved in the leak:
I was expecting to see one of my types repeated million of times in memory because of the leak instead. The reason why this wasn't happening is the fact that the issue in my code was creating a lot of accessors to Cassandra entities even though there was just one class type to be generated. For this reason the classes that were involved in the leak were something like:
and they were not at the top of the list that was grouped by type sorted by the total size.
Related
I am using Azure cosmos Java SDK version 4.10.0 in spring boot application to connect to Cosmos DB, but it throws "
"java.lang.NoSuchMethodError: reactor.util.retry.Retry.withThrowable(Ljava/util/function/Function;)Lreactor/util/retry/Retry;" error.
Code to connect
CosmosClient cosmosClient = new CosmosClientBuilder()
.endpoint(<endPoint>)
.key(<Key>)
.consistencyLevel(ConsistencyLevel.SESSION)
.connectionSharingAcrossClientsEnabled(true)
.contentResponseOnWriteEnabled(true)
.userAgentSuffix("my-application1-client")
.preferredRegions(Collections.singletonList("South Central US"))
.buildClient();
cosmosClient.getDatabase(<dbName>).read();
While running it throws the following error:
java.lang.NoSuchMethodError: reactor.util.retry.Retry.withThrowable(Ljava/util/function/Function;)Lreactor/util/retry/Retry;
at com.azure.cosmos.implementation.BackoffRetryUtility.executeRetry(BackoffRetryUtility.java:41) ~[azure-cosmos-4.10.0.jar:na]
at com.azure.cosmos.implementation.RxGatewayStoreModel.invokeAsync(RxGatewayStoreModel.java:380) ~[azure-cosmos-4.10.0.jar:na]
at com.azure.cosmos.implementation.RxGatewayStoreModel.processMessage(RxGatewayStoreModel.java:387) ~[azure-cosmos-4.10.0.jar:na]
at com.azure.cosmos.implementation.RxDocumentClientImpl.lambda$getDatabaseAccountFromEndpoint$137(RxDocumentClientImpl.java:3549) ~[azure-cosmos-4.10.0.jar:na]
at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:151) ~[reactor-core-3.3.4.RELEASE.jar:3.3.4.RELEASE]
at reactor.core.publisher.MonoFlatMap.subscribeOrReturn(MonoFlatMap.java:53) ~[reactor-core-3.3.4.RELEASE.jar:3.3.4.RELEASE]
at reactor.core.publisher.FluxFromMonoOperator.subscribe(FluxFromMonoOperator.java:66) ~[reactor-core-3.3.4.RELEASE.jar:3.3.4.RELEASE]
at reactor.core.publisher.FluxDefer.subscribe(FluxDefer.java:54) ~[reactor-core-3.3.4.RELEASE.jar:3.3.4.RELEASE]
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:55) ~[reactor-core-3.3.4.RELEASE.jar:3.3.4.RELEASE]
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:150) ~[reactor-core-3.3.4.RELEASE.jar:3.3.4.RELEASE]
at reactor.core.publisher.MonoDelay$MonoDelayRunnable.run(MonoDelay.java:117) ~[reactor-core-3.3.4.RELEASE.jar:3.3.4.RELEASE]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68) [reactor-core-3.3.4.RELEASE.jar:3.3.4.RELEASE]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) [reactor-core-3.3.4.RELEASE.jar:3.3.4.RELEASE]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_232]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[na:1.8.0_232]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[na:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_232]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_232]
Maven Dependency:
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-cosmos</artifactId>
<version>4.10.0</version>
</dependency>
Further analysis found that it needs an "io.projectreactor:reactor-core:jar" version of 3.3.11.RELEASE but maven is resolving it to use "io.projectreactor:reactor-core:jar:3.3.4.RELEASE"
io.projectreactor:reactor-core:jar:3.3.4.RELEASE:compile (version managed from 3.3.11.RELEASE)
Dependency Tree:
[INFO] com.example.sdktest:cosmos:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.2.6.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.2.6.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:2.2.6.RELEASE:compile
[INFO] | | | +- (org.springframework:spring-core:jar:5.2.5.RELEASE:compile - omitted for duplicate)
[INFO] | | | \- (org.springframework:spring-context:jar:5.2.5.RELEASE:compile - omitted for duplicate)
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.2.6.RELEASE:compile
[INFO] | | | \- (org.springframework.boot:spring-boot:jar:2.2.6.RELEASE:compile - omitted for duplicate)
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:2.2.6.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | | | | +- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] | | | | \- (org.slf4j:slf4j-api:jar:1.7.30:compile - version managed from 1.7.25; omitted for duplicate)
[INFO] | | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.12.1:compile
[INFO] | | | | +- (org.slf4j:slf4j-api:jar:1.7.30:compile - version managed from 1.7.25; omitted for duplicate)
[INFO] | | | | \- org.apache.logging.log4j:log4j-api:jar:2.12.1:compile
[INFO] | | | \- org.slf4j:jul-to-slf4j:jar:1.7.30:compile
[INFO] | | | \- (org.slf4j:slf4j-api:jar:1.7.30:compile - version managed from 1.7.25; omitted for duplicate)
[INFO] | | +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] | | +- org.springframework:spring-core:jar:5.2.5.RELEASE:compile
[INFO] | | | \- org.springframework:spring-jcl:jar:5.2.5.RELEASE:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.25:runtime
[INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:2.2.6.RELEASE:compile
[INFO] | | +- (org.springframework.boot:spring-boot-starter:jar:2.2.6.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-web:jar:5.2.5.RELEASE:compile - omitted for duplicate)
[INFO] | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.10.3:compile
[INFO] | | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.10.3:compile
[INFO] | | | \- (com.fasterxml.jackson.core:jackson-core:jar:2.10.3:compile - omitted for duplicate)
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.10.3:compile
[INFO] | | | +- (com.fasterxml.jackson.core:jackson-core:jar:2.10.3:compile - omitted for duplicate)
[INFO] | | | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.10.3:compile - omitted for duplicate)
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.10.3:compile
[INFO] | | | +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.10.3:compile - omitted for duplicate)
[INFO] | | | +- (com.fasterxml.jackson.core:jackson-core:jar:2.10.3:compile - omitted for duplicate)
[INFO] | | | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.10.3:compile - omitted for duplicate)
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.10.3:compile
[INFO] | | +- (com.fasterxml.jackson.core:jackson-core:jar:2.10.3:compile - omitted for duplicate)
[INFO] | | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.10.3:compile - omitted for duplicate)
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.2.6.RELEASE:compile
[INFO] | | +- (jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile - omitted for duplicate)
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.33:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.33:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.33:compile
[INFO] | | \- (org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.33:compile - omitted for duplicate)
[INFO] | +- org.springframework.boot:spring-boot-starter-validation:jar:2.2.6.RELEASE:compile
[INFO] | | +- (org.springframework.boot:spring-boot-starter:jar:2.2.6.RELEASE:compile - omitted for duplicate)
[INFO] | | +- jakarta.validation:jakarta.validation-api:jar:2.0.2:compile
[INFO] | | \- org.hibernate.validator:hibernate-validator:jar:6.0.18.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.4.1.Final:compile (version managed from 3.3.2.Final)
[INFO] | | \- com.fasterxml:classmate:jar:1.5.1:compile (version managed from 1.3.4)
[INFO] | +- org.springframework:spring-web:jar:5.2.5.RELEASE:compile
[INFO] | | +- org.springframework:spring-beans:jar:5.2.5.RELEASE:compile
[INFO] | | | \- (org.springframework:spring-core:jar:5.2.5.RELEASE:compile - omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:5.2.5.RELEASE:compile - omitted for duplicate)
[INFO] | \- org.springframework:spring-webmvc:jar:5.2.5.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:5.2.5.RELEASE:compile
[INFO] | | +- (org.springframework:spring-beans:jar:5.2.5.RELEASE:compile - omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:5.2.5.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-beans:jar:5.2.5.RELEASE:compile - omitted for duplicate)
[INFO] | +- org.springframework:spring-context:jar:5.2.5.RELEASE:compile
[INFO] | | +- (org.springframework:spring-aop:jar:5.2.5.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-beans:jar:5.2.5.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-core:jar:5.2.5.RELEASE:compile - omitted for duplicate)
[INFO] | | \- (org.springframework:spring-expression:jar:5.2.5.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:5.2.5.RELEASE:compile - omitted for duplicate)
[INFO] | +- org.springframework:spring-expression:jar:5.2.5.RELEASE:compile
[INFO] | | \- (org.springframework:spring-core:jar:5.2.5.RELEASE:compile - omitted for duplicate)
[INFO] | \- (org.springframework:spring-web:jar:5.2.5.RELEASE:compile - omitted for duplicate)
[INFO] +- com.azure:azure-cosmos:jar:4.10.0:compile
[INFO] | +- com.azure:azure-core:jar:1.11.0:compile
[INFO] | | +- (com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.10.3:compile - version managed from 2.11.3; omitted for duplicate)
[INFO] | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.10.3:compile (version managed from 2.11.3)
[INFO] | | | +- (com.fasterxml.jackson.core:jackson-core:jar:2.10.3:compile - omitted for duplicate)
[INFO] | | | +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.10.3:compile - omitted for duplicate)
[INFO] | | | +- (com.fasterxml.jackson.core:jackson-databind:jar:2.10.3:compile - omitted for duplicate)
[INFO] | | | +- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.10.3:compile
[INFO] | | | | +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.10.3:compile - omitted for duplicate)
[INFO] | | | | +- (com.fasterxml.jackson.core:jackson-core:jar:2.10.3:compile - omitted for duplicate)
[INFO] | | | | +- (com.fasterxml.jackson.core:jackson-databind:jar:2.10.3:compile - omitted for duplicate)
[INFO] | | | | +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile (version managed from 2.3.2)
[INFO] | | | | | \- (jakarta.activation:jakarta.activation-api:jar:1.2.2:compile - version managed from 1.2.1; omitted for duplicate)
[INFO] | | | | \- jakarta.activation:jakarta.activation-api:jar:1.2.2:compile
[INFO] | | | +- org.codehaus.woodstox:stax2-api:jar:4.2:compile
[INFO] | | | \- com.fasterxml.woodstox:woodstox-core:jar:6.1.1:compile
[INFO] | | | \- (org.codehaus.woodstox:stax2-api:jar:4.2:compile - omitted for duplicate)
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.30:compile - version managed from 1.7.25; omitted for duplicate)
[INFO] | | +- io.projectreactor:reactor-core:jar:3.3.4.RELEASE:compile (version managed from 3.3.11.RELEASE)
[INFO] | | | \- org.reactivestreams:reactive-streams:jar:1.0.3:compile
[INFO] | | \- io.netty:netty-tcnative-boringssl-static:jar:2.0.30.Final:compile (version managed from 2.0.34.Final)
[INFO] | +- com.azure:azure-core-http-netty:jar:1.7.0:compile
[INFO] | | +- io.netty:netty-handler:jar:4.1.48.Final:compile (version managed from 4.1.53.Final)
[INFO] | | | +- io.netty:netty-common:jar:4.1.48.Final:compile
[INFO] | | | +- io.netty:netty-resolver:jar:4.1.48.Final:compile
[INFO] | | | | \- (io.netty:netty-common:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | +- (io.netty:netty-buffer:jar:4.1.48.Final:compile - version managed from 4.1.53.Final; omitted for duplicate)
[INFO] | | | +- io.netty:netty-transport:jar:4.1.48.Final:compile
[INFO] | | | | +- (io.netty:netty-common:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | | +- (io.netty:netty-buffer:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | | \- (io.netty:netty-resolver:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | \- io.netty:netty-codec:jar:4.1.48.Final:compile
[INFO] | | | +- (io.netty:netty-common:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | +- (io.netty:netty-buffer:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | \- (io.netty:netty-transport:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | +- io.netty:netty-handler-proxy:jar:4.1.48.Final:compile (version managed from 4.1.53.Final)
[INFO] | | | +- (io.netty:netty-common:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | +- (io.netty:netty-buffer:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | +- (io.netty:netty-transport:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | +- (io.netty:netty-codec:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | +- io.netty:netty-codec-socks:jar:4.1.48.Final:compile
[INFO] | | | | +- (io.netty:netty-common:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | | +- (io.netty:netty-buffer:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | | +- (io.netty:netty-transport:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | | \- (io.netty:netty-codec:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | \- (io.netty:netty-codec-http:jar:4.1.48.Final:compile - version managed from 4.1.53.Final; omitted for duplicate)
[INFO] | | +- io.netty:netty-buffer:jar:4.1.48.Final:compile
[INFO] | | | \- (io.netty:netty-common:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | +- io.netty:netty-codec-http:jar:4.1.48.Final:compile
[INFO] | | | +- (io.netty:netty-common:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | +- (io.netty:netty-buffer:jar:4.1.48.Final:compile - version managed from 4.1.53.Final; omitted for duplicate)
[INFO] | | | +- (io.netty:netty-transport:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | +- (io.netty:netty-codec:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | \- (io.netty:netty-handler:jar:4.1.48.Final:compile - version managed from 4.1.53.Final; omitted for duplicate)
[INFO] | | +- io.netty:netty-codec-http2:jar:4.1.48.Final:compile (version managed from 4.1.53.Final)
[INFO] | | | +- (io.netty:netty-common:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | +- (io.netty:netty-buffer:jar:4.1.48.Final:compile - version managed from 4.1.53.Final; omitted for duplicate)
[INFO] | | | +- (io.netty:netty-transport:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | +- (io.netty:netty-codec:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | +- (io.netty:netty-handler:jar:4.1.48.Final:compile - version managed from 4.1.53.Final; omitted for duplicate)
[INFO] | | | \- (io.netty:netty-codec-http:jar:4.1.48.Final:compile - version managed from 4.1.53.Final; omitted for duplicate)
[INFO] | | +- io.netty:netty-transport-native-unix-common:jar:4.1.48.Final:compile (version managed from 4.1.53.Final)
[INFO] | | | +- (io.netty:netty-common:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | +- (io.netty:netty-buffer:jar:4.1.48.Final:compile - version managed from 4.1.53.Final; omitted for duplicate)
[INFO] | | | \- (io.netty:netty-transport:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.48.Final:compile (version managed from 4.1.53.Final)
[INFO] | | | +- (io.netty:netty-common:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | +- (io.netty:netty-buffer:jar:4.1.48.Final:compile - version managed from 4.1.53.Final; omitted for duplicate)
[INFO] | | | +- (io.netty:netty-transport:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | \- (io.netty:netty-transport-native-unix-common:jar:4.1.48.Final:compile - version managed from 4.1.53.Final; omitted for duplicate)
[INFO] | | +- io.netty:netty-transport-native-kqueue:jar:osx-x86_64:4.1.48.Final:compile (version managed from 4.1.53.Final)
[INFO] | | | +- (io.netty:netty-common:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | +- (io.netty:netty-buffer:jar:4.1.48.Final:compile - version managed from 4.1.53.Final; omitted for duplicate)
[INFO] | | | +- (io.netty:netty-transport:jar:4.1.48.Final:compile - omitted for duplicate)
[INFO] | | | \- (io.netty:netty-transport-native-unix-common:jar:4.1.48.Final:compile - version managed from 4.1.53.Final; omitted for duplicate)
[INFO] | | \- io.projectreactor.netty:reactor-netty:jar:0.9.6.RELEASE:compile (version managed from 0.9.13.RELEASE)
[INFO] | | +- (io.netty:netty-codec-http:jar:4.1.48.Final:compile - version managed from 4.1.53.Final; omitted for duplicate)
[INFO] | | +- (io.netty:netty-codec-http2:jar:4.1.48.Final:compile - version managed from 4.1.53.Final; omitted for duplicate)
[INFO] | | +- (io.netty:netty-handler:jar:4.1.48.Final:compile - version managed from 4.1.53.Final; omitted for duplicate)
[INFO] | | +- (io.netty:netty-handler-proxy:jar:4.1.48.Final:compile - version managed from 4.1.53.Final; omitted for duplicate)
[INFO] | | +- (io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.48.Final:compile - version managed from 4.1.53.Final; omitted for duplicate)
[INFO] | | \- (io.projectreactor:reactor-core:jar:3.3.4.RELEASE:compile - version managed from 3.3.11.RELEASE; omitted for duplicate)
[INFO] | +- com.fasterxml.jackson.module:jackson-module-afterburner:jar:2.10.3:compile (version managed from 2.11.2)
[INFO] | | +- com.fasterxml.jackson.core:jackson-core:jar:2.10.3:compile
[INFO] | | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.10.3:compile - omitted for duplicate)
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.30:compile
[INFO] | +- org.hdrhistogram:HdrHistogram:jar:2.1.12:compile
[INFO] | +- io.dropwizard.metrics:metrics-core:jar:4.1.5:compile (version managed from 4.1.0)
[INFO] | | \- (org.slf4j:slf4j-api:jar:1.7.30:compile - version managed from 1.7.25; omitted for duplicate)
[INFO] | \- io.micrometer:micrometer-core:jar:1.3.6:compile (version managed from 1.5.6)
[INFO] | +- (org.hdrhistogram:HdrHistogram:jar:2.1.11:compile - omitted for conflict with 2.1.12)
[INFO] | \- org.latencyutils:LatencyUtils:jar:2.0.3:compile
[INFO] \- org.springframework.boot:spring-boot-starter-test:jar:2.2.6.RELEASE:test
[INFO] +- (org.springframework.boot:spring-boot-starter:jar:2.2.6.RELEASE:test - omitted for duplicate)
[INFO] +- org.springframework.boot:spring-boot-test:jar:2.2.6.RELEASE:test
[INFO] | \- (org.springframework.boot:spring-boot:jar:2.2.6.RELEASE:test - omitted for duplicate)
[INFO] +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.2.6.RELEASE:test
[INFO] | +- (org.springframework.boot:spring-boot-test:jar:2.2.6.RELEASE:test - omitted for duplicate)
[INFO] | \- (org.springframework.boot:spring-boot-autoconfigure:jar:2.2.6.RELEASE:test - omitted for duplicate)
[INFO] +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] | +- net.minidev:json-smart:jar:2.3:test
[INFO] | | \- net.minidev:accessors-smart:jar:1.2:test
[INFO] | | \- org.ow2.asm:asm:jar:5.0.4:test
[INFO] | \- (org.slf4j:slf4j-api:jar:1.7.30:test - version managed from 1.7.25; omitted for duplicate)
[INFO] +- (jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile - version managed from 2.3.2; scope updated from test; omitted for duplicate)
[INFO] +- org.junit.jupiter:junit-jupiter:jar:5.5.2:test
[INFO] | +- org.junit.jupiter:junit-jupiter-api:jar:5.5.2:test
[INFO] | | +- (org.apiguardian:apiguardian-api:jar:1.1.0:test - omitted for duplicate)
[INFO] | | +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] | | \- org.junit.platform:junit-platform-commons:jar:1.5.2:test
[INFO] | | \- (org.apiguardian:apiguardian-api:jar:1.1.0:test - omitted for duplicate)
[INFO] | +- org.junit.jupiter:junit-jupiter-params:jar:5.5.2:test
[INFO] | | +- (org.apiguardian:apiguardian-api:jar:1.1.0:test - omitted for duplicate)
[INFO] | | \- (org.junit.jupiter:junit-jupiter-api:jar:5.5.2:test - omitted for duplicate)
[INFO] | \- org.junit.jupiter:junit-jupiter-engine:jar:5.5.2:test
[INFO] | +- (org.apiguardian:apiguardian-api:jar:1.1.0:test - omitted for duplicate)
[INFO] | +- (org.junit.platform:junit-platform-engine:jar:1.5.2:test - omitted for duplicate)
[INFO] | \- (org.junit.jupiter:junit-jupiter-api:jar:5.5.2:test - omitted for duplicate)
[INFO] +- org.junit.vintage:junit-vintage-engine:jar:5.5.2:test
[INFO] | +- org.apiguardian:apiguardian-api:jar:1.1.0:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.5.2:test
[INFO] | | +- (org.apiguardian:apiguardian-api:jar:1.1.0:test - omitted for duplicate)
[INFO] | | +- (org.opentest4j:opentest4j:jar:1.2.0:test - omitted for duplicate)
[INFO] | | \- (org.junit.platform:junit-platform-commons:jar:1.5.2:test - omitted for duplicate)
[INFO] | \- junit:junit:jar:4.12:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:3.1.0:test
[INFO] | +- (org.mockito:mockito-core:jar:3.1.0:test - omitted for duplicate)
[INFO] | \- (org.junit.jupiter:junit-jupiter-api:jar:5.5.2:test - version managed from 5.4.2; omitted for duplicate)
[INFO] +- org.assertj:assertj-core:jar:3.13.2:test
[INFO] +- org.hamcrest:hamcrest:jar:2.1:test
[INFO] +- org.mockito:mockito-core:jar:3.1.0:test
[INFO] | +- net.bytebuddy:byte-buddy:jar:1.10.8:test (version managed from 1.9.10)
[INFO] | +- net.bytebuddy:byte-buddy-agent:jar:1.10.8:test (version managed from 1.9.10)
[INFO] | \- org.objenesis:objenesis:jar:2.6:test
[INFO] +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] +- (org.springframework:spring-core:jar:5.2.5.RELEASE:compile - scope updated from test; omitted for duplicate)
[INFO] +- org.springframework:spring-test:jar:5.2.5.RELEASE:test
[INFO] | \- (org.springframework:spring-core:jar:5.2.5.RELEASE:test - omitted for duplicate)
[INFO] \- org.xmlunit:xmlunit-core:jar:2.6.4:test
How do I resolve this?
The problem is the .read() function you are calling.
If you want a reference to a database object look at this sample below.
database = client.getDatabase(databaseName);
For more Java SDK samples look here Azure Cosmos DB Java SQL API Samples
In my Spring Boot 2.0.0.M6 application, I have installed LiquiGraph by using the following Maven dependencies:
dependency>
<groupId>org.liquigraph</groupId>
<artifactId>liquigraph-spring-boot-starter</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-jdbc-bolt</artifactId>
<version>3.1.0</version>
</dependency>
I also use Spring Data Neo4j 5 and this is my Neo4j config:
#Configuration
#EnableNeo4jRepositories(basePackages = "com.example.domain.repository.neo4j")
#EnableTransactionManagement
public class Neo4jConfig {
#Value("${neo4j.bolt.server.database.uri}")
private String boltServerDatabaseUri;
#Value("${neo4j.jdbc.server.database.uri}")
private String jdbcServerDatabaseUri;
#Value("${neo4j.username}")
private String username;
#Value("${neo4j.password}")
private String password;
#Bean
public Neo4jTransactionManager transactionManager() {
return new Neo4jTransactionManager(sessionFactory());
}
#Bean
public SessionFactory sessionFactory() {
return new SessionFactory(configuration(), "com.example.domain.model.neo4j");
}
#Bean
#DependsOn("liquigraph")
public org.neo4j.ogm.config.Configuration configuration() {
// #formatter:off
return new org.neo4j.ogm.config.Configuration.Builder()
.autoIndex("validate")
.credentials(username, password)
.uri(boltServerDatabaseUri)
.build();
// #formatter:on
}
#Bean
public DataSource dataSource() {
final HikariConfig config = new HikariConfig();
config.setJdbcUrl(jdbcServerDatabaseUri);
config.setUsername(username);
config.setPassword(password);
return new HikariDataSource(config);
}
}
Right now my Spring Boot Actuator health endpoint responds with the 503 Status code and the following error inside JSON:
org.springframework.jdbc.UncategorizedSQLException
{
"status": "DOWN",
"details": {
"elasticsearch": {
"status": "UP",
"details": {
"clusterName": "elasticsearch",
"numberOfNodes": 1,
"numberOfDataNodes": 1,
"activePrimaryShards": 15,
"activeShards": 15,
"relocatingShards": 0,
"initializingShards": 0,
"unassignedShards": 15
}
},
"diskSpace": {
"status": "UP",
"details": {
"total": 120031539200,
"free": 78051127296,
"threshold": 10485760
}
},
"mongo": {
"status": "UP",
"details": {
"version": "3.4.6"
}
},
"db": {
"status": "DOWN",
"details": {
"database": "Neo4j",
"error": "org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [SELECT 1]; SQL state [null]; error code [0]; Some errors occurred : \n[Neo.ClientError.Statement.SyntaxError]:Invalid input 'L': expected 't/T' (line 1, column 3 (offset: 2))\n\"SELECT 1\"\n ^\n; nested exception is java.sql.SQLException: Some errors occurred : \n[Neo.ClientError.Statement.SyntaxError]:Invalid input 'L': expected 't/T' (line 1, column 3 (offset: 2))\n\"SELECT 1\"\n ^\n"
}
},
"neo4j": {
"status": "UP",
"details": {
"nodes": 194
}
}
}
}
What may be a reason for this and how to fix it?
UPDATED
This is my project Maven dependencies tree:
com.example:api:war:0.0.1
+- com.example:domain:jar:0.0.1:compile
| +- org.neo4j:neo4j-ogm-bolt-driver:jar:3.0.1:compile
| | +- org.neo4j:neo4j-ogm-api:jar:3.0.1:compile
| | \- org.neo4j.driver:neo4j-java-driver:jar:1.4.4:compile
| +- org.springframework.social:spring-social-security:jar:2.0.0.M4:compile
| | \- org.springframework.security:spring-security-web:jar:5.0.0.RC1:compile
| +- org.springframework.security.oauth:spring-security-oauth2:jar:2.2.0.RELEASE:compile
| | +- org.springframework.security:spring-security-core:jar:5.0.0.RC1:compile
| | +- org.springframework.security:spring-security-config:jar:5.0.0.RC1:compile
| | \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
| | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
| +- org.springframework:spring-context-support:jar:5.0.1.RELEASE:compile
| +- org.springframework.boot:spring-boot-starter-data-neo4j:jar:2.0.0.M6:compile
| | \- org.springframework.data:spring-data-neo4j:jar:5.0.1.RELEASE:compile
| | +- org.springframework.data:spring-data-commons:jar:2.0.1.RELEASE:compile
| | \- org.neo4j:neo4j-ogm-core:jar:3.0.1:compile
| | \- io.github.lukehutch:fast-classpath-scanner:jar:2.7.4:compile
| +- org.liquigraph:liquigraph-spring-boot-starter:jar:3.0.2:compile
| | \- org.liquigraph:liquigraph-core:jar:3.0.2:compile
| | \- org.neo4j:neo4j-jdbc-driver:jar:3.1.0:compile
| +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.0.0.M6:compile
| | +- com.zaxxer:HikariCP:jar:2.7.2:compile
| | \- org.springframework:spring-jdbc:jar:5.0.1.RELEASE:compile
| +- org.neo4j:neo4j-jdbc-bolt:jar:3.1.0:compile
| | \- org.neo4j:neo4j-jdbc:jar:3.1.0:compile
| +- org.springframework.boot:spring-boot-starter-data-mongodb:jar:2.0.0.M6:compile
| | +- org.mongodb:mongodb-driver:jar:3.5.0:compile
| | | +- org.mongodb:bson:jar:3.5.0:compile
| | | \- org.mongodb:mongodb-driver-core:jar:3.5.0:compile
| | \- org.springframework.data:spring-data-mongodb:jar:2.0.1.RELEASE:compile
| +- org.springframework.boot:spring-boot-starter-data-elasticsearch:jar:2.0.0.M6:compile
| | \- org.springframework.data:spring-data-elasticsearch:jar:3.0.1.RELEASE:compile
| | +- commons-lang:commons-lang:jar:2.6:compile
| | +- joda-time:joda-time:jar:2.9.9:compile
| | +- org.elasticsearch:elasticsearch:jar:5.5.3:compile
| | | +- org.apache.lucene:lucene-core:jar:6.6.0:compile
| | | +- org.apache.lucene:lucene-analyzers-common:jar:6.6.0:compile
| | | +- org.apache.lucene:lucene-backward-codecs:jar:6.6.0:compile
| | | +- org.apache.lucene:lucene-grouping:jar:6.6.0:compile
| | | +- org.apache.lucene:lucene-highlighter:jar:6.6.0:compile
| | | +- org.apache.lucene:lucene-join:jar:6.6.0:compile
| | | +- org.apache.lucene:lucene-memory:jar:6.6.0:compile
| | | +- org.apache.lucene:lucene-misc:jar:6.6.0:compile
| | | +- org.apache.lucene:lucene-queries:jar:6.6.0:compile
| | | +- org.apache.lucene:lucene-queryparser:jar:6.6.0:compile
| | | +- org.apache.lucene:lucene-sandbox:jar:6.6.0:compile
| | | +- org.apache.lucene:lucene-spatial:jar:6.6.0:compile
| | | +- org.apache.lucene:lucene-spatial-extras:jar:6.6.0:compile
| | | +- org.apache.lucene:lucene-spatial3d:jar:6.6.0:compile
| | | +- org.apache.lucene:lucene-suggest:jar:6.6.0:compile
| | | +- org.elasticsearch:securesm:jar:1.1:compile
| | | +- net.sf.jopt-simple:jopt-simple:jar:5.0.2:compile
| | | +- com.carrotsearch:hppc:jar:0.7.1:compile
| | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.9.2:compile
| | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.9.2:compile
| | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.9.2:compile
| | | +- com.tdunning:t-digest:jar:3.0:compile
| | | \- org.elasticsearch:jna:jar:4.4.0:compile
| | +- org.elasticsearch.client:transport:jar:5.5.3:compile
| | | +- org.elasticsearch.plugin:transport-netty3-client:jar:5.5.3:compile
| | | | \- io.netty:netty:jar:3.10.6.Final:compile
| | | +- org.elasticsearch.plugin:reindex-client:jar:5.5.3:compile
| | | | \- org.elasticsearch.client:rest:jar:5.5.3:compile
| | | | +- org.apache.httpcomponents:httpasyncclient:jar:4.1.3:compile
| | | | \- org.apache.httpcomponents:httpcore-nio:jar:4.4.8:compile
| | | +- org.elasticsearch.plugin:lang-mustache-client:jar:5.5.3:compile
| | | | \- com.github.spullara.mustache.java:compiler:jar:0.9.3:compile
| | | +- org.elasticsearch.plugin:percolator-client:jar:5.5.3:compile
| | | \- org.elasticsearch.plugin:parent-join-client:jar:5.5.3:compile
| | \- org.elasticsearch.plugin:transport-netty4-client:jar:5.5.3:compile
| | +- io.netty:netty-buffer:jar:4.1.16.Final:compile
| | +- io.netty:netty-codec:jar:4.1.16.Final:compile
| | +- io.netty:netty-codec-http:jar:4.1.16.Final:compile
| | +- io.netty:netty-common:jar:4.1.16.Final:compile
| | +- io.netty:netty-handler:jar:4.1.16.Final:compile
| | +- io.netty:netty-resolver:jar:4.1.16.Final:compile
| | \- io.netty:netty-transport:jar:4.1.16.Final:compile
| +- org.springframework.boot:spring-boot-starter-security:jar:2.0.0.M6:compile
| +- org.springframework.boot:spring-boot-starter-validation:jar:2.0.0.M6:compile
| +- org.springframework.boot:spring-boot-starter-social-twitter:jar:2.0.0.M6:compile
| | \- org.springframework.social:spring-social-twitter:jar:2.0.0.M4:compile
| | \- org.springframework.security:spring-security-crypto:jar:5.0.0.RC1:compile
| +- org.springframework.kafka:spring-kafka:jar:2.0.0.RELEASE:compile
| | +- org.springframework:spring-messaging:jar:5.0.1.RELEASE:compile
| | +- org.springframework.retry:spring-retry:jar:1.2.1.RELEASE:compile
| | \- org.apache.kafka:kafka-clients:jar:0.11.0.0:compile
| | +- net.jpountz.lz4:lz4:jar:1.3.0:compile
| | \- org.xerial.snappy:snappy-java:jar:1.1.2.6:compile
| +- com.google.guava:guava:jar:19.0-rc1:compile
| +- com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:jar:20160924.1:compile
| +- eu.bitwalker:UserAgentUtils:jar:1.20:compile
| +- org.quartz-scheduler:quartz:jar:2.3.0:compile
| | +- com.mchange:c3p0:jar:0.9.5.2:compile
| | +- com.mchange:mchange-commons-java:jar:0.2.11:compile
| | \- com.zaxxer:HikariCP-java6:jar:2.3.13:compile
| \- com.novemberain:quartz-mongodb:jar:2.0.0:compile
| +- org.mongodb:mongo-java-driver:jar:3.5.0:runtime
| \- org.clojure:clojure:jar:1.7.0:runtime
+- com.example:coinmarketcap:jar:0.0.1:compile
+- org.springframework.boot:spring-boot-starter-web:jar:2.0.0.M6:compile
| +- org.springframework.boot:spring-boot-starter-json:jar:2.0.0.M6:compile
| | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.2:compile
| | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.2:compile
| | +- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.2:compile
| | \- com.fasterxml.jackson.module:jackson-module-kotlin:jar:2.9.2:compile
| +- org.hibernate.validator:hibernate-validator:jar:6.0.4.Final:compile
| | +- javax.validation:validation-api:jar:2.0.0.Final:compile
| | \- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
| +- org.springframework:spring-web:jar:5.0.1.RELEASE:compile
| \- org.springframework:spring-webmvc:jar:5.0.1.RELEASE:compile
+- org.springframework.boot:spring-boot-starter-thymeleaf:jar:2.0.0.M6:compile
| +- org.thymeleaf:thymeleaf-spring5:jar:3.0.8.RELEASE:compile
| | \- org.thymeleaf:thymeleaf:jar:3.0.8.RELEASE:compile
| | +- org.attoparser:attoparser:jar:2.0.4.RELEASE:compile
| | \- org.unbescape:unbescape:jar:1.1.5.RELEASE:compile
| \- org.thymeleaf.extras:thymeleaf-extras-java8time:jar:3.0.1.RELEASE:compile
+- org.springframework.boot:spring-boot-starter-tomcat:jar:2.0.0.M6: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
| \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.23:compile
+- org.springframework.boot:spring-boot-starter-actuator:jar:2.0.0.M6:compile
| +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.0.0.M6:compile
| | \- org.springframework.boot:spring-boot-actuator:jar:2.0.0.M6:compile
| \- io.micrometer:micrometer-core:jar:1.0.0-rc.3:compile
| +- org.hdrhistogram:HdrHistogram:jar:2.1.10:compile
| \- org.latencyutils:LatencyUtils:jar:2.0.3:compile
+- org.springframework.boot:spring-boot-starter-social-facebook:jar:2.0.0.M6:compile
| +- org.springframework.social:spring-social-config:jar:2.0.0.M4:compile
| +- org.springframework.social:spring-social-core:jar:2.0.0.M4:compile
| +- org.springframework.social:spring-social-web:jar:2.0.0.M4:compile
| \- org.springframework.social:spring-social-facebook:jar:3.0.0.M3:compile
+- org.springframework.boot:spring-boot-starter-social-linkedin:jar:2.0.0.M6:compile
| \- org.springframework.social:spring-social-linkedin:jar:2.0.0.M3:compile
+- org.springframework.security:spring-security-jwt:jar:1.0.8.RELEASE:compile
| \- org.bouncycastle:bcpkix-jdk15on:jar:1.56:compile
| \- org.bouncycastle:bcprov-jdk15on:jar:1.56:compile
+- org.springframework.social:spring-social-google:jar:1.0.0.RELEASE:compile
+- org.springframework.social:spring-social-github:jar:1.0.0.M4:compile
+- com.jayway.jsonpath:json-path:jar:2.4.0:test
| +- net.minidev:json-smart:jar:2.3:test
| | \- net.minidev:accessors-smart:jar:1.2:test
| | \- org.ow2.asm:asm:jar:5.0.4:test
| \- org.slf4j:slf4j-api:jar:1.7.25:compile
+- com.jayway.jsonpath:json-path-assert:jar:2.4.0:test
| +- org.hamcrest:hamcrest-core:jar:1.3:test
| \- org.hamcrest:hamcrest-library:jar:1.3:test
+- javax.servlet:javax.servlet-api:jar:3.1.0:provided
+- javax:javaee-web-api:jar:7.0:provided
+- org.apache.httpcomponents:httpclient:jar:4.5.3:compile
| +- org.apache.httpcomponents:httpcore:jar:4.4.8:compile
| \- commons-codec:commons-codec:jar:1.11:compile
+- io.springfox:springfox-swagger2:jar:2.6.0:compile
| +- io.swagger:swagger-annotations:jar:1.5.10:compile
| +- io.swagger:swagger-models:jar:1.5.10:compile
| +- io.springfox:springfox-spi:jar:2.6.0:compile
| | \- io.springfox:springfox-core:jar:2.6.0:compile
| +- io.springfox:springfox-schema:jar:2.6.0:compile
| +- io.springfox:springfox-swagger-common:jar:2.6.0:compile
| +- io.springfox:springfox-spring-web:jar:2.6.0:compile
| +- com.fasterxml:classmate:jar:1.3.4:compile
| +- org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile
| +- org.springframework.plugin:spring-plugin-metadata:jar:1.2.0.RELEASE:compile
| \- org.mapstruct:mapstruct:jar:1.0.0.Final:compile
+- io.springfox:springfox-swagger-ui:jar:2.6.0:compile
+- com.github.dfabulich:sitemapgen4j:jar:1.0.6:compile
+- com.jayway.restassured:rest-assured:jar:2.9.0:test
| +- org.codehaus.groovy:groovy:jar:2.5.0-beta-1:test
| +- org.codehaus.groovy:groovy-xml:jar:2.5.0-beta-1:test
| +- org.apache.httpcomponents:httpmime:jar:4.5.3:test
| +- org.ccil.cowan.tagsoup:tagsoup:jar:1.2.1:test
| +- com.jayway.restassured:json-path:jar:2.9.0:test
| | +- org.codehaus.groovy:groovy-json:jar:2.5.0-beta-1:test
| | \- com.jayway.restassured:rest-assured-common:jar:2.9.0:test
| \- com.jayway.restassured:xml-path:jar:2.9.0:test
+- com.google.code.gson:gson:jar:2.8.2:compile
+- javax.xml.bind:jaxb-api:jar:2.2.12:compile
+- com.fasterxml.jackson.core:jackson-core:jar:2.9.2:compile
+- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
+- com.fasterxml.jackson.core:jackson-databind:jar:2.9.2:compile
+- org.springframework:spring-core:jar:5.0.1.RELEASE:compile
| \- org.springframework:spring-jcl:jar:5.0.1.RELEASE:compile
+- org.springframework:spring-beans:jar:5.0.1.RELEASE:compile
+- org.springframework:spring-aop:jar:5.0.1.RELEASE:compile
+- org.springframework:spring-aspects:jar:5.0.1.RELEASE:compile
| \- org.aspectj:aspectjweaver:jar:1.8.12:compile
+- org.springframework:spring-context:jar:5.0.1.RELEASE:compile
+- org.springframework:spring-expression:jar:5.0.1.RELEASE:compile
+- org.springframework:spring-tx:jar:5.0.1.RELEASE:compile
+- org.springframework.boot:spring-boot-starter:jar:2.0.0.M6:compile
| +- javax.annotation:javax.annotation-api:jar:1.3.1:compile
| \- org.yaml:snakeyaml:jar:1.19:compile
+- org.springframework.boot:spring-boot:jar:2.0.0.M6:compile
+- org.springframework.boot:spring-boot-autoconfigure:jar:2.0.0.M6:compile
+- org.springframework.boot:spring-boot-starter-logging:jar:2.0.0.M6:compile
| +- ch.qos.logback:logback-classic:jar:1.2.3:compile
| | \- ch.qos.logback:logback-core:jar:1.2.3:compile
| +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.9.1:compile
| | \- org.apache.logging.log4j:log4j-api:jar:2.9.1:compile
| +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
| \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
+- org.springframework.boot:spring-boot-starter-test:jar:2.0.0.M6:test
| +- org.springframework.boot:spring-boot-test:jar:2.0.0.M6:test
| +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.0.0.M6:test
| +- org.assertj:assertj-core:jar:3.8.0:test
| +- org.mockito:mockito-core:jar:2.11.0:test
| | +- net.bytebuddy:byte-buddy:jar:1.7.8:test
| | +- net.bytebuddy:byte-buddy-agent:jar:1.7.8:test
| | \- org.objenesis:objenesis:jar:2.6:test
| +- org.skyscreamer:jsonassert:jar:1.5.0:test
| | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
| +- org.springframework:spring-test:jar:5.0.1.RELEASE:test
| \- org.xmlunit:xmlunit-core:jar:2.5.0:test
+- javax.enterprise:cdi-api:jar:2.0-EDR1:compile
| +- javax.el:javax.el-api:jar:3.0.0:compile
| +- javax.interceptor:javax.interceptor-api:jar:1.2:compile
| \- javax.inject:javax.inject:jar:1:compile
+- javax.transaction:jta:jar:1.1:compile
+- org.apache.commons:commons-lang3:jar:3.4:compile
+- commons-validator:commons-validator:jar:1.5.0:compile
| +- commons-beanutils:commons-beanutils:jar:1.9.3:compile
| +- commons-digester:commons-digester:jar:2.1:compile
| +- commons-logging:commons-logging:jar:1.2:compile
| \- commons-collections:commons-collections:jar:3.2.2:compile
+- commons-io:commons-io:jar:2.4:compile
+- org.apache.commons:commons-compress:jar:1.14:compile
\- junit:junit:jar:4.12:test
tl;dr;
Add management.health.db.enabled=false to your config.
Details
Because you are also registering a JDBC DataSource in your config to work with liquigraph, the auto configuration of SpringBoot kicks in and registers an additional HealthIndicator for this db. You can deactivate this indicator by setting management.health.db.enabled=false.
Just some more information for you if you plan to upgrade to SpringBoot 2.0.0.M7: The configuration for health check has changed to:
management.endpoint.health.enabled=true
management.endpoint.health.show-details=ALWAYS
management.health.db.enabled=false
As an alternative workaround, you can still get the health check for your datasource in the following way, effectively shadowing the auto-configured DataSourceHealthIndicator bean:
#Bean
public DataSourceHealthIndicator dataSourceHealthIndicator(DataSource datasource) {
return new DataSourceHealthIndicator(datasource, "match (n) return count(n) as nodes");
}
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.
Using Apache Maven 3.3.9. I have a project that pulls some spring dependencies transitively. This is what I get:
$ mvn dependency:tree -Dverbose|grep spring-c
[INFO] | | +- org.springframework:spring-context:jar:4.3.1.RELEASE:compile
[INFO] | | | | \- (org.springframework:spring-core:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | | | \- (org.springframework:spring-core:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | | +- (org.springframework:spring-core:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | | \- (org.springframework:spring-core:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | | +- (org.springframework:spring-context:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | | +- (org.springframework:spring-core:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | | | +- (org.springframework:spring-context:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | | | \- (org.springframework:spring-core:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | | \- (org.springframework:spring-core:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | | +- (org.springframework:spring-core:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | | +- (org.springframework:spring-core:jar:4.3.1.RELEASE:compile - omitted for duplicate)
All above are compile scope, so all should be included. However, for some reason, spring-core is being completely omitted.
Strange enough, this looks like a depth problem. As you can see above the main project has dependency A that has dependency B that includes spring-context. Set up this way, it does not pull spring-core.
However, if I also include dependency B in my project pom directly in <dependency> (i.e. instead of relying A to transitively include B), it pulls spring-core as expected:
$ mvn dependency:tree -Dverbose|grep spring-c
[INFO] | +- org.springframework:spring-context:jar:4.3.1.RELEASE:compile
[INFO] | | | \- (org.springframework:spring-core:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | | \- (org.springframework:spring-core:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | +- org.springframework:spring-core:jar:4.3.1.RELEASE:compile
[INFO] | | \- (org.springframework:spring-core:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-context:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-core:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | | +- (org.springframework:spring-context:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | | \- (org.springframework:spring-core:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-core:jar:4.3.1.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-core:jar:4.3.1.RELEASE:compile - omitted for duplicate)
As you can see in row 4 of the maven output, spring-core is now included. That is, moving spring-context one level up seems to cause it's spring-core dependency to be pulled in.
Any idea why this is happening?
I am unable to start my application using #SpringBootApplication.
#SpringBootApplication
public class AppInitializer extends SpringBootServletInitializer {
#Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(AppInitializer.class);
}
public static void main(String[] args) {
ConfigurableApplicationContext ctx = new AppInitializer().configure(new SpringApplicationBuilder(AppInitializer.class)).run(args);
System.out.println("count="+ctx.getBeanDefinitionCount());
}
}
pom.xml uses:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jersey</artifactId>
<exclusions>
<exclusion>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
</exclusion>
</exclusions>
</dependency>
When i run the app, i get below error:
2015-03-09 09:14:10.372 INFO 10636 --- [ main]
s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with
port(s): 9000 (http) 2015-03-09 09:14:10.636 INFO 10636 --- [
main] o.apache.catalina.core.StandardService : Starting service
Tomcat 2015-03-09 09:14:10.638 INFO 10636 --- [ main]
org.apache.catalina.core.StandardEngine : Starting Servlet Engine:
Apache Tomcat/7.0.57 2015-03-09 09:14:10.940 INFO 10636 ---
[ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] :
Initializing Spring embedded WebApplicationContext 2015-03-09
09:14:10.941 INFO 10636 --- [ost-startStop-1]
o.s.web.context.ContextLoader : Root WebApplicationContext:
initialization completed in 3588 ms 2015-03-09 09:14:11.936 ERROR
10636 --- [cat-startStop-1] org.apache.catalina.core.ContainerBase :
A child container failed during start
java.util.concurrent.ExecutionException:
org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]] at
java.util.concurrent.FutureTask.report(FutureTask.java:122) at
java.util.concurrent.FutureTask.get(FutureTask.java:188) at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
at
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:816)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
at java.util.concurrent.FutureTask.run(FutureTask.java:262) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744) Caused by:
org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]] at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
... 6 common frames omitted
Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.addFilter(Ljava/lang/String;Ljavax/servlet/Filter;)Ljavax/servlet/FilterRegistration$Dynamic;
at
org.springframework.boot.context.embedded.FilterRegistrationBean.onStartup(FilterRegistrationBean.java:250)
at
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.selfInitialize(EmbeddedWebApplicationContext.java:222)
at
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.access$000(EmbeddedWebApplicationContext.java:84)
at
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext$1.onStartup(EmbeddedWebApplicationContext.java:206)
at
org.springframework.boot.context.embedded.tomcat.TomcatStarter.onStartup(TomcatStarter.java:54)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5481)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 common frames omitted
Dependency Tree:
[INFO] | +- mysql:mysql-connector-java:jar:5.1.34:compile
[INFO] | +- com.zaxxer:HikariCP-java6:jar:2.2.5:compile
[INFO] | | +- org.slf4j:slf4j-api:jar:1.7.8:compile (version managed from 1.7.5)
[INFO] | | \- org.javassist:javassist:jar:3.18.1-GA:compile
[INFO] | +- io.dropwizard.metrics:metrics-core:jar:3.1.0:compile
[INFO] | | \- (org.slf4j:slf4j-api:jar:1.7.8:compile - version managed from 1.7.7; omitted
for duplicate)
[INFO] | +- org.hibernate:hibernate-entitymanager:jar:4.3.7.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile
[INFO] | | +- org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile
[INFO] | | +- org.hibernate:hibernate-core:jar:4.3.7.Final:compile
[INFO] | | | +- (org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile - omitted for dupli
cate)
[INFO] | | | +- (org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile - om
itted for duplicate)
[INFO] | | | +- (org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.0.
0.Final:compile - omitted for duplicate)
[INFO] | | | +- (dom4j:dom4j:jar:1.6.1:compile - omitted for duplicate)
[INFO] | | | +- (org.hibernate.common:hibernate-commons-annotations:jar:4.0.5.Final:compi
le - omitted for duplicate)
[INFO] | | | +- (org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:co
mpile - omitted for duplicate)
[INFO] | | | +- (org.javassist:javassist:jar:3.18.1-GA:compile - omitted for duplicate)
[INFO] | | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | | \- org.jboss:jandex:jar:1.1.0.Final:compile
[INFO] | | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | | \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] | | +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.5.Final:compile
[INFO] | | | +- (org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile - omitted for dupli
cate)
[INFO] | | | \- (org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile - om
itted for duplicate)
[INFO] | | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compil
e
[INFO] | | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.0.0.Fi
nal:compile
[INFO] | | \- (org.javassist:javassist:jar:3.18.1-GA:compile - omitted for duplicate)
[INFO] | +- org.springframework.data:spring-data-jpa:jar:1.7.1.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:1.9.1.RELEASE:compile
[INFO] | | | +- (org.springframework:spring-core:jar:4.1.4.RELEASE:compile - version mana
ged from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | | +- (org.springframework:spring-beans:jar:4.1.4.RELEASE:compile - version man
aged from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | | +- (org.slf4j:slf4j-api:jar:1.7.8:compile - version managed from 1.7.7; omit
ted for duplicate)
[INFO] | | | \- (org.slf4j:jcl-over-slf4j:jar:1.7.8:runtime - version managed from 1.7.7;
omitted for duplicate)
[INFO] | | +- org.springframework:spring-orm:jar:4.1.4.RELEASE:compile (version managed fr
om 4.0.7.RELEASE)
[INFO] | | | +- (org.springframework:spring-beans:jar:4.1.4.RELEASE:compile - version man
aged from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | | +- (org.springframework:spring-core:jar:4.1.4.RELEASE:compile - version mana
ged from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | | +- org.springframework:spring-jdbc:jar:4.1.4.RELEASE:compile
[INFO] | | | | +- (org.springframework:spring-beans:jar:4.1.4.RELEASE:compile - version
managed from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | | | +- (org.springframework:spring-core:jar:4.1.4.RELEASE:compile - version m
anaged from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | | | \- (org.springframework:spring-tx:jar:4.1.4.RELEASE:compile - omitted for
duplicate)
[INFO] | | | \- (org.springframework:spring-tx:jar:4.1.4.RELEASE:compile - version manage
d from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | +- org.springframework:spring-context:jar:4.1.4.RELEASE:compile (version manage
d from 4.0.7.RELEASE)
[INFO] | | | +- (org.springframework:spring-aop:jar:4.1.4.RELEASE:compile - version manag
ed from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | | +- (org.springframework:spring-beans:jar:4.1.4.RELEASE:compile - version man
aged from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | | +- (org.springframework:spring-core:jar:4.1.4.RELEASE:compile - version mana
ged from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | | \- (org.springframework:spring-expression:jar:4.1.4.RELEASE:compile - omitte
d for duplicate)
[INFO] | | +- org.springframework:spring-aop:jar:4.1.4.RELEASE:compile
[INFO] | | | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | | | +- (org.springframework:spring-beans:jar:4.1.4.RELEASE:compile - version man
aged from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | | \- (org.springframework:spring-core:jar:4.1.4.RELEASE:compile - version mana
ged from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | +- org.springframework:spring-tx:jar:4.1.4.RELEASE:compile
[INFO] | | | +- (org.springframework:spring-beans:jar:4.1.4.RELEASE:compile - version man
aged from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | | \- (org.springframework:spring-core:jar:4.1.4.RELEASE:compile - version mana
ged from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | +- org.springframework:spring-beans:jar:4.1.4.RELEASE:compile
[INFO] | | | \- (org.springframework:spring-core:jar:4.1.4.RELEASE:compile - version mana
ged from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-core:jar:4.1.4.RELEASE:compile - version managed
from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | +- org.aspectj:aspectjrt:jar:1.8.4:compile (version managed from 1.8.2)
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.8:compile - version managed from 1.7.7; omitted
for duplicate)
[INFO] | | \- (org.slf4j:jcl-over-slf4j:jar:1.7.8:compile - version managed from 1.7.7; sc
ope updated from runtime; omitted for duplicate)
[INFO] | +- org.codehaus.groovy:groovy-all:jar:2.3.6:compile
[INFO] | \- log4j:log4j:jar:1.2.17:compile
[INFO] +- qcom.cas.backend.myapp:service:jar:1.0:compile
[INFO] | +- (qcom.cas.backend.myapp:persistence:jar:1.0:compile - omitted for duplicate)
[INFO] | +- (org.springframework.data:spring-data-jpa:jar:1.7.1.RELEASE:compile - omitted f
or duplicate)
[INFO] | +- (org.codehaus.groovy:groovy-all:jar:2.3.6:compile - omitted for duplicate)
[INFO] | \- (log4j:log4j:jar:1.2.17:compile - omitted for duplicate)
[INFO] +- org.springframework.boot:spring-boot-starter-jersey:jar:1.2.1.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.2.1.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.2.1.RELEASE:compile
[INFO] | | | +- (org.springframework:spring-core:jar:4.1.4.RELEASE:compile - version mana
ged from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | | \- (org.springframework:spring-context:jar:4.1.4.RELEASE:compile - version m
anaged from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.2.1.RELEASE:compile
[INFO] | | | \- (org.springframework.boot:spring-boot:jar:1.2.1.RELEASE:compile - omitted
for duplicate)
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.2.1.RELEASE:compi
le
[INFO] | | | +- org.slf4j:jcl-over-slf4j:jar:1.7.8:compile
[INFO] | | | | \- (org.slf4j:slf4j-api:jar:1.7.8:compile - version managed from 1.7.7; o
mitted for duplicate)
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.8:compile
[INFO] | | | | \- (org.slf4j:slf4j-api:jar:1.7.8:compile - version managed from 1.7.7; o
mitted for duplicate)
[INFO] | | | +- org.slf4j:log4j-over-slf4j:jar:1.7.8:compile
[INFO] | | | | \- (org.slf4j:slf4j-api:jar:1.7.8:compile - version managed from 1.7.7; o
mitted for duplicate)
[INFO] | | | \- ch.qos.logback:logback-classic:jar:1.1.2:compile
[INFO] | | | +- ch.qos.logback:logback-core:jar:1.1.2:compile
[INFO] | | | \- (org.slf4j:slf4j-api:jar:1.7.8:compile - version managed from 1.7.6; o
mitted for duplicate)
[INFO] | | +- (org.springframework:spring-core:jar:4.1.4.RELEASE:compile - version managed
from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | \- org.yaml:snakeyaml:jar:1.14:runtime
[INFO] | +- (org.springframework.boot:spring-boot-starter-tomcat:jar:1.2.1.RELEASE:compile
- omitted for duplicate)
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.4.4:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.4:compile (version ma
naged from 2.4.0)
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.4.4:compile
[INFO] | +- org.hibernate:hibernate-validator:jar:5.1.3.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | | +- (org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile - omitted for duplicat
e)
[INFO] | | \- com.fasterxml:classmate:jar:1.0.0:compile
[INFO] | +- org.springframework:spring-core:jar:4.1.4.RELEASE:compile
[INFO] | +- org.springframework:spring-web:jar:4.1.4.RELEASE:compile
[INFO] | | +- (org.springframework:spring-aop:jar:4.1.4.RELEASE:compile - version managed
from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-beans:jar:4.1.4.RELEASE:compile - version manage
d from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-context:jar:4.1.4.RELEASE:compile - version mana
ged from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:4.1.4.RELEASE:compile - version managed
from 4.0.7.RELEASE; omitted for duplicate)
[INFO] | +- org.glassfish.jersey.core:jersey-server:jar:2.14:compile
[INFO] | | +- org.glassfish.jersey.core:jersey-common:jar:2.14:compile
[INFO] | | | +- (javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile - omitted for duplicate)
[INFO] | | | +- (javax.annotation:javax.annotation-api:jar:1.2:compile - omitted for dupl
icate)
[INFO] | | | +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.14:compile
[INFO] | | | +- (org.glassfish.hk2:hk2-api:jar:2.4.0-b06:compile - omitted for duplicate)
[INFO] | | | +- (org.glassfish.hk2.external:javax.inject:jar:2.4.0-b06:compile - omitted
for duplicate)
[INFO] | | | +- (org.glassfish.hk2:hk2-locator:jar:2.4.0-b06:compile - omitted for duplic
ate)
[INFO] | | | \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
[INFO] | | +- org.glassfish.jersey.core:jersey-client:jar:2.14:compile
[INFO] | | | +- (org.glassfish.jersey.core:jersey-common:jar:2.14:compile - omitted for d
uplicate)
[INFO] | | | +- (javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile - omitted for duplicate)
[INFO] | | | +- (org.glassfish.hk2:hk2-api:jar:2.4.0-b06:compile - omitted for duplicate)
[INFO] | | | +- (org.glassfish.hk2.external:javax.inject:jar:2.4.0-b06:compile - omitted
for duplicate)
[INFO] | | | \- (org.glassfish.hk2:hk2-locator:jar:2.4.0-b06:compile - omitted for duplic
ate)
[INFO] | | +- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
[INFO] | | +- javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO] | | +- org.glassfish.hk2:hk2-api:jar:2.4.0-b06:compile
[INFO] | | | +- org.glassfish.hk2:hk2-utils:jar:2.4.0-b06:compile
[INFO] | | | \- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.4.0-b06:compile
[INFO] | | +- org.glassfish.hk2.external:javax.inject:jar:2.4.0-b06:compile
[INFO] | | +- org.glassfish.hk2:hk2-locator:jar:2.4.0-b06:compile
[INFO] | | | +- (org.glassfish.hk2.external:javax.inject:jar:2.4.0-b06:compile - omitted
for duplicate)
[INFO] | | | +- (org.glassfish.hk2.external:aopalliance-repackaged:jar:2.4.0-b06:compile
- omitted for duplicate)
[INFO] | | | +- (org.glassfish.hk2:hk2-api:jar:2.4.0-b06:compile - omitted for duplicate)
[INFO] | | | +- (org.glassfish.hk2:hk2-utils:jar:2.4.0-b06:compile - omitted for duplicat
e)
[INFO] | | | \- (org.javassist:javassist:jar:3.18.1-GA:compile - omitted for duplicate)
[INFO] | | \- (javax.validation:validation-api:jar:1.1.0.Final:compile - omitted for dupli
cate)
[INFO] | +- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.14:compile
[INFO] | | +- (org.glassfish.hk2.external:javax.inject:jar:2.4.0-b06:compile - omitted for
duplicate)
[INFO] | | +- (org.glassfish.jersey.core:jersey-common:jar:2.14:compile - omitted for dupl
icate)
[INFO] | | +- (org.glassfish.jersey.core:jersey-server:jar:2.14:compile - omitted for dupl
icate)
[INFO] | | \- (javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile - omitted for duplicate)
[INFO] | +- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.14:compile
[INFO] | | +- (org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.14:comp
ile - omitted for duplicate)
[INFO] | | +- (org.glassfish.jersey.core:jersey-common:jar:2.14:compile - omitted for dupl
icate)
[INFO] | | +- (org.glassfish.jersey.core:jersey-server:jar:2.14:compile - omitted for dupl
icate)
[INFO] | | \- (javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile - omitted for duplicate)
[INFO] | +- org.glassfish.jersey.ext:jersey-spring3:jar:2.14:compile
[INFO] | | +- (org.glassfish.jersey.core:jersey-server:jar:2.14:compile - omitted for dupl
icate)
[INFO] | | +- (org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.14:comp
ile - omitted for duplicate)
[INFO] | | +- org.glassfish.hk2:hk2:jar:2.4.0-b06:compile
[INFO] | | | +- (org.glassfish.hk2:hk2-utils:jar:2.4.0-b06:compile - omitted for duplicat
e)
[INFO] | | | +- (org.glassfish.hk2:hk2-api:jar:2.4.0-b06:compile - omitted for duplicate)
[INFO] | | | +- org.glassfish.hk2:config-types:jar:2.4.0-b06:compile
[INFO] | | | | \- (org.glassfish.hk2:hk2-config:jar:2.4.0-b06:compile - omitted for dupl
icate)
[INFO] | | | +- org.glassfish.hk2:core:jar:2.4.0-b06:compile
[INFO] | | | | +- (org.glassfish.hk2:hk2-locator:jar:2.4.0-b06:compile - omitted for dup
licate)
[INFO] | | | | \- (org.glassfish.hk2:hk2-utils:jar:2.4.0-b06:compile - omitted for dupli
cate)
[INFO] | | | +- org.glassfish.hk2:hk2-config:jar:2.4.0-b06:compile
[INFO] | | | | +- (org.glassfish.hk2:core:jar:2.4.0-b06:compile - omitted for duplicate)
[INFO] | | | | +- org.jvnet:tiger-types:jar:1.4:compile
[INFO] | | | | \- org.glassfish.hk2.external:bean-validator:jar:2.4.0-b06:compile
[INFO] | | | +- (org.glassfish.hk2:hk2-locator:jar:2.4.0-b06:compile - omitted for duplic
ate)
[INFO] | | | +- org.glassfish.hk2:hk2-runlevel:jar:2.4.0-b06:compile
[INFO] | | | | +- (org.glassfish.hk2:hk2-api:jar:2.4.0-b06:compile - omitted for duplica
te)
[INFO] | | | | \- (org.glassfish.hk2:hk2-locator:jar:2.4.0-b06:compile - omitted for dup
licate)
[INFO] | | | \- org.glassfish.hk2:class-model:jar:2.4.0-b06:compile
[INFO] | | | \- org.glassfish.hk2.external:asm-all-repackaged:jar:2.4.0-b06:compile
[INFO] | | +- org.glassfish.hk2:spring-bridge:jar:2.4.0-b06:compile
[INFO] | | | \- (org.springframework:spring-context:jar:4.1.4.RELEASE:compile - version m
anaged from 3.2.3.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-beans:jar:4.1.4.RELEASE:compile - version manage
d from 3.2.3.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-core:jar:4.1.4.RELEASE:compile - version managed
from 3.2.3.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-web:jar:4.1.4.RELEASE:compile - version managed
from 3.2.3.RELEASE; omitted for duplicate)
[INFO] | | \- (javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile - omitted for duplicate)
[INFO] | \- org.glassfish.jersey.media:jersey-media-json-jackson:jar:2.14:compile
[INFO] | +- (org.glassfish.jersey.core:jersey-common:jar:2.14:compile - omitted for dupl
icate)
[INFO] | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.3.2:compile
[INFO] | | +- (com.fasterxml.jackson.core:jackson-core:jar:2.4.4:compile - version mana
ged from 2.3.2; omitted for duplicate)
[INFO] | | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.4.4:compile - version
managed from 2.3.2; omitted for duplicate)
[INFO] | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.3.2:compile
[INFO] | | +- (com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.3.2:compile - omitt
ed for duplicate)
[INFO] | | +- (com.fasterxml.jackson.core:jackson-core:jar:2.4.4:compile - version mana
ged from 2.3.2; omitted for duplicate)
[INFO] | | +- (com.fasterxml.jackson.core:jackson-databind:jar:2.4.4:compile - version
managed from 2.3.2; omitted for duplicate)
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.3.2:co
mpile
[INFO] | | +- (com.fasterxml.jackson.core:jackson-core:jar:2.4.4:compile - version m
anaged from 2.3.2; omitted for duplicate)
[INFO] | | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.4.4:compile - versi
on managed from 2.3.2; omitted for duplicate)
[INFO] | \- (com.fasterxml.jackson.core:jackson-annotations:jar:2.4.4:compile - version
managed from 2.3.2; omitted for duplicate)
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.2.1.RELEASE:compile
[INFO] | +- (org.springframework.boot:spring-boot-starter:jar:1.2.1.RELEASE:compile - omitt
ed for duplicate)
[INFO] | +- (org.springframework.boot:spring-boot-starter-tomcat:jar:1.2.1.RELEASE:compile
- omitted for duplicate)
[INFO] | +- (com.fasterxml.jackson.core:jackson-databind:jar:2.4.4:compile - version manage
d from 2.3.2; omitted for duplicate)
[INFO] | +- (org.hibernate:hibernate-validator:jar:5.1.3.Final:compile - omitted for duplic
ate)
[INFO] | +- (org.springframework:spring-core:jar:4.1.4.RELEASE:compile - version managed fr
om 3.2.3.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-web:jar:4.1.4.RELEASE:compile - version managed fro
m 3.2.3.RELEASE; omitted for duplicate)
[INFO] | \- org.springframework:spring-webmvc:jar:4.1.4.RELEASE:compile
[INFO] | +- (org.springframework:spring-beans:jar:4.1.4.RELEASE:compile - version manage
d from 3.2.3.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-context:jar:4.1.4.RELEASE:compile - version mana
ged from 3.2.3.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:4.1.4.RELEASE:compile - version managed
from 3.2.3.RELEASE; omitted for duplicate)
[INFO] | +- org.springframework:spring-expression:jar:4.1.4.RELEASE:compile
[INFO] | | \- (org.springframework:spring-core:jar:4.1.4.RELEASE:compile - version mana
ged from 3.2.3.RELEASE; omitted for duplicate)
[INFO] | \- (org.springframework:spring-web:jar:4.1.4.RELEASE:compile - version managed
from 3.2.3.RELEASE; omitted for duplicate)
[INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.2.1.RELEASE:provided (sc
ope not updated to compile)
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:7.0.57:provided (version managed
from 8.0.15)
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:7.0.57:provided (version managed fr
om 8.0.15)
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:7.0.57:provided (version
managed from 8.0.15)
[INFO] | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:7.0.57:provided (version man
aged from 8.0.15)
[INFO] | \- (org.apache.tomcat.embed:tomcat-embed-core:jar:7.0.57:provided - version man
aged from 8.0.15; omitted for duplicate)
Found the problem: The dependency jersey-container-servlet-core is only suitable for servlet containers with less than Servlet 3.0 specification. Since you use Tomcat 7, which implements Servlet 3.0, you have to use jersey-container-servlet. See the Jersey documentation here: https://jersey.java.net/documentation/latest/modules-and-dependencies.html#servlet-app-general
If you run the application as standalone app (i.e. not deploy it into Tomcat), you have to make sure, that the dependency spring-boot-starter-tomcat is in scope "compile". Currently the dependency has the scope "provided", which means, the dependency is not on the classpath when running the application.
If you want to run your application both in Tomcat and as standalone app, you have to use Maven profiles and build two WARs, one with spring-boot-starter-tomcat as provided, and one with spring-boot-starter-tomcat as compile.