Spring boot with websphere 8.5.5 - UOWManager transaction processing failed - java

I am getting this exception when the web app is started(Via URL), it seems to be JTA dependency issue but I am unable to fix it. This works on Tomcat but fails on Websphere.
Stack trace
org.springframework.transaction.TransactionSystemException: UOWManager transaction processing failed; nested exception is com.ibm.wsspi.uow.UOWException: java.lang.LinkageError: com/ibm/websphere/uow/UOWSynchronizationRegistry.registerInterposedSynchronization(Ljavax/transaction/Synchronization;)V (loaded from file:/home/parag/IBM/WebSphere/AppServer/plugins/com.ibm.ws.runtime.jar by org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader#52adb42a) called from class org.springframework.transaction.jta.WebSphereUowTransactionManager$UOWActionAdapter (loaded from file:/home/parag/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/parag-desktopNode01Cell/eplvc-0_0_5_war.ear/eplvc-0.0.5.war/WEB-INF/lib/spring-tx-4.3.18.RELEASE.jar by
com.ibm.ws.classloader.CompoundClassLoader#b0248555[appwar:eplvc-0_0_5_war]
Parent: com.ibm.ws.classloader.ProtectionClassLoader#e95e3a61
Delegation Mode: PARENT_LAST).
at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:300) ~[spring-tx-4.3.18.RELEASE.jar:4.3.18.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:301) ~[spring-tx-4.3.18.RELEASE.jar:4.3.18.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.3.18.RELEASE.jar:4.3.18.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.18.RELEASE.jar:4.3.18.RELEASE]
at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:115) ~[spring-aop-4.3.18.RELEASE.jar:4.3.18.RELEASE]
at java.util.concurrent.FutureTask.run(FutureTask.java:277) [na:1.8.0]
at java.lang.Thread.run(Thread.java:811) [na:2.9 (07-25-2018)]
Caused by: com.ibm.wsspi.uow.UOWException: java.lang.LinkageError: com/ibm/websphere/uow/UOWSynchronizationRegistry.registerInterposedSynchronization(Ljavax/transaction/Synchronization;)V (loaded from file:/home/parag/IBM/WebSphere/AppServer/plugins/com.ibm.ws.runtime.jar by org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader#52adb42a) called from class org.springframework.transaction.jta.WebSphereUowTransactionManager$UOWActionAdapter (loaded from file:/home/parag/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/parag-desktopNode01Cell/eplvc-0_0_5_war.ear/eplvc-0.0.5.war/WEB-INF/lib/spring-tx-4.3.18.RELEASE.jar by
com.ibm.ws.classloader.CompoundClassLoader#b0248555[appwar:eplvc-0_0_5_war]
Parent: com.ibm.ws.classloader.ProtectionClassLoader#e95e3a61
Delegation Mode: PARENT_LAST).
at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderNewUOW(EmbeddableUOWManagerImpl.java:812) ~[com.ibm.ws.runtime.jar:na]
at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderUOW(EmbeddableUOWManagerImpl.java:370) ~[com.ibm.ws.runtime.jar:na]
at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:293) ~[spring-tx-4.3.18.RELEASE.jar:4.3.18.RELEASE]
... 6 common frames omitted
Caused by: java.lang.LinkageError: com/ibm/websphere/uow/UOWSynchronizationRegistry.registerInterposedSynchronization(Ljavax/transaction/Synchronization;)V (loaded from file:/home/parag/IBM/WebSphere/AppServer/plugins/com.ibm.ws.runtime.jar by org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader#52adb42a) called from class org.springframework.transaction.jta.WebSphereUowTransactionManager$UOWActionAdapter (loaded from file:/home/parag/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/parag-desktopNode01Cell/eplvc-0_0_5_war.ear/eplvc-0.0.5.war/WEB-INF/lib/spring-tx-4.3.18.RELEASE.jar by
com.ibm.ws.classloader.CompoundClassLoader#b0248555[appwar:eplvc-0_0_5_war]
Parent: com.ibm.ws.classloader.ProtectionClassLoader#e95e3a61
Delegation Mode: PARENT_LAST).
at org.springframework.transaction.jta.WebSphereUowTransactionManager$UOWActionAdapter.run(WebSphereUowTransactionManager.java:387) ~[spring-tx-4.3.18.RELEASE.jar:4.3.18.RELEASE]
at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderNewUOW(EmbeddableUOWManagerImpl.java:791) ~[com.ibm.ws.runtime.jar:na]
... 8 common frames omitted
**Class path excluded for the sake of brevity and can be provided if required.**
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.iciciprulife.eplvc</groupId>
<artifactId>eplvc</artifactId>
<version>0.0.5</version>
<packaging>war</packaging>
<name>eplvc</name>
<description>ICICI Pru Life ePLVC</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.15.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>
<log4j2.version>2.8.2</log4j2.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</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-thymeleaf</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-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.54</version>
</dependency>
</dependencies>
</project>
application.properties
spring.datasource.url=jdbc:mysql://localhost:3306/eplvc?useSSL=false
spring.datasource.username=name
spring.datasource.password=pass
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.generate-ddl=true
spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.use_sql_comments=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.type=trace
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
spring.session.store-type=jdbc
spring.session.jdbc.initializer.enabled=true
server.session.timeout=600
spring.session.jdbc.schema=classpath:org/springframework/session/jdbc/schema-mysql.sql

