So I have no idea whenever this started as my project seemed to work perfectly last week and this week throws this error
java.lang.NoSuchMethodError: org.jboss.logging.Logger.debugf(Ljava/lang/String;I)V
at org.hibernate.query.spi.NamedQueryRepository.checkNamedQueries(NamedQueryRepository.java:151)
at org.hibernate.internal.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:533)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:323)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:462)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:892)
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:57)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:390)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:377)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1758)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1695)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:573)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:224)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1012)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:981)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findDefaultEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:569)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:532)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:700)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:673)
at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:180)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:353)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1341)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:572)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1135)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1062)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:583)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:372)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1341)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:572)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:372)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1247)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1096)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:535)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:226)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAsRegistrationBean(ServletContextInitializerBeans.java:182)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAsRegistrationBean(ServletContextInitializerBeans.java:177)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAdaptableBeans(ServletContextInitializerBeans.java:159)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init>(ServletContextInitializerBeans.java:81)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans(ServletWebServerApplicationContext.java:250)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:237)
at org.springframework.boot.web.embedded.tomcat.TomcatStarter.onStartup(TomcatStarter.java:54)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5245)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1420)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2021-04-19 10:46:02 [main] Ontolobridge-dev ERROR o.s.b.d.LoggingFailureAnalysisReporter -
So I went through the POM dependency tree and removed all imports of jboss-logging as I saw on a few stack overflows from 5 years ago to last year. However jboss-logging-3.1.3.GA.jar is still somehow imported. So I deleted the jar so its no longer in the class path and according to the POM is no longer in the dependency tree and yet every time I start the application it gets redownloaded. I cannot use a higher version as the older version is downloaded even if the newer version already exists.
Pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>edu.miami.schurer</groupId>
<artifactId>ontologbridge</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>ontologbridge</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.0</version>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.20</version>
</dependency>
<!-- Apache Commons DBCP -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>it.ozimov</groupId>
<artifactId>spring-boot-email-core</artifactId>
<version>0.6.3</version>
</dependency>
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>4.1</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<scope>test</scope>
</dependency>
<!--SpringFox dependencies --><!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry</artifactId>
<version>1.7.30</version>
</dependency>
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-logback</artifactId>
<version>1.7.30</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Tried removing all jboss-logging as you can see in the pomexclusions
Tried deleting the jar from the .m2 repository but it gets reloaded anyways
Tried doing the glassfish fix with glassfish-web.xml fix
Tried posting to github due to lack of answers in other threads but closed and told to come back here.
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call the method org.jboss.logging.Logger.debugf(Ljava/lang/String;I)V but it does not exist. Its class, org.jboss.logging.Logger, is available from the following locations:
jar:file:/C:/Users/<user>/.m2/repository/org/jboss/logging/jboss-logging/3.1.3.GA/jboss-logging-3.1.3.GA.jar!/org/jboss/logging/Logger.class
It was loaded from the following location:
file:/C:/Users/<user>/.m2/repository/org/jboss/logging/jboss-logging/3.1.3.GA/jboss-logging-3.1.3.GA.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.jboss.logging.Logger
MVN Dependency Tree:
[INFO]
[INFO] ------------------< edu.miami.schurer:ontologbridge >-------------------
[INFO] Building ontologbridge 0.0.1-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.0.2:tree (default-cli) # ontologbridge ---
[INFO] edu.miami.schurer:ontologbridge:war:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter:jar:2.0.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot:jar:2.0.5.RELEASE:compile
[INFO] | | \- org.springframework:spring-context:jar:5.0.9.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.0.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-logging:jar:2.0.5.RELEASE:compile
[INFO] | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.10.0:compile
[INFO] | | | \- org.apache.logging.log4j:log4j-api:jar:2.10.0:compile
[INFO] | | \- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] | +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] | +- org.springframework:spring-core:jar:5.0.9.RELEASE:compile
[INFO] | | \- org.springframework:spring-jcl:jar:5.0.9.RELEASE:compile
[INFO] | \- org.yaml:snakeyaml:jar:1.19:runtime
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:2.0.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.0.5.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-actuator:jar:2.0.5.RELEASE:compile
[INFO] | | \- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.6:compile
[INFO] | \- io.micrometer:micrometer-core:jar:1.0.6:compile
[INFO] | +- org.hdrhistogram:HdrHistogram:jar:2.1.10:compile
[INFO] | \- org.latencyutils:LatencyUtils:jar:2.0.3:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.0.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:2.0.5.RELEASE:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.6:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.6:compile
[INFO] | +- org.hibernate.validator:hibernate-validator:jar:6.0.12.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] | | \- org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile
[INFO] | +- org.springframework:spring-web:jar:5.0.9.RELEASE:compile
[INFO] | | \- org.springframework:spring-beans:jar:5.0.9.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:5.0.9.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:5.0.9.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-security:jar:2.0.5.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:5.0.9.RELEASE:compile
[INFO] | +- org.springframework.security:spring-security-config:jar:5.0.8.RELEASE:compile
[INFO] | | \- org.springframework.security:spring-security-core:jar:5.0.8.RELEASE:compile
[INFO] | \- org.springframework.security:spring-security-web:jar:5.0.8.RELEASE:compile
[INFO] +- org.postgresql:postgresql:jar:42.2.5:runtime
[INFO] +- io.jsonwebtoken:jjwt:jar:0.9.0:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-databind:jar:2.9.6:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] +- mysql:mysql-connector-java:jar:8.0.20:compile
[INFO] | \- com.google.protobuf:protobuf-java:jar:3.6.1:compile
[INFO] +- org.apache.commons:commons-dbcp2:jar:2.1.1:compile
[INFO] | \- org.apache.commons:commons-pool2:jar:2.5.0:compile
[INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.0.5.RELEASE:provided
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.34:provided
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.34:compile
[INFO] | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.34:provided
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.0.5.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:2.0.5.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.0.5.RELEASE:test
[INFO] | +- junit:junit:jar:4.12:test
[INFO] | +- org.assertj:assertj-core:jar:3.9.1:test
[INFO] | +- org.mockito:mockito-core:jar:2.15.0:test
[INFO] | | +- net.bytebuddy:byte-buddy:jar:1.7.11:compile
[INFO] | | +- net.bytebuddy:byte-buddy-agent:jar:1.7.11:test
[INFO] | | \- org.objenesis:objenesis:jar:2.6:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3: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-test:jar:5.0.9.RELEASE:test
[INFO] | \- org.xmlunit:xmlunit-core:jar:2.5.1:test
[INFO] +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.0.5.RELEASE:compile
[INFO] | +- com.zaxxer:HikariCP:jar:2.7.9:compile
[INFO] | \- org.springframework:spring-jdbc:jar:5.0.9.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:5.0.9.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-configuration-processor:jar:2.0.5.RELEASE:compile (optional)
[INFO] +- org.springframework.boot:spring-boot-starter-validation:jar:2.0.5.RELEASE:compile
[INFO] +- it.ozimov:spring-boot-email-core:jar:0.6.3:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-mail:jar:2.0.5.RELEASE:compile
[INFO] | | +- org.springframework:spring-context-support:jar:5.0.9.RELEASE:compile
[INFO] | | \- com.sun.mail:javax.mail:jar:1.6.2:compile
[INFO] | | \- javax.activation:activation:jar:1.1:compile
[INFO] | +- org.apache.tika:tika-core:jar:1.14:compile
[INFO] | +- org.hibernate:hibernate-validator:jar:5.3.3.Final:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-data-redis:jar:2.0.5.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-redis:jar:2.0.10.RELEASE:compile
[INFO] | | | +- org.springframework.data:spring-data-keyvalue:jar:2.0.10.RELEASE:compile
[INFO] | | | \- org.springframework:spring-oxm:jar:5.0.9.RELEASE:compile
[INFO] | | \- io.lettuce:lettuce-core:jar:5.0.5.RELEASE:compile
[INFO] | | +- io.projectreactor:reactor-core:jar:3.1.9.RELEASE:compile
[INFO] | | | \- org.reactivestreams:reactive-streams:jar:1.0.2:compile
[INFO] | | +- io.netty:netty-common:jar:4.1.29.Final:compile
[INFO] | | +- io.netty:netty-transport:jar:4.1.29.Final:compile
[INFO] | | | +- io.netty:netty-buffer:jar:4.1.29.Final:compile
[INFO] | | | \- io.netty:netty-resolver:jar:4.1.29.Final:compile
[INFO] | | \- io.netty:netty-handler:jar:4.1.29.Final:compile
[INFO] | | \- io.netty:netty-codec:jar:4.1.29.Final:compile
[INFO] | +- it.ozimov:embedded-redis:jar:0.7.0:compile
[INFO] | | \- commons-io:commons-io:jar:2.5:compile
[INFO] | +- org.owasp.encoder:encoder:jar:1.2.1:compile
[INFO] | \- com.google.guava:guava:jar:21.0:compile
[INFO] +- com.opencsv:opencsv:jar:4.1:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.7:compile
[INFO] | +- org.apache.commons:commons-text:jar:1.1:compile
[INFO] | \- commons-beanutils:commons-beanutils:jar:1.9.3:compile
[INFO] | +- commons-logging:commons-logging:jar:1.2:compile
[INFO] | \- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] +- 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.25:compile
[INFO] +- io.springfox:springfox-swagger2:jar:2.9.2:compile
[INFO] | +- io.swagger:swagger-annotations:jar:1.5.20:compile
[INFO] | +- io.swagger:swagger-models:jar:1.5.20:compile
[INFO] | +- io.springfox:springfox-spi:jar:2.9.2:compile
[INFO] | | \- io.springfox:springfox-core:jar:2.9.2:compile
[INFO] | +- io.springfox:springfox-schema:jar:2.9.2:compile
[INFO] | +- io.springfox:springfox-swagger-common:jar:2.9.2:compile
[INFO] | +- io.springfox:springfox-spring-web:jar:2.9.2:compile
[INFO] | +- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] | +- org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile
[INFO] | +- org.springframework.plugin:spring-plugin-metadata:jar:1.2.0.RELEASE:compile
[INFO] | \- org.mapstruct:mapstruct:jar:1.2.0.Final:compile
[INFO] +- io.springfox:springfox-swagger-ui:jar:2.9.2:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:2.0.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:2.0.5.RELEASE:compile
[INFO] | | \- org.aspectj:aspectjweaver:jar:1.8.13:compile
[INFO] | +- javax.transaction:javax.transaction-api:jar:1.2:compile
[INFO] | +- org.hibernate:hibernate-core:jar:5.2.17.Final:compile
[INFO] | | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.2.Final:compile
[INFO] | | +- org.javassist:javassist:jar:3.22.0-GA:compile
[INFO] | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | +- org.jboss:jandex:jar:2.0.3.Final:compile
[INFO] | | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
[INFO] | +- org.springframework.data:spring-data-jpa:jar:2.0.10.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:2.0.10.RELEASE:compile
[INFO] | | \- org.springframework:spring-orm:jar:5.0.9.RELEASE:compile
[INFO] | \- org.springframework:spring-aspects:jar:5.0.9.RELEASE:compile
[INFO] +- io.sentry:sentry:jar:1.7.30:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.9.6:compile
[INFO] \- io.sentry:sentry-logback:jar:1.7.30:compile
[INFO] +- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] \- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.686 s
[INFO] Finished at: 2021-04-20T16:36:21-04:00
[INFO] ------------------------------------------------------------------------
How do I fix this.
Related
I am facing an issue with my Spring Boot project and H2 DB and I am not sure how to locate the root of the issue.
I have ran the project localy in STS and it is working as expected, when I move it to a server (redhat with Tomcat 7) I am getting the below error. The only diffrance between both deployments is the JDBC dependancy is only in the pom.xml which is deployed to the server and not locally.
pom.xml file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.6</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>spring_start</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring_start</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<itext.version>7.2.4</itext.version> <!-- Extrenal repo-->
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-test</artifactId>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
<!-- Extrenal repo Start Here-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext7-core</artifactId>
<version>${itext.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.konghq</groupId>
<artifactId>unirest-java</artifactId>
<version>3.7.04</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<!-- Extrenal repo End Here-->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
<finalName>example</finalName>
</build>
</project>
application properties h2 part
#H2 DB
spring.datasource.url=jdbc:h2:mem:dipattdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.h2.console.enabled=true
spring.h2.console.settings.web-allow-others=false
#spring.h2.console.settings.trace=true
spring.jpa.hibernate.ddl-auto= update
error log
11-Jan-2023 19:10:19.388 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
11-Jan-2023 19:10:24.270 SEVERE [main] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/var/opt/rh/jws5/lib/tomcat/webapps/example.war]
java.lang.IllegalStateException: Error starting child
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:698)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1024)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1911)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:825)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/example]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
... 37 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]: Factory method 'entityManagerFactory' threw exception; nested exception is java.lang.AbstractMethodError: org.apache.commons.dbcp.BasicDataSource.isWrapperFor(Ljava/lang/Class;)Z
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:175)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:155)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:97)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:174)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5219)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 38 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]: Factory method 'entityManagerFactory' threw exception; nested exception is java.lang.AbstractMethodError: org.apache.commons.dbcp.BasicDataSource.isWrapperFor(Ljava/lang/Class;)Z
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
... 60 more
Caused by: java.lang.AbstractMethodError: org.apache.commons.dbcp.BasicDataSource.isWrapperFor(Ljava/lang/Class;)Z
at org.springframework.boot.jdbc.DataSourceUnwrapper.safeUnwrap(DataSourceUnwrapper.java:95)
at org.springframework.boot.jdbc.DataSourceUnwrapper.unwrap(DataSourceUnwrapper.java:60)
at org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProvidersConfiguration$HikariPoolDataSourceMetadataProviderConfiguration.lambda$hikariPoolDataSourceMetadataProvider$0(DataSourcePoolMetadataProvidersConfiguration.java:73)
at org.springframework.boot.jdbc.metadata.CompositeDataSourcePoolMetadataProvider.getDataSourcePoolMetadata(CompositeDataSourcePoolMetadataProvider.java:50)
at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration.isDataSourceAutoCommitDisabled(HibernateJpaConfiguration.java:167)
at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration.configureProviderDisablesAutocommit(HibernateJpaConfiguration.java:161)
at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration.customizeVendorProperties(HibernateJpaConfiguration.java:143)
at org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.entityManagerFactory(JpaBaseConfiguration.java:133)
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.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 61 more
mvn tree
[INFO] --- maven-dependency-plugin:3.3.0:tree (default-cli) # diploma.attestation ---
[INFO] edu.aus.oor:diploma.attestation:war:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.7.6:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.7.6:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:2.7.6:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.7.6:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:2.7.6:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.2.11:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.2.11:compile
[INFO] | | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.17.2:compile
[INFO] | | | | \- org.apache.logging.log4j:log4j-api:jar:2.17.2:compile
[INFO] | | | \- org.slf4j:jul-to-slf4j:jar:1.7.36:compile
[INFO] | | +- org.springframework:spring-core:jar:5.3.24:compile
[INFO] | | | \- org.springframework:spring-jcl:jar:5.3.24:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.30:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:2.7.6:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.13.4.2:compile
[INFO] | | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.4:compile
[INFO] | | | \- com.fasterxml.jackson.core:jackson-core:jar:2.13.4:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.13.4:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.13.4:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.13.4:compile
[INFO] | +- org.springframework:spring-web:jar:5.3.24:compile
[INFO] | | \- org.springframework:spring-beans:jar:5.3.24:compile
[INFO] | \- org.springframework:spring-webmvc:jar:5.3.24:compile
[INFO] | +- org.springframework:spring-aop:jar:5.3.24:compile
[INFO] | +- org.springframework:spring-context:jar:5.3.24:compile
[INFO] | \- org.springframework:spring-expression:jar:5.3.24:compile
[INFO] +- org.projectlombok:lombok:jar:1.18.24:compile
[INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.7.6:provided
[INFO] | +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.69:provided
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.69:compile
[INFO] | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.69:provided
[INFO] +- org.apache.commons:commons-lang3:jar:3.12.0:compile
[INFO] +- commons-io:commons-io:jar:2.11.0:compile
[INFO] +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.7.6:compile
[INFO] | +- com.zaxxer:HikariCP:jar:4.0.3:compile
[INFO] | | \- org.slf4j:slf4j-api:jar:1.7.36:compile
[INFO] | \- org.springframework:spring-jdbc:jar:5.3.24:compile
[INFO] | \- org.springframework:spring-tx:jar:5.3.24:compile
[INFO] +- com.itextpdf:itext7-core:pom:7.2.4:compile
[INFO] | +- com.itextpdf:barcodes:jar:7.2.4:compile
[INFO] | +- com.itextpdf:font-asian:jar:7.2.4:compile
[INFO] | +- com.itextpdf:forms:jar:7.2.4:compile
[INFO] | +- com.itextpdf:hyph:jar:7.2.4:compile
[INFO] | +- com.itextpdf:io:jar:7.2.4:compile
[INFO] | | \- com.itextpdf:commons:jar:7.2.4:compile
[INFO] | +- com.itextpdf:kernel:jar:7.2.4:compile
[INFO] | | +- org.bouncycastle:bcpkix-jdk15on:jar:1.70:compile
[INFO] | | | \- org.bouncycastle:bcutil-jdk15on:jar:1.70:compile
[INFO] | | \- org.bouncycastle:bcprov-jdk15on:jar:1.70:compile
[INFO] | +- com.itextpdf:layout:jar:7.2.4:compile
[INFO] | +- com.itextpdf:pdfa:jar:7.2.4:compile
[INFO] | +- com.itextpdf:sign:jar:7.2.4:compile
[INFO] | +- com.itextpdf:styled-xml-parser:jar:7.2.4:compile
[INFO] | \- com.itextpdf:svg:jar:7.2.4:compile
[INFO] +- com.konghq:unirest-java:jar:3.7.04:compile
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.13:compile
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.4.15:compile
[INFO] | | \- commons-codec:commons-codec:jar:1.15:compile
[INFO] | +- org.apache.httpcomponents:httpmime:jar:4.5.13:compile
[INFO] | +- org.apache.httpcomponents:httpcore-nio:jar:4.4.15:compile
[INFO] | +- org.apache.httpcomponents:httpasyncclient:jar:4.1.5:compile
[INFO] | \- com.google.code.gson:gson:jar:2.9.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-cache:jar:2.7.6:compile
[INFO] | \- org.springframework:spring-context-support:jar:5.3.24:compile
[INFO] +- org.springframework.boot:spring-boot-starter-thymeleaf:jar:2.7.6:compile
[INFO] | +- org.thymeleaf:thymeleaf-spring5:jar:3.0.15.RELEASE:compile
[INFO] | | \- org.thymeleaf:thymeleaf:jar:3.0.15.RELEASE:compile
[INFO] | | +- org.attoparser:attoparser:jar:2.0.5.RELEASE:compile
[INFO] | | \- org.unbescape:unbescape:jar:1.1.6.RELEASE:compile
[INFO] | \- org.thymeleaf.extras:thymeleaf-extras-java8time:jar:3.0.4.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-mail:jar:2.7.6:compile
[INFO] | \- com.sun.mail:jakarta.mail:jar:1.6.7:compile
[INFO] | \- com.sun.activation:jakarta.activation:jar:1.2.2:compile
[INFO] +- org.apache.commons:commons-csv:jar:1.9.0:compile
[INFO] +- org.springframework.boot:spring-boot-starter-validation:jar:2.7.6:compile
[INFO] | \- org.hibernate.validator:hibernate-validator:jar:6.2.5.Final:compile
[INFO] | +- jakarta.validation:jakarta.validation-api:jar:2.0.2:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.4.3.Final:compile
[INFO] | \- com.fasterxml:classmate:jar:1.5.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:2.7.6:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:2.7.6:compile
[INFO] | | \- org.aspectj:aspectjweaver:jar:1.9.7:compile
[INFO] | +- jakarta.transaction:jakarta.transaction-api:jar:1.3.3:compile
[INFO] | +- jakarta.persistence:jakarta.persistence-api:jar:2.2.3:compile
[INFO] | +- org.hibernate:hibernate-core:jar:5.6.14.Final:compile
[INFO] | | +- net.bytebuddy:byte-buddy:jar:1.12.19:compile
[INFO] | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | +- org.jboss:jandex:jar:2.4.2.Final:compile
[INFO] | | +- org.hibernate.common:hibernate-commons-annotations:jar:5.1.2.Final:compile
[INFO] | | \- org.glassfish.jaxb:jaxb-runtime:jar:2.3.7:compile
[INFO] | | +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile
[INFO] | | +- org.glassfish.jaxb:txw2:jar:2.3.7:compile
[INFO] | | \- com.sun.istack:istack-commons-runtime:jar:3.0.12:compile
[INFO] | +- org.springframework.data:spring-data-jpa:jar:2.7.6:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:2.7.6:compile
[INFO] | | \- org.springframework:spring-orm:jar:5.3.24:compile
[INFO] | \- org.springframework:spring-aspects:jar:5.3.24:compile
[INFO] \- com.h2database:h2:jar:2.1.214:runtime
I have removed the .m2 file, and I have removed the JDBC part in the server pom with no luck.
Setting up a clean Maven project with spring boot for testing with JUnit 4 and 5 I end up with these dependencies:
<properties>
<junit-jupiter.version>5.5.2</junit-jupiter.version>
<spring-framework.version>5.2.0.RELEASE</spring-framework.version>
<spring-boot.version>2.2.0.RELEASE</spring-boot.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring-framework.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
<version>11</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit-jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit-jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit-jupiter.version}</version>
</dependency>
</dependencies>
This results in the following dependency tree:
[INFO] ch.sahits.test:junit55:jar:1.0-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.2.0.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.2.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:2.2.0.RELEASE:compile
[INFO] | | | \- org.springframework:spring-context:jar:5.2.0.RELEASE:compile
[INFO] | | | +- org.springframework:spring-aop:jar:5.2.0.RELEASE:compile
[INFO] | | | +- org.springframework:spring-beans:jar:5.2.0.RELEASE:compile
[INFO] | | | \- org.springframework:spring-expression:jar:5.2.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.2.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:2.2.0.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] | | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.12.1:compile
[INFO] | | | | \- org.apache.logging.log4j:log4j-api:jar:2.12.1:compile
[INFO] | | | \- org.slf4j:jul-to-slf4j:jar:1.7.28:compile
[INFO] | | +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.25:runtime
[INFO] | +- org.springframework.boot:spring-boot-test:jar:2.2.0.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.2.0.RELEASE:compile
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.4.0:compile
[INFO] | | +- net.minidev:json-smart:jar:2.3:compile
[INFO] | | | \- net.minidev:accessors-smart:jar:1.2:compile
[INFO] | | | \- org.ow2.asm:asm:jar:5.0.4:compile
[INFO] | | \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] | +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2:compile
[INFO] | | \- jakarta.activation:jakarta.activation-api:jar:1.2.1:compile
[INFO] | +- org.junit.jupiter:junit-jupiter:jar:5.5.2:compile
[INFO] | +- org.mockito:mockito-junit-jupiter:jar:3.1.0:compile
[INFO] | +- org.assertj:assertj-core:jar:3.13.2:compile
[INFO] | +- org.hamcrest:hamcrest:jar:2.1:compile
[INFO] | +- org.mockito:mockito-core:jar:3.1.0:compile
[INFO] | | +- net.bytebuddy:byte-buddy:jar:1.9.10:compile
[INFO] | | +- net.bytebuddy:byte-buddy-agent:jar:1.9.10:compile
[INFO] | | \- org.objenesis:objenesis:jar:2.6:compile
[INFO] | +- org.skyscreamer:jsonassert:jar:1.5.0:compile
[INFO] | | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:compile
[INFO] | +- org.springframework:spring-test:jar:5.2.0.RELEASE:compile
[INFO] | \- org.xmlunit:xmlunit-core:jar:2.6.3:compile
[INFO] +- org.springframework:spring-core:jar:5.2.0.RELEASE:compile
[INFO] | \- org.springframework:spring-jcl:jar:5.2.0.RELEASE:compile
[INFO] +- org.openjfx:javafx-controls:jar:11:compile
[INFO] | +- org.openjfx:javafx-controls:jar:linux:11:compile
[INFO] | \- org.openjfx:javafx-graphics:jar:11:compile
[INFO] | +- org.openjfx:javafx-graphics:jar:linux:11:compile
[INFO] | \- org.openjfx:javafx-base:jar:11:compile
[INFO] | \- org.openjfx:javafx-base:jar:linux:11:compile
[INFO] +- org.openjfx:javafx-swing:jar:11:compile
[INFO] | \- org.openjfx:javafx-swing:jar:linux:11:compile
[INFO] +- junit:junit:jar:4.12:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.5.2:compile
[INFO] | +- org.apiguardian:apiguardian-api:jar:1.1.0:compile
[INFO] | \- org.junit.platform:junit-platform-engine:jar:1.5.2:compile
[INFO] +- org.junit.platform:junit-platform-launcher:jar:1.2.0:compile
[INFO] +- org.junit.vintage:junit-vintage-engine:jar:5.5.2:compile
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.5.2:compile
[INFO] \- org.junit.jupiter:junit-jupiter-api:jar:5.5.2:compile
[INFO] +- org.opentest4j:opentest4j:jar:1.2.0:compile
[INFO] \- org.junit.platform:junit-platform-commons:jar:1.5.2:compile
On a different module/project I do have these dependencies:
<dependencies>
<!-- Module dependencies -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>OpenPatricianUtilities</artifactId>
</dependency>
<dependency>
<groupId>ch.sahits.game</groupId>
<artifactId>GameEvent</artifactId>
</dependency>
<dependency>
<groupId>ch.sahits.game</groupId>
<artifactId>MarvinFXEssentials</artifactId>
<scope>test</scope>
</dependency>
<!-- Spring Framework -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</dependency>
<!-- Other libraries -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ch.sahits</groupId>
<artifactId>sahitsUtil</artifactId>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.sahits.game</groupId>
<artifactId>OpenPatricianData</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.sahits.game</groupId>
<artifactId>OpenPatricianTestUtilities</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Resulting in this dependency tree:
[INFO] ch.sahits.game:OpenPatricianModel:jar:1.1.0-SNAPSHOT
[INFO] +- ch.sahits.game:OpenPatricianUtilities:jar:1.1.0-SNAPSHOT:compile
[INFO] | +- org.springframework:spring-context:jar:5.2.0.RELEASE:compile
[INFO] | | +- org.springframework:spring-aop:jar:5.2.0.RELEASE:compile
[INFO] | | \- org.springframework:spring-expression:jar:5.2.0.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:5.2.0.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-logging:jar:2.2.0.RELEASE:compile
[INFO] | | +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | | | \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.12.1:compile
[INFO] | | | \- org.apache.logging.log4j:log4j-api:jar:2.12.1:compile
[INFO] | | \- org.slf4j:jul-to-slf4j:jar:1.7.28:compile
[INFO] | +- org.openjfx:javafx-controls:jar:11:compile
[INFO] | | +- org.openjfx:javafx-controls:jar:linux:11:compile
[INFO] | | \- org.openjfx:javafx-graphics:jar:11:compile
[INFO] | | +- org.openjfx:javafx-graphics:jar:linux:11:compile
[INFO] | | \- org.openjfx:javafx-base:jar:11:compile
[INFO] | | \- org.openjfx:javafx-base:jar:linux:11:compile
[INFO] | +- commons-io:commons-io:jar:2.6:compile
[INFO] | +- com.thoughtworks.xstream:xstream:jar:1.4.11:compile
[INFO] | | +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO] | | \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] | +- javax.xml.bind:jaxb-api:jar:2.3.1:compile
[INFO] | \- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] +- ch.sahits.game:GameEvent:jar:1.1.0-SNAPSHOT:compile
[INFO] +- ch.sahits.game:MarvinFXEssentials:jar:1.1.0-SNAPSHOT:test
[INFO] | +- junit:junit:jar:4.12:test
[INFO] | | \- org.hamcrest:hamcrest-core:jar:2.1:test
[INFO] | \- org.openjfx:javafx-fxml:jar:11:test
[INFO] | \- org.openjfx:javafx-fxml:jar:linux:11:test
[INFO] +- org.springframework.boot:spring-boot:jar:2.2.0.RELEASE:compile
[INFO] | \- org.springframework:spring-core:jar:5.2.0.RELEASE:compile
[INFO] | \- org.springframework:spring-jcl:jar:5.2.0.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-autoconfigure:jar:2.2.0.RELEASE:compile
[INFO] +- org.springframework:spring-oxm:jar:5.2.0.RELEASE:compile
[INFO] +- org.glassfish.jaxb:jaxb-runtime:jar:2.3.1:compile
[INFO] | +- org.glassfish.jaxb:txw2:jar:2.3.2:compile
[INFO] | +- com.sun.istack:istack-commons-runtime:jar:3.0.7:compile
[INFO] | +- org.jvnet.staxex:stax-ex:jar:1.8:compile
[INFO] | +- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.15:compile
[INFO] | \- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] +- com.google.guava:guava:jar:24.1-jre:compile
[INFO] | +- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] | +- org.checkerframework:checker-compat-qual:jar:2.0.0:compile
[INFO] | +- com.google.errorprone:error_prone_annotations:jar:2.1.3:compile
[INFO] | +- com.google.j2objc:j2objc-annotations:jar:1.1:compile
[INFO] | \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.14:compile
[INFO] +- org.projectlombok:lombok:jar:1.18.10:provided
[INFO] +- ch.sahits:sahitsUtil:jar:1.3.3:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.9:compile
[INFO] | +- org.mockito:mockito-junit-jupiter:jar:3.1.0:compile
[INFO] | \- commons-cli:commons-cli:jar:1.4:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.2.0.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.2.0.RELEASE:test
[INFO] | | +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:test
[INFO] | | \- org.yaml:snakeyaml:jar:1.25:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:2.2.0.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.2.0.RELEASE:test
[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.28:compile
[INFO] | +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2:test
[INFO] | | \- jakarta.activation:jakarta.activation-api:jar:1.2.1:test
[INFO] | +- org.junit.jupiter:junit-jupiter:jar:5.5.2:test
[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.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:compile
[INFO] | | +- net.bytebuddy:byte-buddy:jar:1.10.1:compile
[INFO] | | +- net.bytebuddy:byte-buddy-agent:jar:1.10.1:compile
[INFO] | | \- org.objenesis:objenesis:jar:2.6:compile
[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-test:jar:5.2.0.RELEASE:test
[INFO] | \- org.xmlunit:xmlunit-core:jar:2.6.3:test
[INFO] +- ch.sahits.game:OpenPatricianData:jar:1.1.0-SNAPSHOT:test
[INFO] \- ch.sahits.game:OpenPatricianTestUtilities:jar:1.1.0-SNAPSHOT:test
[INFO] +- org.openjfx:javafx-swing:jar:11:test
[INFO] | \- org.openjfx:javafx-swing:jar:linux:11:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.5.2:test
[INFO] +- org.junit.platform:junit-platform-launcher:jar:1.5.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.5.2:test
[INFO] \- org.junit.jupiter:junit-jupiter-api:jar:5.5.2:test
[INFO] +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] \- org.junit.platform:junit-platform-commons:jar:1.5.2:test
Both define Mockito in version 3.1.0 through the spring-boot-starter-test. However the the porject junit55 has a byte-buddy dependency of version 1.9.10 while OpenPatricianModel has it in version 1.10.1. This dependency is not explicity defined in the project.
How is it possible that I have different dependency of byte-buddy on OpenPatricianModel and how can I find out, where it comes from.
The byte-buddy dependencies are being pulled in transitively by at least one more dependency than org.springframework.boot:spring-boot-starter-test. You can see that by the scope of byte-buddy in the dependency tree of your OpenPatricianModel. Note that the scope is compile and not test.
The best way to find out which dependency is pulling it in is to add exclusions of the byte-buddy dependencies in your declaration of the spring-boot-starter-test. Something like:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
</exclusion>
<exclusion>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
</exclusion>
</exclusions>
</dependency>
Then, by running mvn dependency:tree again you should be able to see which other dependency is pulling in byte-buddy. Note that there could be more than one, in which case you will have to do the same exercise again.
I'm trying to migrate existing Spring project to Spring Boot.
In project already used Spring Data JPA/Hibernate and simple DAO with JDBC (PostgreSQL used).
In few states I found that all that I need to migrate on Spring boot, is:
Add necessary dependencies
Add entry point #SpringBootApplication
profit, that's all.
1) Dependencies:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.4</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>2.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>1.4.7.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
<version>1.4.7.RELEASE</version>
</dependency>
With dependencyManagment section I have error:
Exception in thread "main" java.lang.NoSuchMethodError: org.springframework.data.repository.config.RepositoryConfigurationSource.getAttribute(Ljava/lang/String;)Ljava/util/Optional;
at org.springframework.data.jpa.repository.config.JpaRepositoryConfigExtension.postProcess(JpaRepositoryConfigExtension.java:125)
at org.springframework.data.repository.config.RepositoryConfigurationDelegate.registerRepositoriesIn(RepositoryConfigurationDelegate.java:127)
at org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport.registerBeanDefinitions(RepositoryBeanDefinitionRegistrarSupport.java:83)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:359)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:143)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:320)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:272)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:92)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:525)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
at ru.testproject.BootConfiguration.main(BootConfiguration.java:26)
And without it:
Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.NoClassDefFoundError: org/eclipse/jetty/util/DeprecationWarning
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
at ru.testproject.BootConfiguration.main(BootConfiguration.java:26)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jetty/util/DeprecationWarning
at org.eclipse.jetty.servlet.ServletContextHandler.<init>(ServletContextHandler.java:159)
at org.eclipse.jetty.webapp.WebAppContext.<init>(WebAppContext.java:289)
at org.eclipse.jetty.webapp.WebAppContext.<init>(WebAppContext.java:211)
at org.springframework.boot.context.embedded.jetty.JettyEmbeddedWebAppContext.<init>(JettyEmbeddedWebAppContext.java:28)
at org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory.getEmbeddedServletContainer(JettyEmbeddedServletContainerFactory.java:170)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134)
... 8 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.util.DeprecationWarning
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
2) entry point (I'm also tried to Import configuration classes, commented):
#SpringBootApplication
//#Import({DatabaseConfig.class, WebMvcConfig.class, WebAppConfig.class, WebSecurityConfig.class, WebServiceConfig.class})
public class BootConfiguration extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(BootConfiguration.class, args);
// SpringApplication.run(new Class<?>[] {BootConfiguration.class, DatabaseConfig.class, WebMvcConfig.class, WebAppConfig.class, WebSecurityConfig.class, WebServiceConfig.class}, args);
}
#Bean
public JettyEmbeddedServletContainerFactory jettyEmbeddedServletContainerFactory() {
JettyEmbeddedServletContainerFactory jettyContainer =
new JettyEmbeddedServletContainerFactory();
jettyContainer.setPort(9000);
jettyContainer.setContextPath("");
return jettyContainer;
}
#Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(BootConfiguration.class);
}
}
And configuration:
#Configuration
#EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
#EnableJpaRepositories(basePackages = {
"ru.testproject.hibernate"
})
#EnableTransactionManagement
#PropertySource("classpath:application.properties")
public class DatabaseConfig implements TransactionManagementConfigurer {
#Bean
public DataSource dataSource() {
if (DB_TYPE_POSTGRESQL.equalsIgnoreCase(dbType)) {
return postresqlDataSource();
} else {
return h2DataSource();
}
}
#Bean
public PlatformTransactionManager annotationDrivenTransactionManager() {
return new JpaTransactionManager();
}
}
I have no idea what I'm doing wrong. What do I need to do to start spring boot application with existing Jetty server configuration?
UPDATE
I've modified the main pom:
<parent>
<groupId>ru.testproject</groupId>
<artifactId>test</artifactId>
<version>1.0.1</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
<!-- <version>${spring.boot.version}</version> -->
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate-version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate-version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>4.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>4.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Version 5.0.4 because ${spring.version} context fails with CandidateComponentsIndexLoader error (it introduced in 5.0.0 version) -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.0.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<!-- Jetty embedded -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
also, I've commented all tags for spring boot dependencies.
mvc dependency:tree give the following output:
[INFO] --- maven-dependency-plugin:3.0.2:tree (default-cli) # test ---
[WARNING] The artifact org.hibernate:hibernate-infinispan:jar:5.3.3.Final has been relocated to org.infinispan:infinispan-hibernate-cache-v53:jar:9.3.0.Final
[INFO] ru.testproject:test:jar:2.4.41-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.5.8.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:1.5.8.RELEASE:test
[INFO] | | \- org.springframework.boot:spring-boot:jar:1.5.8.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.5.8.RELEASE:test
[INFO] | | \- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.8.RELEASE:compile
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.2.0:test
[INFO] | | \- net.minidev:json-smart:jar:2.2.1:test
[INFO] | | \- net.minidev:accessors-smart:jar:1.1:test
[INFO] | +- org.assertj:assertj-core:jar:2.6.0:test
[INFO] | +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | | \- org.objenesis:objenesis:jar:2.1:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] | +- org.skyscreamer:jsonassert:jar:1.4.0:test
[INFO] | | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] | +- org.springframework:spring-core:jar:4.3.12.RELEASE:compile
[INFO] | \- org.springframework:spring-test:jar:4.3.12.RELEASE:test
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.5.8.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.5.8.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.8.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.1.11:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.1.11:compile
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:1.5.8.RELEASE:compile
[INFO] | | \- org.aspectj:aspectjweaver:jar:1.8.11:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.5.8.RELEASE:compile
[INFO] | | \- org.apache.tomcat:tomcat-jdbc:jar:8.5.23:compile
[INFO] | | \- org.apache.tomcat:tomcat-juli:jar:8.5.23:compile
[INFO] | +- javax.transaction:javax.transaction-api:jar:1.2:compile
[INFO] | +- org.springframework.data:spring-data-jpa:jar:1.11.8.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:1.13.8.RELEASE:compile
[INFO] | | +- org.springframework:spring-orm:jar:4.3.12.RELEASE:compile
[INFO] | | \- org.slf4j:jcl-over-slf4j:jar:1.7.25:compile
[INFO] | \- org.springframework:spring-aspects:jar:4.3.12.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-jetty:jar:1.5.8.RELEASE:compile
[INFO] | +- org.eclipse.jetty:jetty-webapp:jar:9.4.7.v20170914:compile
[INFO] | | +- org.eclipse.jetty:jetty-xml:jar:9.4.7.v20170914:compile
[INFO] | | \- org.eclipse.jetty:jetty-servlet:jar:9.4.7.v20170914:compile
[INFO] | | \- org.eclipse.jetty:jetty-security:jar:9.4.7.v20170914:compile
[INFO] | | \- org.eclipse.jetty:jetty-server:jar:9.4.7.v20170914:compile
[INFO] | +- org.eclipse.jetty.websocket:websocket-server:jar:9.4.7.v20170914:compile
[INFO] | | +- org.eclipse.jetty.websocket:websocket-common:jar:9.4.7.v20170914:compile
[INFO] | | | \- org.eclipse.jetty.websocket:websocket-api:jar:9.4.7.v20170914:compile
[INFO] | | +- org.eclipse.jetty.websocket:websocket-client:jar:9.4.7.v20170914:compile
[INFO] | | | \- org.eclipse.jetty:jetty-client:jar:9.4.7.v20170914:compile
[INFO] | | \- org.eclipse.jetty.websocket:websocket-servlet:jar:9.4.7.v20170914:compile
[INFO] | +- org.eclipse.jetty.websocket:javax-websocket-server-impl:jar:9.4.7.v20170914:compile
[INFO] | | +- org.eclipse.jetty:jetty-annotations:jar:9.4.7.v20170914:compile
[INFO] | | | +- org.eclipse.jetty:jetty-plus:jar:9.4.7.v20170914:compile
[INFO] | | | +- javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO] | | | +- org.ow2.asm:asm:jar:5.1:compile
[INFO] | | | \- org.ow2.asm:asm-commons:jar:5.1:compile
[INFO] | | | \- org.ow2.asm:asm-tree:jar:5.1:compile
[INFO] | | +- org.eclipse.jetty.websocket:javax-websocket-client-impl:jar:9.4.7.v20170914:compile
[INFO] | | \- javax.websocket:javax.websocket-api:jar:1.0:compile
[INFO] | \- org.mortbay.jasper:apache-el:jar:8.0.33:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.3.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web-services:jar:1.5.8.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-web:jar:1.5.8.RELEASE:compile
[INFO] | +- org.springframework:spring-oxm:jar:4.3.12.RELEASE:compile
[INFO] | \- org.springframework.ws:spring-ws-core:jar:2.4.0.RELEASE:compile
[INFO] | \- org.springframework.ws:spring-xml:jar:2.4.0.RELEASE:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:5.3.3.Final:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
[INFO] | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | +- org.hibernate.common:hibernate-commons-annotations:jar:5.0.4.Final:compile
[INFO] | +- javax.persistence:javax.persistence-api:jar:2.2:compile
[INFO] | +- net.bytebuddy:byte-buddy:jar:1.8.13:compile
[INFO] | \- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.1.1.Final:compile
[INFO] +- org.hibernate:hibernate-core:jar:5.3.3.Final:compile
[INFO] | +- org.javassist:javassist:jar:3.21.0-GA:compile
[INFO] | +- antlr:antlr:jar:2.7.7:compile
[INFO] | +- org.jboss:jandex:jar:2.0.5.Final:compile
[INFO] | +- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] | \- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
[INFO] +- org.hibernate:hibernate-osgi:jar:5.3.3.Final:compile
[INFO] | +- javax.interceptor:javax.interceptor-api:jar:1.2:compile
[INFO] | +- org.osgi:org.osgi.core:jar:6.0.0:compile
[INFO] | \- org.osgi:org.osgi.compendium:jar:5.0.0:compile
[INFO] +- org.hibernate:hibernate-envers:jar:5.3.3.Final:compile
[INFO] +- org.hibernate:hibernate-hikaricp:jar:5.3.3.Final:compile
[INFO] +- org.hibernate:hibernate-proxool:jar:5.3.3.Final:compile
[INFO] | \- proxool:proxool:jar:0.8.3:compile
[INFO] +- org.infinispan:infinispan-hibernate-cache-v53:jar:9.3.0.Final:compile
[INFO] | +- org.infinispan:infinispan-hibernate-cache-commons:jar:9.3.0.Final:compile
[INFO] | +- org.infinispan:infinispan-hibernate-cache-spi:jar:9.3.0.Final:compile
[INFO] | \- org.infinispan:infinispan-core:jar:9.3.0.Final:compile
[INFO] | +- org.infinispan:infinispan-commons:jar:9.3.0.Final:compile
[INFO] | +- org.jgroups:jgroups:jar:4.0.12.Final:compile
[INFO] | +- com.github.ben-manes.caffeine:caffeine:jar:2.3.5:compile
[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.1.Final:compile
[INFO] | +- org.jboss.marshalling:jboss-marshalling-osgi:jar:2.0.5.Final:compile
[INFO] | \- io.reactivex.rxjava2:rxjava:jar:2.1.3:compile
[INFO] | \- org.reactivestreams:reactive-streams:jar:1.0.1:compile
[INFO] +- org.hibernate:hibernate-ehcache:jar:5.3.3.Final:compile
[INFO] | \- net.sf.ehcache:ehcache:jar:2.10.4:compile
[INFO] +- wsdl4j:wsdl4j:jar:1.6.1:compile
[INFO] +- org.springframework:spring-webmvc:jar:4.3.12.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.3.12.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:4.3.12.RELEASE:compile
[INFO] | +- org.springframework:spring-expression:jar:4.3.12.RELEASE:compile
[INFO] | \- org.springframework:spring-web:jar:4.3.12.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-config:jar:4.2.1.RELEASE:compile
[INFO] | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | \- org.springframework.security:spring-security-core:jar:4.2.3.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-web:jar:4.2.0.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-taglibs:jar:4.2.0.RELEASE:compile
[INFO] | \- org.springframework.security:spring-security-acl:jar:4.2.3.RELEASE:compile
[INFO] +- org.springframework:spring-jdbc:jar:4.3.12.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:5.0.4.RELEASE:compile
[INFO] +- org.springframework:spring-context-support:jar:4.3.12.RELEASE:compile
[INFO] +- org.springframework:spring-tx:jar:4.3.12.RELEASE:compile
[INFO] +- javax.xml.bind:jaxb-api:jar:2.3.0:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO] +- javax.inject:javax.inject:jar:1:compile
[INFO] +- commons-configuration:commons-configuration:jar:1.10:compile
[INFO] | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- commons-lang:commons-lang:jar:2.6:compile
[INFO] +- junit:junit:jar:4.11:test
[INFO] +- org.jdom:jdom:jar:2.0.2:compile
[INFO] +- commons-io:commons-io:jar:2.4:compile
[INFO] +- xalan:xalan:jar:2.7.2:compile
[INFO] | \- xalan:serializer:jar:2.7.2:compile
[INFO] | \- xml-apis:xml-apis:jar:1.4.01:compile
[INFO] +- org.apache.derby:derby:jar:10.11.1.1:compile
[INFO] +- org.postgresql:postgresql:jar:42.1.1:compile
[INFO] +- com.zaxxer:HikariCP:jar:2.6.3:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] +- jaxen:jaxen:jar:1.1.6:compile
[INFO] +- ru.testproject:test-conf:jar:2.4.41-SNAPSHOT:compile
[INFO] | +- log4j:log4j:jar:1.2.16:compile
[INFO] | +- org.slf4j:slf4j-log4j12:jar:1.7.25:compile
[INFO] | \- ru.testproject:test-util:jar:2.4.41-SNAPSHOT:compile
[INFO] +- com.github.spullara.mustache.java:compiler:jar:0.9.0:compile
[INFO] +- org.quartz-scheduler:quartz:jar:2.2.1:compile
[INFO] | \- c3p0:c3p0:jar:0.9.1.1:compile
[INFO] +- javax.json:javax.json-api:jar:1.0:compile
[INFO] +- org.apache.santuario:xmlsec:jar:2.0.6:compile
[INFO] | +- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:compile
[INFO] | | +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] | | \- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
[INFO] | \- commons-codec:commons-codec:jar:1.10:compile
[INFO] +- org.eclipse.jetty:jetty-servlets:jar:9.3.5.v20151012:compile
[INFO] | +- org.eclipse.jetty:jetty-continuation:jar:9.4.7.v20170914:compile
[INFO] | +- org.eclipse.jetty:jetty-http:jar:9.4.7.v20170914:compile
[INFO] | +- org.eclipse.jetty:jetty-util:jar:9.4.7.v20170914:compile
[INFO] | \- org.eclipse.jetty:jetty-io:jar:9.4.7.v20170914:compile
[INFO] +- com.itextpdf:itextpdf:jar:5.5.12:compile
[INFO] +- org.bouncycastle:bcprov-jdk15on:jar:1.55:compile
[INFO] +- org.bouncycastle:bcmail-jdk15on:jar:1.55:compile
[INFO] +- org.bouncycastle:bcpkix-jdk15on:jar:1.55:compile
[INFO] +- com.google.guava:guava:jar:24.0-jre:compile
[INFO] | +- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] | +- org.checkerframework:checker-compat-qual:jar:2.0.0:compile
[INFO] | +- com.google.errorprone:error_prone_annotations:jar:2.1.3:compile
[INFO] | +- com.google.j2objc:j2objc-annotations:jar:1.1:compile
[INFO] | \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.14:compile
[INFO] +- org.dom4j:dom4j:jar:2.1.0:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.10:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.8.10:compile
[INFO] +- commons-net:commons-net:jar:3.6:compile
[INFO] +- org.samba.jcifs:jcifs:jar:1.2.19:compile
[INFO] \- org.reflections:reflections:jar:0.9.11:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.788 s
[INFO] Finished at: 2018-08-22T11:11:41+03:00
[INFO] ------------------------------------------------------------------------
Anyway, I have the same issue at application startup:
Warning: SLF4J: Class path contains multiple SLF4J bindings.
33:08.275 [main] DEBUG org.springframework.boot.logging.ClasspathLoggingApplicationListener - Application failed to start with classpath:
[main] ERROR org.springframework.boot.SpringApplication - Application startup failed
java.lang.NoSuchMethodError: org.springframework.util.ObjectUtils.unwrapOptional(Ljava/lang/Object;)Ljava/lang/Object;
at org.springframework.validation.DataBinder.<init>(DataBinder.java:179)
at org.springframework.boot.bind.RelaxedDataBinder.<init>(RelaxedDataBinder.java:83)
org.springframework.boot.context.config.ConfigFileApplicationListener.postProcessEnvironment(ConfigFileApplicationListener.java:197)
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325)
org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
at ru.testproject.BootConfiguration.main(BootConfiguration.java:26)
cess finished with exit code 1
Problem solved: I fixed the dependency issues. Should use,
#Configuration
#EnableAutoConfiguration
#ComponentScan
#Import(Config.class)
instead #SpringBootApplication annotation. Now the application is getting booted, but cannot find config file which is another story.
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.6:compile (default) on project services: Compiler errors:
error can't determine implemented interfaces of missing type org.springframework.beans.factory.SmartInitializingSingleton
when batch building BuildConfig[null] #Files=2845 AopXmls=#0
[Xlint:cantFindType]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.codehaus.mojo.aspectj.CompilationFailedException: Compiler errors:
error can't determine implemented interfaces of missing type org.springframework.beans.factory.SmartInitializingSingleton
when batch building BuildConfig[null] #Files=2845 AopXmls=#0
[Xlint:cantFindType]
Below is the pom.xml
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
versionUpgrade-SNAPSHOT
jar
CFT services layer
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<pluginRepositories>
<pluginRepository>
<id>Finxera</id>
<name>Finxera Repo</name>
<url>http://10.10.200.125:8081/nexus/content/groups/public</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
<build>
<defaultGoal>install</defaultGoal>
<!-- enable filtering on the CPIISRV-revision.properties -->
<filters>
<filter>src/main/resources/CPIISERVICES-revision.properties</filter>
</filters>
<!--enable resourcing in resources folder for all the properties files -->
<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<!-- <version>2.0.1</version> -->
<version>3.0.0</version>
<configuration>
<findbugsXmlOutput>true</findbugsXmlOutput>
<findbugsXmlWithMessages>true</findbugsXmlWithMessages>
<xmlOutput>true</xmlOutput>
</configuration>
</plugin>
<!--This plugin increase the size of maven memory -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.2</version>
<configuration>
<argLine>-Xmx1024m</argLine>
<disableXmlReport>true</disableXmlReport>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.7</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
<wtpversion>1.5</wtpversion>
</configuration>
</plugin>
<plugin>
<artifactId>maven-idea-plugin</artifactId>
<version>2.2</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
<dependenciesAsLibraries>true</dependenciesAsLibraries>
<useFullNames>false</useFullNames>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<!-- <version>1.5</version> -->
<version>1.6</version>
<configuration>
<source>1.7</source>
<verbose>true</verbose>
<complianceLevel>1.7</complianceLevel>
<showWeaveInfo>true</showWeaveInfo>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>${aspectj.version}</version>
</dependency>
<!-- Added for Stack Upgrade begins -->
<!-- <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId>
<version>4.0.4.RELEASE</version> </dependency> <dependency> <groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId> <version>1.8.1</version> </dependency> -->
<!-- https://mvnrepository.com/artifact/javax.transaction/javax.transaction-api -->
<!-- <dependency> <groupId>javax.transaction</groupId> <artifactId>javax.transaction-api</artifactId>
<version>1.2</version> </dependency> -->
<!-- Added for Stack Upgrade ends -->
</dependencies>
</plugin>
<plugin>
<!--<groupId>com.sun.tools.xjc.maven2</groupId> <artifactId>maven-jaxb-plugin</artifactId>
<version>1.1.1</version> -->
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.12.3</version>
<!-- <groupId>org.codehaus.mojo</groupId> <artifactId>jaxb2-maven-plugin</artifactId>
<version>1.6</version> -->
<executions>
<execution>
<id>kyc</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generatePackage>net.nationalpayment.core.services.external.exp</generatePackage>
<schemaDirectory>src/main/resources/kyc/</schemaDirectory>
<generateDirectory>${project.build.directory}/generated-sources/kyc</generateDirectory>
<verbose>true</verbose>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.2</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>javax.transaction-api</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<!-- <version>2.0.2</version> -->
<version>3.2.5.RELEASE</version>
<exclusions>
<exclusion>
<!-- declare the exclusion here -->
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
<!--<scope>test</scope> -->
<exclusions>
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
</dependencies>
<properties>
<current.build.version>versionUpgrade-SNAPSHOT</current.build.version>
<!-- Application settings -->
<dao.framework>hibernate</dao.framework>
<web.framework>spring</web.framework>
<aspectj.version>1.7.4</aspectj.version>
<commons.fileupload.version>1.2.1</commons.fileupload.version>
<commons.io.version>1.3.2</commons.io.version>
<hibernate.version>4.0.1.Final</hibernate.version>
<spring.version>4.2.3.RELEASE</spring.version>
<springmodules.validation.version>0.8</springmodules.validation.version>
</properties>
Output of mvn dependency:tree. Could not paste entire out due to text length constraint. Removed all messages related to download and downloaded. Please bear with me as i am new to maven.
Apples-MacBook-Pro-2:services vimal$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO] net.nationalpayment.cp20:services:jar:versionUpgrade-SNAPSHOT
[INFO] +- javax.cache:cache-api:jar:1.0.0:compile
[INFO] +- javax.transaction:javax.transaction-api:jar:1.2:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.28:compile
[INFO] +- org.easymock:easymock:jar:2.2:test
[INFO] +- junit:junit:jar:4.4:test
[INFO] +- org.springframework:spring-test:jar:4.2.3.RELEASE:test
[INFO] | \- org.springframework:spring-core:jar:4.2.3.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-core:jar:2.0.2:compile
[INFO] | +- org.springframework:spring-support:jar:2.0.8:runtime
[INFO] | \- commons-collections:commons-collections:jar:3.2:compile
[INFO] +- commons-codec:commons-codec:jar:1.4:compile
[INFO] +- org.docx4j:docx4j:jar:3.1.0:compile
[INFO] | +- org.plutext:jaxb-svg11:jar:1.0.2:compile
[INFO] | +- org.plutext:jaxb-xslfo:jar:1.0.1:compile
[INFO] | +- org.plutext:jaxb-xmldsig-core:jar:1.0.0:compile
[INFO] | +- net.engio:mbassador:jar:1.1.10:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.2:compile
[INFO] | +- org.slf4j:slf4j-log4j12:jar:1.7.5:compile
[INFO] | +- org.apache.xmlgraphics:xmlgraphics-commons:jar:1.5:compile
[INFO] | +- org.apache.avalon.framework:avalon-framework-api:jar:4.3.1:compile
[INFO] | +- org.apache.avalon.framework:avalon-framework-impl:jar:4.3.1:compile
[INFO] | +- net.arnx:wmf2svg:jar:0.9.0:compile
[INFO] | +- org.apache.poi:poi-scratchpad:jar:3.8:compile
[INFO] | +- org.antlr:antlr-runtime:jar:3.3:compile
[INFO] | \- org.antlr:stringtemplate:jar:3.2.1:compile
[INFO] +- com.finxera:FinxeraEncryptionUtility:jar:1.3:compile
[INFO] | +- com.amazonaws:aws-java-sdk:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-support:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-simpledb:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-simpleworkflow:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-storagegateway:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-route53:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-s3:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-importexport:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-sts:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-sqs:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-rds:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-redshift:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-elasticbeanstalk:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-glacier:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-iam:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-datapipeline:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-elasticloadbalancing:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-emr:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-elasticache:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-elastictranscoder:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-ec2:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-dynamodb:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-sns:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cloudtrail:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cloudwatch:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-logs:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cognitoidentity:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cognitosync:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-directconnect:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cloudformation:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cloudfront:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-kinesis:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-opsworks:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-ses:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-autoscaling:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cloudsearch:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cloudwatchmetrics:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-swf-libraries:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-codedeploy:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-config:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-lambda:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-ecs:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cloudhsm:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-ssm:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-workspaces:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-machinelearning:jar:1.9.33:compile
[INFO] | | \- com.amazonaws:aws-java-sdk-core:jar:1.9.33:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-databind:jar:2.3.2:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.3.0:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.3.2:compile
[INFO] | +- com.amazonaws:aws-java-sdk-kms:jar:1.9.33:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] | +- ch.qos.logback:logback-core:jar:1.0.0:compile
[INFO] | +- ch.qos.logback:logback-classic:jar:1.0.0:compile
[INFO] | +- com.jamonapi:jamon:jar:2.4:compile
[INFO] | \- com.google.guava:guava:jar:18.0:compile
[INFO] +- net.nationalpayment.sml:sml-framework:jar:1.0:compile
[INFO] | +- net.nationalpayment.sml:sml-model:jar:1.0:compile
[INFO] | | \- com.legsem.legstar:legstar-coxbapi:jar:1.5.8:compile
[INFO] | | \- org.codehaus.jackson:jackson-xc:jar:1.6.0:compile
[INFO] | \- com.legsem.legstar:legstar-coxbrt:jar:1.5.8:compile
[INFO] +- org.apache.poi:poi:jar:3.8:compile
[INFO] +- org.apache.poi:poi-ooxml:jar:3.8:compile
[INFO] | \- dom4j:dom4j:jar:1.6.1:compile
[INFO] +- org.apache.poi:poi-ooxml-schemas:jar:3.8:compile
[INFO] | \- org.apache.xmlbeans:xmlbeans:jar:2.3.0:compile
[INFO] | \- stax:stax-api:jar:1.0.1:compile
[INFO] +- joda-time:joda-time:jar:2.9.4:compile
[INFO] +- commons-net:commons-net:jar:2.0:compile
[INFO] +- bai-parser:bai-parser:jar:1.1:compile
[INFO] +- org.apache.commons:commons-vfs2:jar:2.0:compile
[INFO] | +- org.apache.maven.scm:maven-scm-api:jar:1.4:compile
[INFO] | | \- org.codehaus.plexus:plexus-utils:jar:1.5.6:compile
[INFO] | \- org.apache.maven.scm:maven-scm-provider-svnexe:jar:1.4:compile
[INFO] | +- org.apache.maven.scm:maven-scm-provider-svn-commons:jar:1.4:compile
[INFO] | \- regexp:regexp:jar:1.3:compile
[INFO] +- com.jcraft:jsch:jar:0.1.49:compile
[INFO] +- commons-io:commons-io:jar:1.4:compile
[INFO] +- org.springframework:spring-orm:jar:4.2.3.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:4.2.3.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:4.2.3.RELEASE:compile
[INFO] +- org.springframework:spring-aop:jar:4.2.3.RELEASE:compile
[INFO] | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- org.springframework:spring-jdbc:jar:4.2.3.RELEASE:runtime
[INFO] +- org.springframework:spring-aspects:jar:4.2.3.RELEASE:compile
[INFO] | \- org.aspectj:aspectjweaver:jar:1.8.7:compile
[INFO] +- org.springframework:spring-context-support:jar:4.2.3.RELEASE:compile
[INFO] | \- org.springframework:spring-context:jar:4.2.3.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.2.3.RELEASE:compile
[INFO] +- javax.mail:mail:jar:1.4:compile
[INFO] | \- javax.activation:activation:jar:1.1:compile
[INFO] +- org.apache.velocity:velocity:jar:1.5:compile
[INFO] | \- oro:oro:jar:2.0.8:compile
[INFO] +- org.bouncycastle:bcprov-jdk16:jar:1.45:compile
[INFO] +- org.bouncycastle:bcpg-jdk16:jar:1.45:compile
[INFO] +- org.bouncycastle:bcmail-jdk16:jar:1.45:compile
[INFO] +- org.jasypt:jasypt:jar:1.6:compile
[INFO] +- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.2.3:compile
[INFO] | \- org.apache.httpcomponents:httpcore:jar:4.2.2:compile
[INFO] +- org.ostermiller:utils:jar:1.07.00:compile
[INFO] +- org.apache.xmlgraphics:fop:jar:1.0:compile
[INFO] | +- org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-anim:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-css:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-dom:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-parser:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-util:jar:1.7:compile
[INFO] | | \- xml-apis:xml-apis-ext:jar:1.3.04:compile
[INFO] | +- org.apache.xmlgraphics:batik-bridge:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-script:jar:1.7:compile
[INFO] | | | \- org.apache.xmlgraphics:batik-js:jar:1.7:compile
[INFO] | | \- org.apache.xmlgraphics:batik-xml:jar:1.7:compile
[INFO] | +- org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile
[INFO] | +- org.apache.xmlgraphics:batik-gvt:jar:1.7:compile
[INFO] | +- org.apache.xmlgraphics:batik-transcoder:jar:1.7:compile
[INFO] | | \- org.apache.xmlgraphics:batik-svggen:jar:1.7:compile
[INFO] | +- org.apache.xmlgraphics:batik-extension:jar:1.7:compile
[INFO] | \- org.apache.xmlgraphics:batik-ext:jar:1.7:compile
[INFO] +- javax.xml:jaxrpc-api:jar:1.1:compile
[INFO] +- axis:axis:jar:1.4:compile
[INFO] | +- org.apache.axis:axis-jaxrpc:jar:1.4:compile
[INFO] | +- org.apache.axis:axis-saaj:jar:1.4:compile
[INFO] | \- commons-discovery:commons-discovery:jar:0.2:runtime
[INFO] +- org.apache.axis2:axis2-kernel:jar:1.4:compile
[INFO] | +- javax.servlet:servlet-api:jar:2.3:compile
[INFO] | +- commons-fileupload:commons-fileupload:jar:1.2:compile
[INFO] | +- org.apache.httpcomponents:httpcore-nio:jar:4.0-beta1:compile
[INFO] | +- wsdl4j:wsdl4j:jar:1.6.2:compile
[INFO] | +- backport-util-concurrent:backport-util-concurrent:jar:3.1:compile
[INFO] | +- org.codehaus.woodstox:wstx-asl:jar:3.2.4:compile
[INFO] | +- org.apache.ws.commons.schema:XmlSchema:jar:1.4.2:compile
[INFO] | +- org.apache.neethi:neethi:jar:2.0.4:compile
[INFO] | +- org.apache.woden:woden-api:jar:1.0M8:compile
[INFO] | | +- org.apache.ant:ant:jar:1.7.0:compile
[INFO] | | | \- org.apache.ant:ant-launcher:jar:1.7.0:compile
[INFO] | | \- xerces:xmlParserAPIs:jar:2.6.0:compile
[INFO] | +- org.apache.woden:woden-impl-dom:jar:1.0M8:compile
[INFO] | +- annogen:annogen:jar:0.1.0:compile
[INFO] | +- org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1:compile
[INFO] | +- org.apache.ws.commons.axiom:axiom-dom:jar:1.2.7:compile
[INFO] | \- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:compile
[INFO] +- org.apache.axis2:axis2-adb:jar:1.4:compile
[INFO] | \- org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.0.1:compile
[INFO] +- org.apache.ws.commons.axiom:axiom-api:jar:1.2.7:compile
[INFO] | +- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.2:compile
[INFO] | +- jaxen:jaxen:jar:1.1.1:compile
[INFO] | \- xml-apis:xml-apis:jar:1.3.04:compile
[INFO] +- org.apache.axis2:axis2:jar:1.4:compile
[INFO] +- org.apache.ws.commons.axiom:axiom-impl:jar:1.2.7:compile
[INFO] +- org.jdom:jdom:jar:1.1:compile
[INFO] +- org.codehaus.castor:castor-xml:jar:1.3.1:compile
[INFO] | \- org.codehaus.castor:castor-core:jar:1.3.1:compile
[INFO] +- org.codehaus.castor:spring-xml:jar:1.2.1:compile
[INFO] +- com.itextpdf:itextpdf:jar:5.1.3:compile
[INFO] +- com.lowagie:itext:jar:2.0.7:compile
[INFO] +- net.sf.jxls:jxls-core:jar:1.0-RC-2:compile
[INFO] | +- commons-beanutils:commons-beanutils:jar:1.8.2:compile
[INFO] | +- commons-digester:commons-digester:jar:2.0:compile
[INFO] | \- org.apache.commons:commons-jexl:jar:2.0.1:compile
[INFO] +- xerces:xercesImpl:jar:2.9.1:compile
[INFO] +- org.cdgsoftware:x937-BBX:jar:0.1.4.8:compile
[INFO] | +- com.sun.media:jai_codec:jar:1.1.3:compile
[INFO] | \- javax.media:jai_core:jar:1.1.3:compile
[INFO] +- org.bancbox.payment21:bancbox-payment21:jar:1.0.1:compile
[INFO] | +- org.apache.cxf:cxf-rt-frontend-jaxws:jar:2.7.3:compile
[INFO] | | +- xml-resolver:xml-resolver:jar:1.2:compile
[INFO] | | +- org.apache.cxf:cxf-api:jar:2.7.3:compile
[INFO] | | | \- org.codehaus.woodstox:woodstox-core-asl:jar:4.1.4:runtime
[INFO] | | | \- org.codehaus.woodstox:stax2-api:jar:3.1.1:runtime
[INFO] | | +- org.apache.cxf:cxf-rt-core:jar:2.7.3:compile
[INFO] | | +- org.apache.cxf:cxf-rt-bindings-soap:jar:2.7.3:compile
[INFO] | | | \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:2.7.3:compile
[INFO] | | +- org.apache.cxf:cxf-rt-bindings-xml:jar:2.7.3:compile
[INFO] | | +- org.apache.cxf:cxf-rt-frontend-simple:jar:2.7.3:compile
[INFO] | | \- org.apache.cxf:cxf-rt-ws-addr:jar:2.7.3:compile
[INFO] | | \- org.apache.cxf:cxf-rt-ws-policy:jar:2.7.3:compile
[INFO] | +- org.apache.cxf:cxf-rt-transports-http:jar:2.7.3:compile
[INFO] | \- org.apache.cxf:cxf-rt-ws-security:jar:2.7.3:compile
[INFO] | \- org.apache.ws.security:wss4j:jar:1.6.9:compile
[INFO] | +- org.apache.santuario:xmlsec:jar:1.5.3:compile
[INFO] | \- org.opensaml:opensaml:jar:2.5.1-1:compile
[INFO] | \- org.opensaml:openws:jar:1.4.2-1:compile
[INFO] | \- org.opensaml:xmltooling:jar:1.3.2-1:compile
[INFO] +- com.paypal:paypal_stubs:jar:4.3.1:compile
[INFO] +- com.paypal:paypal_base:jar:4.3.1:compile
[INFO] +- commons-configuration:commons-configuration:jar:1.8:compile
[INFO] +- com.bancbox:generate-key:jar:1.0.0:compile
[INFO] | +- org.apache.commons:commons-math3:jar:3.0:compile
[INFO] | \- commons-cli:commons-cli:jar:1.2:compile
[INFO] +- com.braintreepayments.gateway:braintree-java:jar:2.46.0:compile
[INFO] +- com.chrislaforetsoftware:fedwireparser:jar:1.0:compile
[INFO] +- com.litle:litle-sdk-for-java:jar:8.17.0:compile
[INFO] | +- org.apache.httpcomponents:fluent-hc:jar:4.2.3:compile
[INFO] | +- org.apache.httpcomponents:httpclient-cache:jar:4.2.3:compile
[INFO] | +- org.apache.httpcomponents:httpmime:jar:4.2.3:compile
[INFO] | +- javax.xml.bind:jaxb-api:jar:2.2.6:compile
[INFO] | +- com.sun.xml.bind:jaxb-impl:jar:2.2.6:compile
[INFO] | \- javax.xml:jsr173:jar:1.0:compile
[INFO] +- xalan:xalan:jar:2.7.1:compile
[INFO] | \- xalan:serializer:jar:2.7.1:compile
[INFO] +- com.google.code.gson:gson:jar:2.3.1:compile
[INFO] +- com.github.ffpojo:ffpojo:jar:1.0:compile
[INFO] +- cglib:cglib:jar:2.2:compile
[INFO] | \- asm:asm:jar:3.1:compile
[INFO] +- au.com.bytecode:opencsv:jar:2.4:compile
[INFO] +- org.dbunit:dbunit:jar:2.2:test
[INFO] | \- junit-addons:junit-addons:jar:1.4:test
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
[INFO] +- org.hibernate:hibernate-core:jar:4.0.1.Final:compile
[INFO] | +- antlr:antlr:jar:2.7.7:compile
[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.0.Final:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.1.0.CR2:compile
[INFO] | +- org.javassist:javassist:jar:3.15.0-GA:compile
[INFO] | \- org.hibernate.common:hibernate-commons-annotations:jar:4.0.1.Final:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:4.0.1.Final:compile
[INFO] +- geronimo-spec:geronimo-spec-jta:jar:1.0.1B-rc4:provided
[INFO] +- commons-logging:commons-logging:jar:1.1.3:compile
[INFO] +- net.sf.ehcache:ehcache-core:jar:2.2.0:compile
[INFO] +- commons-validator:commons-validator:jar:1.4.0:compile
[INFO] +- commons-lang:commons-lang:jar:2.5:compile
[INFO] +- log4j:log4j:jar:1.2.14:compile
[INFO] +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] +- de.odysseus.staxon:staxon:jar:1.3:compile
[INFO] +- org.apache.lucene:lucene-core:jar:5.4.1:compile
[INFO] +- org.apache.lucene:lucene-analyzers-common:jar:5.4.1:compile
[INFO] +- org.apache.lucene:lucene-queryparser:jar:5.4.1:compile
[INFO] | \- org.apache.lucene:lucene-sandbox:jar:5.4.1:compile
[INFO] +- org.apache.lucene:lucene-queries:jar:5.4.1:compile
[INFO] \- com.rabbitmq:amqp-client:jar:3.4.1:compile
[INFO]
[INFO] BUILD SUCCESS
[INFO] Total time: 2:08.333s
[INFO] Finished at: Tue Aug 30 12:11:28 IST 2016
[INFO] Final Memory: 21M/200M
I am using Spring 4.2.3.RELEASE.
Thanks in advance.
Recommended Options
Go to spring boot initializr site, select spring security stack as shown in below and generate the sample application/pom file and refactor your dependencies accordingly.
As spring-boot uses the concept of opinionated dependencies and Bill of Materials, it will pull up your appropriate version of your dependencies which will resolve your jar conflict.
SmartInitializingSingleton may require newer version of Spring than the version, which is in your pom:
<version>3.2.5.RELEASE</version>
Try:
<version>4.2.3.RELEASE</version>
You may be also mising various versions of Spring in your pom file. Put the same version in all Spring dependencies.
I have an interesting issue and have not been able to find a solution anywhere. I am trying to integrate spring cloud consul to my existing spring boot service application. So far all I have done is add the spring cloud consul dependencies to my POM. I have made zero changes to any classes in my service application.
I originally had changes to my classes, but kept getting this error. I thought maybe something I changed in the code caused it, but no.. that wasn't it. It is giving me this error just from adding it to the POM. To clarify, I can mvn clean compile package successfully, error is only when I try to run my spring boot application.
I followed this guide exactly: http://cloud.spring.io/spring-cloud-consul/ to add dependencies to my POM.
Here is the error:
java -jar ./target/app.jar --endpoints.restart.enabled=true --endpoints.shutdown.enabled=true --logging.config=file:./config/logback.xml
java.lang.reflect.InvocationTargetException
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:497)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Failed to introspect annotations: class org.springframework.cloud.consul.config.ConsulConfigBootstrapConfiguration
at org.springframework.core.annotation.AnnotatedElementUtils.process(AnnotatedElementUtils.java:166)
at org.springframework.core.annotation.AnnotatedElementUtils.isAnnotated(AnnotatedElementUtils.java:73)
at org.springframework.core.type.StandardAnnotationMetadata.isAnnotated(StandardAnnotationMetadata.java:102)
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:74)
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:64)
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:140)
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:127)
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.register(AnnotatedBeanDefinitionReader.java:122)
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:159)
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:135)
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:127)
at org.springframework.boot.SpringApplication.load(SpringApplication.java:615)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:125)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:75)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:1)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:100)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:59)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:285)
at com.idanalytics.service.ServiceApplication.main(ServiceApplication.java:41)
... 6 more
Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724)
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355)
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)
at java.lang.Class.createAnnotationData(Class.java:3521)
at java.lang.Class.annotationData(Class.java:3510)
at java.lang.Class.getAnnotations(Class.java:3446)
at org.springframework.core.annotation.AnnotatedElementUtils.doProcess(AnnotatedElementUtils.java:192)
at org.springframework.core.annotation.AnnotatedElementUtils.doProcess(AnnotatedElementUtils.java:209)
at org.springframework.core.annotation.AnnotatedElementUtils.process(AnnotatedElementUtils.java:162)
... 28 more
Any ideas on what could be the problem? I haven't added any new annotations. The app works fine when I remove the consul dependencies from my POM file.
EDIT: Here is the dependency tree
[INFO] com.internal:test-service:jar:1.0.0-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter:jar:1.2.3.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot:jar:1.2.3.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.2.3.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-logging:jar:1.2.3.RELEASE:compile
[INFO] | | +- org.slf4j:jcl-over-slf4j:jar:1.7.11:compile
[INFO] | | | \- org.slf4j:slf4j-api:jar:1.7.11:compile
[INFO] | | +- org.slf4j:jul-to-slf4j:jar:1.7.11:compile
[INFO] | | +- org.slf4j:log4j-over-slf4j:jar:1.7.11:compile
[INFO] | | \- ch.qos.logback:logback-classic:jar:1.1.3:compile
[INFO] | | \- ch.qos.logback:logback-core:jar:1.1.3:compile
[INFO] | +- org.springframework:spring-core:jar:4.1.6.RELEASE:compile
[INFO] | \- org.yaml:snakeyaml:jar:1.14:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.2.3.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.2.3.RELEASE:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.20:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.20:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.20:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.20:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.4.5:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.5:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.4.5:compile
[INFO] | +- org.hibernate:hibernate-validator:jar:5.1.3.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.0.0:compile
[INFO] | +- org.springframework:spring-web:jar:4.1.6.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:4.1.6.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.1.6.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:1.2.3.RELEASE:compile
[INFO] | \- org.springframework.boot:spring-boot-actuator:jar:1.2.3.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-integration:jar:1.2.3.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:1.2.3.RELEASE:compile
[INFO] | | +- org.aspectj:aspectjrt:jar:1.8.5:compile
[INFO] | | \- org.aspectj:aspectjweaver:jar:1.8.5:compile
[INFO] | +- org.springframework:spring-messaging:jar:4.1.6.RELEASE:compile
[INFO] | +- org.springframework:spring-tx:jar:4.1.6.RELEASE:compile
[INFO] | +- org.springframework.integration:spring-integration-core:jar:4.1.2.RELEASE:compile
[INFO] | | +- org.projectreactor:reactor-core:jar:1.1.6.RELEASE:compile
[INFO] | | | +- com.goldmansachs:gs-collections:jar:5.1.0:compile
[INFO] | | | | \- com.goldmansachs:gs-collections-api:jar:5.1.0:compile
[INFO] | | | +- com.lmax:disruptor:jar:3.2.1:compile
[INFO] | | | \- io.gatling:jsr166e:jar:1.0:compile
[INFO] | | \- org.springframework.retry:spring-retry:jar:1.1.1.RELEASE:compile
[INFO] | +- org.springframework.integration:spring-integration-file:jar:4.1.2.RELEASE:compile
[INFO] | | \- commons-io:commons-io:jar:2.4:compile
[INFO] | +- org.springframework.integration:spring-integration-http:jar:4.1.2.RELEASE:compile
[INFO] | +- org.springframework.integration:spring-integration-ip:jar:4.1.2.RELEASE:compile
[INFO] | \- org.springframework.integration:spring-integration-stream:jar:4.1.2.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.2.3.RELEASE:compile
[INFO] | +- org.springframework:spring-jdbc:jar:4.1.6.RELEASE:compile
[INFO] | \- org.apache.tomcat:tomcat-jdbc:jar:8.0.20:compile
[INFO] | \- org.apache.tomcat:tomcat-juli:jar:8.0.20:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter-consul-all:jar:1.0.1.RELEASE:compile
[INFO] | +- org.springframework.cloud:spring-cloud-starter-consul-config:jar:1.0.1.RELEASE:compile
[INFO] | | +- org.springframework.cloud:spring-cloud-starter-consul:jar:1.0.1.RELEASE:compile
[INFO] | | | +- org.springframework.cloud:spring-cloud-commons:jar:1.1.0.RELEASE:compile
[INFO] | | | +- org.springframework.cloud:spring-cloud-consul-core:jar:1.0.1.RELEASE:compile
[INFO] | | | +- com.ecwid.consul:consul-api:jar:1.1.10:compile
[INFO] | | | \- com.google.code.gson:gson:jar:2.3.1:compile
[INFO] | | +- org.springframework.cloud:spring-cloud-consul-config:jar:1.0.1.RELEASE:compile
[INFO] | | \- org.springframework.cloud:spring-cloud-context:jar:1.1.0.RELEASE:compile
[INFO] | \- org.springframework.cloud:spring-cloud-starter-consul-discovery:jar:1.0.1.RELEASE:compile
[INFO] | +- org.springframework.cloud:spring-cloud-consul-discovery:jar:1.0.1.RELEASE:compile
[INFO] | +- org.springframework.cloud:spring-cloud-netflix-core:jar:1.1.1.RELEASE:compile
[INFO] | +- org.springframework.cloud:spring-cloud-starter-ribbon:jar:1.1.1.RELEASE:compile
[INFO] | | +- org.springframework.cloud:spring-cloud-starter:jar:1.1.0.RELEASE:compile
[INFO] | | | \- org.springframework.security:spring-security-rsa:jar:1.0.1.RELEASE:compile
[INFO] | | | \- org.bouncycastle:bcpkix-jdk15on:jar:1.47:compile
[INFO] | | | \- org.bouncycastle:bcprov-jdk15on:jar:1.47:compile
[INFO] | | +- org.springframework.cloud:spring-cloud-starter-archaius:jar:1.1.1.RELEASE:compile
[INFO] | | | +- com.netflix.archaius:archaius-core:jar:0.7.4:compile
[INFO] | | | | \- com.google.code.findbugs:jsr305:jar:3.0.1:runtime
[INFO] | | | +- commons-configuration:commons-configuration:jar:1.8:compile
[INFO] | | | | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] | | | \- com.google.guava:guava:jar:18.0:compile
[INFO] | | +- com.netflix.ribbon:ribbon:jar:2.2.0:compile
[INFO] | | | +- com.netflix.ribbon:ribbon-transport:jar:2.2.0:runtime
[INFO] | | | | +- io.reactivex:rxnetty-contexts:jar:0.4.9:runtime
[INFO] | | | | \- io.reactivex:rxnetty-servo:jar:0.4.9:runtime
[INFO] | | | +- com.netflix.hystrix:hystrix-core:jar:1.5.3:runtime
[INFO] | | | | \- org.hdrhistogram:HdrHistogram:jar:2.1.7:runtime
[INFO] | | | +- javax.inject:javax.inject:jar:1:runtime
[INFO] | | | \- io.reactivex:rxnetty:jar:0.4.9:runtime
[INFO] | | | +- io.netty:netty-codec-http:jar:4.0.27.Final:runtime
[INFO] | | | | +- io.netty:netty-codec:jar:4.0.27.Final:runtime
[INFO] | | | | \- io.netty:netty-handler:jar:4.0.27.Final:runtime
[INFO] | | | \- io.netty:netty-transport-native-epoll:jar:4.0.27.Final:runtime
[INFO] | | | +- io.netty:netty-common:jar:4.0.27.Final:runtime
[INFO] | | | +- io.netty:netty-buffer:jar:4.0.27.Final:runtime
[INFO] | | | \- io.netty:netty-transport:jar:4.0.27.Final:runtime
[INFO] | | +- com.netflix.ribbon:ribbon-core:jar:2.2.0:compile
[INFO] | | | \- commons-lang:commons-lang:jar:2.6:compile
[INFO] | | +- com.netflix.ribbon:ribbon-httpclient:jar:2.2.0:compile
[INFO] | | | +- commons-collections:commons-collections:jar:3.2.1:runtime
[INFO] | | | +- com.sun.jersey.contribs:jersey-apache-client4:jar:1.19.1:runtime
[INFO] | | | +- com.netflix.servo:servo-core:jar:0.10.1:runtime
[INFO] | | | | \- com.netflix.servo:servo-internal:jar:0.10.1:runtime
[INFO] | | | \- com.netflix.netflix-commons:netflix-commons-util:jar:0.1.1:runtime
[INFO] | | +- com.netflix.ribbon:ribbon-loadbalancer:jar:2.2.0:compile
[INFO] | | | \- com.netflix.netflix-commons:netflix-statistics:jar:0.1.1:runtime
[INFO] | | \- io.reactivex:rxjava:jar:1.1.5:compile
[INFO] | \- joda-time:joda-time:jar:2.5:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.6:compile
[INFO] +- org.springframework.cloud:spring-cloud-config-client:jar:1.0.0.RELEASE:compile
[INFO] | \- org.springframework.security:spring-security-crypto:jar:3.2.7.RELEASE:compile
[INFO] +- com.internal:rest-utility:jar:1.0.3:compile
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.3.2:compile
[INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.1:compile
[INFO] | \- commons-codec:commons-codec:jar:1.6:compile
[INFO] +- org.springframework:spring-jms:jar:4.1.6.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.1.6.RELEASE:compile
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | +- org.springframework:spring-beans:jar:4.1.6.RELEASE:compile
[INFO] | \- org.springframework:spring-context:jar:4.1.6.RELEASE:compile
[INFO] +- org.springframework.integration:spring-integration-jms:jar:4.1.2.RELEASE:compile
[INFO] +- com.swiftmq:springsupport:jar:9.0.0:compile
[INFO] +- javax.jms:jms-api:jar:1.1-rev-1:compile
[INFO] +- com.swiftmq:swiftmq:jar:9.0.0:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.4:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.2.3.RELEASE:test
[INFO] | +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | | \- org.objenesis:objenesis:jar:2.1:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] | \- org.springframework:spring-test:jar:4.1.6.RELEASE:test
[INFO] +- com.internal:keystore-client:jar:2.46.0:compile
[INFO] | +- com.sun.jersey:jersey-client:jar:1.19.1:compile
[INFO] | | \- com.sun.jersey:jersey-core:jar:1.19.1:compile
[INFO] | | \- javax.ws.rs:jsr311-api:jar:1.1.1:compile
[INFO] | +- com.sun.jersey:jersey-json:jar:1.7:compile
[INFO] | | +- org.codehaus.jettison:jettison:jar:1.1:compile
[INFO] | | | \- stax:stax-api:jar:1.0.1:compile
[INFO] | | +- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile
[INFO] | | | \- javax.xml.bind:jaxb-api:jar:2.2.2:compile
[INFO] | | | +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] | | | \- javax.activation:activation:jar:1.1:compile
[INFO] | | +- org.codehaus.jackson:jackson-core-asl:jar:1.7.1:compile
[INFO] | | +- org.codehaus.jackson:jackson-mapper-asl:jar:1.7.1:compile
[INFO] | | +- org.codehaus.jackson:jackson-jaxrs:jar:1.7.1:compile
[INFO] | | \- org.codehaus.jackson:jackson-xc:jar:1.7.1:compile
[INFO] | +- net.iharder:base64:jar:2.3.8:compile
[INFO] | +- commons-pool:commons-pool:jar:1.6:compile
[INFO] | \- log4j:log4j:jar:1.2.17:compile
[INFO] +- junit:junit:jar:4.12:test
[INFO] \- org.mockito:mockito-all:jar:1.10.19:test
EDIT: I changed the version specified with my maven plugin to 1.3.5 and am now getting a different error. Here is my POM:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.internal</groupId>
<artifactId>service-parent</artifactId>
<version>1.0.4</version>
</parent>
<artifactId>testSVC</artifactId>
<groupId>com.internal</groupId>
<version>1.0.0-SNAPSHOT</version>
<name>Test Service</name>
<description>My first service</description>
<properties>
<main.basedir>${basedir}/../..</main.basedir>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-all</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
<!-- <scope>runtime</scope> -->
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-client</artifactId>
<version>${spring-cloud-config-ga}</version>
</dependency>
<dependency>
<groupId>com.internal</groupId>
<artifactId>rest-utility</artifactId>
<version>[1.0.0,1.0.99)</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-jms</artifactId>
</dependency>
<dependency>
<groupId>com.swiftmq</groupId>
<artifactId>springsupport</artifactId>
<version>${swiftmq-version}</version>
</dependency>
<dependency>
<groupId>javax.jms</groupId>
<artifactId>jms-api</artifactId>
</dependency>
<dependency>
<groupId>com.swiftmq</groupId>
<artifactId>swiftmq</artifactId>
<version>${swiftmq-version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.3.5.RELEASE</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptor>src/assembly/bin.xml</descriptor>
<finalName>testSVC</finalName>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-consul-dependencies</artifactId>
<version>1.0.1.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
new error:
Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:62)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
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:497)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:54)
... 1 more
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/Banner$Mode
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:121)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:84)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:1)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:100)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:59)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:285)
at com.idanalytics.service.ServiceApplication.main(ServiceApplication.java:38)
... 6 more
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.Banner$Mode
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at org.springframework.boot.loader.LaunchedURLClassLoader.doLoadClass(LaunchedURLClassLoader.java:178)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:142)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Are you mixing two different versions of Spring? Can you include the output of mvn dependency:tree here?
Update
Based on the output of mvn dependency:tree, I can see that adding the dependency org.springframework.cloud:spring-cloud-starter-consul-all:1.0.1.RELEASE normally depends on Spring Boot 1.3.5.RELEASE, but you are including an older Spring Boot 1.2.3.RELEASE version in your POM.
Can you update your POM to use a consistent 1.3.5.RELEASE version of Spring Boot? If possible, try to remove any explicit dependency declarations for Spring Boot and Spring Framework in your POM , and let spring-cloud-starter-consul-all include them for you.