I solved this adding -Dspring.jta.enabled=false in the Generic JVM arguments in Application servers > server1 > Process definition > Java Virtual Machine in the Websphere console.

Related

ConfigFileApplicationListener is deprecated and can only be used as an EnvironmentPostProcessor

I am trying to create a gateway service integrated with auth service.
api-gateway/pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.16.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.project</groupId>
<artifactId>api-gateway</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>api-gateway</name>
<description>Zuul Gateway</description>
<properties>
<java.version>11</java.version>
<spring-cloud.version>Hoxton.SR9</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
To this project i have added a application called "Common" in the build path.
Had 3 files in common application.
JwtAuthenticationConfig
JwtTokenAuthenticationFilter
JwtUsernamePasswordAuthenticationFilter
Source for my work is this.
After running my gateway application i am facing following error.
19:09:27.281 [main] DEBUG org.springframework.boot.context.logging.ClasspathLoggingApplicationListener - Application failed to start with classpath: [file:/F:/eclipse-jee-2018-09-win32-x86_64/eclipse-workspace/Project/api-gateway/api-gateway/target/classes/, file:/F:/eclipse-jee-2018-09-win32-x86_64/eclipse-workspace/Project/common/common/target/classes/, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-starter-security/2.4.0/spring-boot-starter-security-2.4.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-starter/2.4.0/spring-boot-starter-2.4.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot/2.4.0/spring-boot-2.4.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.4.0/spring-boot-autoconfigure-2.4.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-starter-logging/2.4.0/spring-boot-starter-logging-2.4.0.jar, file:/C:/Users/Sreenivas/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar, file:/C:/Users/Sreenivas/.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar, file:/C:/Users/Sreenivas/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.13.3/log4j-to-slf4j-2.13.3.jar, file:/C:/Users/Sreenivas/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar, file:/C:/Users/Sreenivas/.m2/repository/org/slf4j/jul-to-slf4j/1.7.30/jul-to-slf4j-1.7.30.jar, file:/C:/Users/Sreenivas/.m2/repository/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar, file:/C:/Users/Sreenivas/.m2/repository/org/yaml/snakeyaml/1.27/snakeyaml-1.27.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-aop/5.3.1/spring-aop-5.3.1.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-beans/5.3.1/spring-beans-5.3.1.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/security/spring-security-config/5.4.1/spring-security-config-5.4.1.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-context/5.3.1/spring-context-5.3.1.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/security/spring-security-web/5.4.1/spring-security-web-5.4.1.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-expression/5.3.1/spring-expression-5.3.1.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-starter-web/2.4.0/spring-boot-starter-web-2.4.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-starter-json/2.4.0/spring-boot-starter-json-2.4.0.jar, file:/C:/Users/Sreenivas/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.11.3/jackson-datatype-jdk8-2.11.3.jar, file:/C:/Users/Sreenivas/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.11.3/jackson-datatype-jsr310-2.11.3.jar, file:/C:/Users/Sreenivas/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.11.3/jackson-module-parameter-names-2.11.3.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/2.4.0/spring-boot-starter-tomcat-2.4.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.39/tomcat-embed-core-9.0.39.jar, file:/C:/Users/Sreenivas/.m2/repository/org/glassfish/jakarta.el/3.0.3/jakarta.el-3.0.3.jar, file:/C:/Users/Sreenivas/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.39/tomcat-embed-websocket-9.0.39.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-web/5.3.1/spring-web-5.3.1.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-webmvc/5.3.1/spring-webmvc-5.3.1.jar, file:/C:/Users/Sreenivas/.m2/repository/io/jsonwebtoken/jjwt/0.9.1/jjwt-0.9.1.jar, file:/C:/Users/Sreenivas/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.11.3/jackson-databind-2.11.3.jar, file:/C:/Users/Sreenivas/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.11.3/jackson-annotations-2.11.3.jar, file:/C:/Users/Sreenivas/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.11.3/jackson-core-2.11.3.jar, file:/C:/Users/Sreenivas/.m2/repository/org/projectlombok/lombok/1.18.16/lombok-1.18.16.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-starter-test/2.4.0/spring-boot-starter-test-2.4.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-test/2.4.0/spring-boot-test-2.4.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-test-autoconfigure/2.4.0/spring-boot-test-autoconfigure-2.4.0.jar, file:/C:/Users/Sreenivas/.m2/repository/com/jayway/jsonpath/json-path/2.4.0/json-path-2.4.0.jar, file:/C:/Users/Sreenivas/.m2/repository/net/minidev/json-smart/2.3/json-smart-2.3.jar, file:/C:/Users/Sreenivas/.m2/repository/net/minidev/accessors-smart/1.2/accessors-smart-1.2.jar, file:/C:/Users/Sreenivas/.m2/repository/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar, file:/C:/Users/Sreenivas/.m2/repository/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar, file:/C:/Users/Sreenivas/.m2/repository/jakarta/xml/bind/jakarta.xml.bind-api/2.3.3/jakarta.xml.bind-api-2.3.3.jar, file:/C:/Users/Sreenivas/.m2/repository/jakarta/activation/jakarta.activation-api/1.2.2/jakarta.activation-api-1.2.2.jar, file:/C:/Users/Sreenivas/.m2/repository/org/assertj/assertj-core/3.18.1/assertj-core-3.18.1.jar, file:/C:/Users/Sreenivas/.m2/repository/org/hamcrest/hamcrest/2.2/hamcrest-2.2.jar, file:/C:/Users/Sreenivas/.m2/repository/org/junit/jupiter/junit-jupiter/5.7.0/junit-jupiter-5.7.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.7.0/junit-jupiter-api-5.7.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/apiguardian/apiguardian-api/1.1.0/apiguardian-api-1.1.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/junit/platform/junit-platform-commons/1.7.0/junit-platform-commons-1.7.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.7.0/junit-jupiter-params-5.7.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.7.0/junit-jupiter-engine-5.7.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/junit/platform/junit-platform-engine/1.7.0/junit-platform-engine-1.7.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/mockito/mockito-core/3.6.0/mockito-core-3.6.0.jar, file:/C:/Users/Sreenivas/.m2/repository/net/bytebuddy/byte-buddy/1.10.18/byte-buddy-1.10.18.jar, file:/C:/Users/Sreenivas/.m2/repository/net/bytebuddy/byte-buddy-agent/1.10.18/byte-buddy-agent-1.10.18.jar, file:/C:/Users/Sreenivas/.m2/repository/org/objenesis/objenesis/3.1/objenesis-3.1.jar, file:/C:/Users/Sreenivas/.m2/repository/org/mockito/mockito-junit-jupiter/3.6.0/mockito-junit-jupiter-3.6.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/skyscreamer/jsonassert/1.5.0/jsonassert-1.5.0.jar, file:/C:/Users/Sreenivas/.m2/repository/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-core/5.3.1/spring-core-5.3.1.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-jcl/5.3.1/spring-jcl-5.3.1.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-test/5.3.1/spring-test-5.3.1.jar, file:/C:/Users/Sreenivas/.m2/repository/org/xmlunit/xmlunit-core/2.7.0/xmlunit-core-2.7.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/security/spring-security-test/5.4.1/spring-security-test-5.4.1.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/security/spring-security-core/5.4.1/spring-security-core-5.4.1.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-starter-security/2.1.16.RELEASE/spring-boot-starter-security-2.1.16.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-starter/2.1.16.RELEASE/spring-boot-starter-2.1.16.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot/2.1.16.RELEASE/spring-boot-2.1.16.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.1.16.RELEASE/spring-boot-autoconfigure-2.1.16.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-starter-logging/2.1.16.RELEASE/spring-boot-starter-logging-2.1.16.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.11.2/log4j-to-slf4j-2.11.2.jar, file:/C:/Users/Sreenivas/.m2/repository/org/apache/logging/log4j/log4j-api/2.11.2/log4j-api-2.11.2.jar, file:/C:/Users/Sreenivas/.m2/repository/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar, file:/C:/Users/Sreenivas/.m2/repository/org/yaml/snakeyaml/1.23/snakeyaml-1.23.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-aop/5.1.17.RELEASE/spring-aop-5.1.17.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-beans/5.1.17.RELEASE/spring-beans-5.1.17.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/security/spring-security-config/5.1.11.RELEASE/spring-security-config-5.1.11.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-context/5.1.17.RELEASE/spring-context-5.1.17.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/security/spring-security-web/5.1.11.RELEASE/spring-security-web-5.1.11.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-expression/5.1.17.RELEASE/spring-expression-5.1.17.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-web/5.1.17.RELEASE/spring-web-5.1.17.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/cloud/spring-cloud-starter-netflix-eureka-client/2.2.6.RELEASE/spring-cloud-starter-netflix-eureka-client-2.2.6.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/cloud/spring-cloud-starter/2.2.6.RELEASE/spring-cloud-starter-2.2.6.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/cloud/spring-cloud-context/2.2.6.RELEASE/spring-cloud-context-2.2.6.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/security/spring-security-crypto/5.1.11.RELEASE/spring-security-crypto-5.1.11.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/cloud/spring-cloud-commons/2.2.6.RELEASE/spring-cloud-commons-2.2.6.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/security/spring-security-rsa/1.0.9.RELEASE/spring-security-rsa-1.0.9.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/bouncycastle/bcpkix-jdk15on/1.64/bcpkix-jdk15on-1.64.jar, file:/C:/Users/Sreenivas/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.64/bcprov-jdk15on-1.64.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/cloud/spring-cloud-netflix-hystrix/2.2.6.RELEASE/spring-cloud-netflix-hystrix-2.2.6.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-starter-aop/2.1.16.RELEASE/spring-boot-starter-aop-2.1.16.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/aspectj/aspectjweaver/1.9.6/aspectjweaver-1.9.6.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/cloud/spring-cloud-netflix-eureka-client/2.2.6.RELEASE/spring-cloud-netflix-eureka-client-2.2.6.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/eureka/eureka-client/1.10.7/eureka-client-1.10.7.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/netflix-commons/netflix-eventbus/0.3.0/netflix-eventbus-0.3.0.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/netflix-commons/netflix-infix/0.3.0/netflix-infix-0.3.0.jar, file:/C:/Users/Sreenivas/.m2/repository/commons-jxpath/commons-jxpath/1.3/commons-jxpath-1.3.jar, file:/C:/Users/Sreenivas/.m2/repository/joda-time/joda-time/2.10.6/joda-time-2.10.6.jar, file:/C:/Users/Sreenivas/.m2/repository/org/antlr/antlr-runtime/3.4/antlr-runtime-3.4.jar, file:/C:/Users/Sreenivas/.m2/repository/org/antlr/stringtemplate/3.2.1/stringtemplate-3.2.1.jar, file:/C:/Users/Sreenivas/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar, file:/C:/Users/Sreenivas/.m2/repository/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar, file:/C:/Users/Sreenivas/.m2/repository/org/apache/commons/commons-math/2.2/commons-math-2.2.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/archaius/archaius-core/0.7.6/archaius-core-0.7.6.jar, file:/C:/Users/Sreenivas/.m2/repository/com/google/guava/guava/29.0-jre/guava-29.0-jre.jar, file:/C:/Users/Sreenivas/.m2/repository/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar, file:/C:/Users/Sreenivas/.m2/repository/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar, file:/C:/Users/Sreenivas/.m2/repository/org/checkerframework/checker-qual/2.11.1/checker-qual-2.11.1.jar, file:/C:/Users/Sreenivas/.m2/repository/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar, file:/C:/Users/Sreenivas/.m2/repository/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar, file:/C:/Users/Sreenivas/.m2/repository/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/servo/servo-core/0.12.21/servo-core-0.12.21.jar, file:/C:/Users/Sreenivas/.m2/repository/com/sun/jersey/jersey-core/1.19.1/jersey-core-1.19.1.jar, file:/C:/Users/Sreenivas/.m2/repository/com/sun/jersey/jersey-client/1.19.1/jersey-client-1.19.1.jar, file:/C:/Users/Sreenivas/.m2/repository/com/sun/jersey/contribs/jersey-apache-client4/1.19.1/jersey-apache-client4-1.19.1.jar, file:/C:/Users/Sreenivas/.m2/repository/org/apache/httpcomponents/httpclient/4.5.12/httpclient-4.5.12.jar, file:/C:/Users/Sreenivas/.m2/repository/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar, file:/C:/Users/Sreenivas/.m2/repository/commons-codec/commons-codec/1.11/commons-codec-1.11.jar, file:/C:/Users/Sreenivas/.m2/repository/commons-configuration/commons-configuration/1.10/commons-configuration-1.10.jar, file:/C:/Users/Sreenivas/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar, file:/C:/Users/Sreenivas/.m2/repository/com/google/inject/guice/4.1.0/guice-4.1.0.jar, file:/C:/Users/Sreenivas/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar, file:/C:/Users/Sreenivas/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/C:/Users/Sreenivas/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.9.10/jackson-annotations-2.9.10.jar, file:/C:/Users/Sreenivas/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.9.10/jackson-core-2.9.10.jar, file:/C:/Users/Sreenivas/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.9.10.5/jackson-databind-2.9.10.5.jar, file:/C:/Users/Sreenivas/.m2/repository/org/codehaus/jettison/jettison/1.3.7/jettison-1.3.7.jar, file:/C:/Users/Sreenivas/.m2/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/eureka/eureka-core/1.10.7/eureka-core-1.10.7.jar, file:/C:/Users/Sreenivas/.m2/repository/com/fasterxml/woodstox/woodstox-core/5.0.3/woodstox-core-5.0.3.jar, file:/C:/Users/Sreenivas/.m2/repository/org/codehaus/woodstox/stax2-api/3.1.4/stax2-api-3.1.4.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/cloud/spring-cloud-starter-netflix-archaius/2.2.6.RELEASE/spring-cloud-starter-netflix-archaius-2.2.6.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/cloud/spring-cloud-netflix-ribbon/2.2.6.RELEASE/spring-cloud-netflix-ribbon-2.2.6.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/cloud/spring-cloud-netflix-archaius/2.2.6.RELEASE/spring-cloud-netflix-archaius-2.2.6.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/cloud/spring-cloud-starter-netflix-ribbon/2.2.6.RELEASE/spring-cloud-starter-netflix-ribbon-2.2.6.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/ribbon/ribbon/2.3.0/ribbon-2.3.0.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/ribbon/ribbon-transport/2.3.0/ribbon-transport-2.3.0.jar, file:/C:/Users/Sreenivas/.m2/repository/io/reactivex/rxnetty-contexts/0.4.9/rxnetty-contexts-0.4.9.jar, file:/C:/Users/Sreenivas/.m2/repository/io/reactivex/rxnetty-servo/0.4.9/rxnetty-servo-0.4.9.jar, file:/C:/Users/Sreenivas/.m2/repository/io/reactivex/rxnetty/0.4.9/rxnetty-0.4.9.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/ribbon/ribbon-core/2.3.0/ribbon-core-2.3.0.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/ribbon/ribbon-httpclient/2.3.0/ribbon-httpclient-2.3.0.jar, file:/C:/Users/Sreenivas/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/ribbon/ribbon-loadbalancer/2.3.0/ribbon-loadbalancer-2.3.0.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/netflix-commons/netflix-statistics/0.1.1/netflix-statistics-0.1.1.jar, file:/C:/Users/Sreenivas/.m2/repository/io/reactivex/rxjava/1.3.8/rxjava-1.3.8.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/cloud/spring-cloud-starter-loadbalancer/2.2.6.RELEASE/spring-cloud-starter-loadbalancer-2.2.6.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/cloud/spring-cloud-loadbalancer/2.2.6.RELEASE/spring-cloud-loadbalancer-2.2.6.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-starter-validation/2.1.16.RELEASE/spring-boot-starter-validation-2.1.16.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/io/projectreactor/reactor-core/3.2.19.RELEASE/reactor-core-3.2.19.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/io/projectreactor/addons/reactor-extra/3.2.4.RELEASE/reactor-extra-3.2.4.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-starter-cache/2.1.16.RELEASE/spring-boot-starter-cache-2.1.16.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-context-support/5.1.17.RELEASE/spring-context-support-5.1.17.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/com/stoyanr/evictor/1.0.0/evictor-1.0.0.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/ribbon/ribbon-eureka/2.3.0/ribbon-eureka-2.3.0.jar, file:/C:/Users/Sreenivas/.m2/repository/com/thoughtworks/xstream/xstream/1.4.13/xstream-1.4.13.jar, file:/C:/Users/Sreenivas/.m2/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar, file:/C:/Users/Sreenivas/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/cloud/spring-cloud-starter-netflix-zuul/2.2.6.RELEASE/spring-cloud-starter-netflix-zuul-2.2.6.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/cloud/spring-cloud-netflix-zuul/2.2.6.RELEASE/spring-cloud-netflix-zuul-2.2.6.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/netflix-commons/netflix-commons-util/0.3.0/netflix-commons-util-0.3.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-starter-web/2.1.16.RELEASE/spring-boot-starter-web-2.1.16.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-starter-json/2.1.16.RELEASE/spring-boot-starter-json-2.1.16.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.9.10/jackson-datatype-jdk8-2.9.10.jar, file:/C:/Users/Sreenivas/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.9.10/jackson-datatype-jsr310-2.9.10.jar, file:/C:/Users/Sreenivas/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.9.10/jackson-module-parameter-names-2.9.10.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/2.1.16.RELEASE/spring-boot-starter-tomcat-2.1.16.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.37/tomcat-embed-core-9.0.37.jar, file:/C:/Users/Sreenivas/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/9.0.37/tomcat-embed-el-9.0.37.jar, file:/C:/Users/Sreenivas/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.37/tomcat-embed-websocket-9.0.37.jar, file:/C:/Users/Sreenivas/.m2/repository/org/hibernate/validator/hibernate-validator/6.0.20.Final/hibernate-validator-6.0.20.Final.jar, file:/C:/Users/Sreenivas/.m2/repository/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar, file:/C:/Users/Sreenivas/.m2/repository/org/jboss/logging/jboss-logging/3.3.3.Final/jboss-logging-3.3.3.Final.jar, file:/C:/Users/Sreenivas/.m2/repository/com/fasterxml/classmate/1.4.0/classmate-1.4.0.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-webmvc/5.1.17.RELEASE/spring-webmvc-5.1.17.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-starter-actuator/2.1.16.RELEASE/spring-boot-starter-actuator-2.1.16.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-actuator-autoconfigure/2.1.16.RELEASE/spring-boot-actuator-autoconfigure-2.1.16.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/boot/spring-boot-actuator/2.1.16.RELEASE/spring-boot-actuator-2.1.16.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/io/micrometer/micrometer-core/1.1.16/micrometer-core-1.1.16.jar, file:/C:/Users/Sreenivas/.m2/repository/org/hdrhistogram/HdrHistogram/2.1.9/HdrHistogram-2.1.9.jar, file:/C:/Users/Sreenivas/.m2/repository/org/latencyutils/LatencyUtils/2.0.3/LatencyUtils-2.0.3.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/cloud/spring-cloud-starter-netflix-hystrix/2.2.6.RELEASE/spring-cloud-starter-netflix-hystrix-2.2.6.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/hystrix/hystrix-core/1.5.18/hystrix-core-1.5.18.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/hystrix/hystrix-serialization/1.5.18/hystrix-serialization-1.5.18.jar, file:/C:/Users/Sreenivas/.m2/repository/com/fasterxml/jackson/module/jackson-module-afterburner/2.9.10/jackson-module-afterburner-2.9.10.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/hystrix/hystrix-metrics-event-stream/1.5.18/hystrix-metrics-event-stream-1.5.18.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/hystrix/hystrix-javanica/1.5.18/hystrix-javanica-1.5.18.jar, file:/C:/Users/Sreenivas/.m2/repository/org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1.jar, file:/C:/Users/Sreenivas/.m2/repository/io/reactivex/rxjava-reactive-streams/1.2.1/rxjava-reactive-streams-1.2.1.jar, file:/C:/Users/Sreenivas/.m2/repository/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar, file:/C:/Users/Sreenivas/.m2/repository/com/netflix/zuul/zuul-core/1.3.1/zuul-core-1.3.1.jar, file:/C:/Users/Sreenivas/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-core/5.1.17.RELEASE/spring-core-5.1.17.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/spring-jcl/5.1.17.RELEASE/spring-jcl-5.1.17.RELEASE.jar, file:/C:/Users/Sreenivas/.m2/repository/org/springframework/security/spring-security-core/5.1.11.RELEASE/spring-security-core-5.1.11.RELEASE.jar]
19:09:27.297 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.IllegalStateException: ConfigFileApplicationListener [org.springframework.boot.context.config.ConfigFileApplicationListener] is deprecated and can only be used as an EnvironmentPostProcessor
at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:198)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:203)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:196)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:170)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:148)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:63)
at java.util.ArrayList.forEach(ArrayList.java:1249)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:362)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:144)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:212)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:117)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:74)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:203)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:196)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:170)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:148)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:63)
at java.util.ArrayList.forEach(ArrayList.java:1249)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:362)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1309)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1298)
at com.project.apigateway.ApiGatewayApplication.main(ApiGatewayApplication.java:12)
Help me in solving this.
Problem Resolved.
Actually common application and Api-gateway application are in different spring versions.
After changing version of common and correctly including it in api-gateway application solved my issue.
Thanks.

No Scope registered for scope name 'restart'

I am getting the following stack trace when trying to start an app using Spring Boot Devtools.
2019-03-15T08:20:26,929 WARN o.s.c.a.AnnotationConfigApplicationContext:557 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'optionalLiveReloadServer' defined in class path resource [org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfiguration$LiveReloadConfiguration.class]: Unexpected exception during bean creation; nested exception is java.lang.IllegalStateException: No Scope registered for scope name 'restart'
Exception in thread "restartedMain"
....
Here is the pom file in use to reproduce the problem.
<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>dispatch</groupId>
<artifactId>dispatch-java</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>dispatch-java</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
<relativePath />
</parent>
<properties>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Begin Spring Boot dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
I can find issues where people are having similar issues but none with the 'restart' scope name.
I will answer with what I figured out the problem was.
It seems that loading the ApplicationContext in the main() method of the Spring Boot app was the cause of this trouble.
I had to change
...
private static ApplicationContext context;
public static void main(final String[] args) {
context = new AnnotationConfigApplicationContext(DispatcherConfiguration.class);
SpringApplication.run(DispatcherApplication.class, args);
}
public static ApplicationContext getApplicationContext() {
return context;
}
and once I stopped setting context Spring Boot started fine with Dev Tools.
Check whether #ComponentScan is used only for once. In my case I used #ComponentScan in SpringMainApplication.java (where main method is there) and also in BeanDecleration.java file. After removing #ComponentScan from the BeanDecleration.java file, the error is resolved.

spring-cloud-config-aws-kms NoUniqueBeanDefinitionException: defaultTextEncryptor, kmsTextEncryptor

To use encrypted properties in my application.yml, I wanted to use Zalando's config-aws-kms project. I followed the instructions in https://github.com/zalando/spring-cloud-config-aws-kms, that is I added it as a dependency to my pom.xml But then I got NoUniqueBeanDefinitionException error.
***************************
APPLICATION FAILED TO START
***************************
Description:
Field encryptor in org.springframework.cloud.bootstrap.encrypt.EncryptionBootstrapConfiguration required a single bean, but 2 were found:
- defaultTextEncryptor: defined by method 'defaultTextEncryptor' in org.springframework.cloud.config.server.config.EncryptionAutoConfiguration$DefaultTextEncryptorConfiguration
- kmsTextEncryptor: defined by method 'kmsTextEncryptor' in de.zalando.spring.cloud.config.aws.kms.KmsEncryptionConfiguration$KmsTextEncryptorConfiguration
Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'org.springframework.security.crypto.encrypt.TextEncryptor' available: expected single matching bean but found 2: defaultTextEncryptor,kmsTextEncryptor
pom.xml:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.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>
<spring-cloud.version>Dalston.SR2</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
<version>1.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.zalando</groupId>
<artifactId>spring-cloud-config-aws-kms</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Try to swap the spring-cloud-config-starter with the spring-cloud-config-aws-kms order, because Spring's DefaultTextEncryptorConfiguration has a #ConditionalOnMissingBean annotation, but the other one haven't got a ConditionalOnMissingBean annotation and that's why you get an Exception.

Spring boot exception for a very simple app

My application has this. It has not hibernate or jpa stuff it yet. I added only in libraries in pom.xml:
#SpringBootApplication
#ComponentScan("com.ma.vegshopping")
public class VegShoppingApplication {
public static void main(String[] args) {
SpringApplication.run(VegShoppingApplication.class, args);
}
}
pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ma</groupId>
<artifactId>VegShopping</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>VegShopping</name>
<description>vegetable shopping list</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.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-actuator</artifactId>
</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-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-social-facebook</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</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>
</plugin>
</plugins>
</build>
</project>
When try to start app, I get following exception:
ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
When u put the JPA hibernate jars are brought into classpath. And when Hibernate is available in classpath Spring Boot AutoConfiguration is picked for Creating the EntityManager.
This is the default behaviour of Spring boot.
Since you dont have any datasource for Hibernate the startup is failing.
Try creating a datasource by giving properties in your application.properties / yml file.
If u dont want to use hibernate or jpa then remove jpa starter from your pom.xml

Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener

I have a spring project and try to make it use spring boot and to run at embadded tomcat following :
https://spring.io/guides/gs/rest-service/
This is my Application
//#Configuration
//#EnableAspectJAutoProxy
#SpringBootApplication
#ComponentScan(basePackages = "gux.prome")
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
If I use maven command: mvn spring-boot:run, the project starts fine, but I need to debug , so I run this main method at InteliJ, exception occurs:
Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationListener : org.springframework.boot.logging.ClasspathLoggingApplicationListener
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:414)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:394)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:385)
at org.springframework.boot.SpringApplication.initialize(SpringApplication.java:263)
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:237)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
at gux.prome.config.Application.main(Application.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: java.lang.NoClassDefFoundError: org/springframework/context/event/GenericApplicationListener
....
This is the pom:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>gux</groupId>
<artifactId>prome-data</artifactId>
<version>1.0-SNAPSHOT</version>
<name>prome-data Maven Webapp</name>
<url>http://maven.apache.org</url>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
</dependency>
<!-- end of guava -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.2</version>
</dependency>
</dependencies>
<properties>
<java.version>1.7</java.version>
</properties>
<build>
<finalName>prome-data</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!--<plugin>-->
<!-- use java 7 -->
<!--<artifactId> maven-compiler-plugin</artifactId>-->
<!--<version>3.1</version>-->
<!--<configuration>-->
<!--<source> 1.7</source> -->
<!--<target> 1.7</target>-->
<!--</configuration>-->
<!--</plugin>-->
</plugins>
</build>
<!--<repositories>-->
<!--<repository>-->
<!--<id>spring-releases</id>-->
<!--<url>http://repo.spring.io/libs-release</url>-->
<!--</repository>-->
<!--</repositories>-->
<!--<pluginRepositories>-->
<!--<pluginRepository>-->
<!--<id>spring-releases</id>-->
<!--<url>http://repo.spring.io/libs-release</url>-->
<!--</pluginRepository>-->
<!--</pluginRepositories>-->
</project>
This is a symptom of a version mismatch somewhere in your Spring dependencies, but not necessarily just Spring Boot and Spring itself. I had this between my Spring Boot parent:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version>
<relativePath></relativePath>
</parent>
and my Spring Cloud Config dependency:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-client</artifactId>
<version>1.0.4.RELEASE</version>
</dependency>
For some reason, I am not able to define the spring-cloud-config-client dependency without an explicit version declaration.
Updating both to the latest release version (1.3.5.RELEASE and 1.1.1.RELEASE) solved it.
Conclusion
Update your dependencies to the latest correct ones
For ones using Gradle, I solved this issue setting the version of the Spring Boot Gradle Plugin in my library and in my main project to the same value:
plugins {
id("org.springframework.boot") version "2.2.2.RELEASE"
}
i had the same error , i just changed the release version of the spring boot parent and now everything works right

Categories

Resources