Application failed to start on updating spring-boot-starter to 2.2.4.RELEASE caused by spring kafka factory - spring-boot

on using spring kafka 2.4.1.RELEASE with spring-boot-starter 2.2.4.RELEASE following exception is casued
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory]: Factory method 'kafkaListenerContainerFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/kafka/listener/ConsumerProperties

Related

GraphQL not supported by Spring boot 2.7.x and Java 17

getting below error while trying to execute grapgql 0.0.4 with spring boot 2.7.0 & higher and Java 17.
Error creating bean with name 'graphQLSchema' defined in class path resource [io/leangen/graphql/spqr/spring/autoconfigure/SpqrAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [graphql.schema.GraphQLSchema]: Factory method 'graphQLSchema' threw exception; nested exception is java.lang.NoClassDefFoundError: graphql/execution/batched/Batched

SpringBoot 2.6.7 Upgrade Throws Startup Error - Provider for javax.xml.stream.XMLOutputFactory cannot be found

I am unable to get past this error after upgrading SpringBoot from 2.5.10 - 2.6.7
I did find a version diff in jackson-dataformat-xml and raised an issue but they are confident there is no diff in jackson-dataformat-xml versions https://github.com/FasterXML/jackson-dataformat-xml/issues/521
Anyone faced this issue? Would appreciate if anyone could help
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:163) ~[spring-boot-2.6.7.jar!/:2.6.7]
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:142) ~[spring-boot-2.6.7.jar!/:2.6.7]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'formContentFilter' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.filter.OrderedFormContentFilter]: Factory method 'formContentFilter' threw exception; nested exception is javax.xml.stream.FactoryConfigurationError: Provider for javax.xml.stream.XMLOutputFactory cannot be found
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.19.jar!/:5.3.19]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.filter.OrderedFormContentFilter]: Factory method 'formContentFilter' threw exception; nested exception is javax.xml.stream.FactoryConfigurationError: Provider for javax.xml.stream.XMLOutputFactory cannot be found
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.19.jar!/:5.3.19]
Caused by: javax.xml.stream.FactoryConfigurationError: Provider for javax.xml.stream.XMLOutputFactory cannot be found
at javax.xml.stream.FactoryFinder.find(Unknown Source) ~[?:?]
at javax.xml.stream.XMLOutputFactory.newFactory(Unknown Source) ~[?:?]
at com.fasterxml.jackson.dataformat.xml.XmlFactory.<init>(XmlFactory.java:124) ~[jackson-dataformat-xml-2.13.2.jar!/:2.13.2]

Cannot load driver class: org.h2.Driver in spring boot

I'm trying to use h2 database and microservices. But when i run the application it doesn't run, it is showing errors.
I have eureka server and a product microservice. In product microservice i have used h2database. it is showing errors.
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception
is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'h2Console' defined in class path resource
[org/springframework/boot/autoconfigure/h2/H2ConsoleAutoConfiguration.class]: Bean instantiation via
factory method failed; nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [org.springframework.boot.web.servlet.ServletRegistrationBean]: Factory method
'h2Console' threw exception; 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$Hikari.class]: Bean
instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception
is java.lang.IllegalStateException: Cannot load driver class: org.h2.Driver
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.springframework.boot.web.servlet.ServletRegistrationBean]: Factory method 'h2Console' threw
exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'dataSource' defined in class path resource
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'dataSource' defined in class path resource
[org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean
instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception
is java.lang.IllegalStateException: Cannot load driver class: org.h2.Driver
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate
[com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception
is java.lang.IllegalStateException: Cannot load driver class: org.h2.Driver
Caused by: java.lang.IllegalStateException: Cannot load driver class: org.h2.Driver
The below is my dependency in pom.xml
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
The below is my application.properties file of Product microservice
server.port=8082
eureka.client.service-url.defaultZone=http://localhost:8761/eureka/
spring.datasource.name=SunHome
#H2 settings
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
springspring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
Please help me solve this errors.
Check applcation.properties for "strange" characters
Configuration should be right.

Upgrade spring boot version from 1.5.13 to 1.5.19 occurred Error creating bean with name 'payloadRootAnnotationMethodEndpointMapping'

Error creating bean with name 'payloadRootAnnotationMethodEndpointMapping' defined in class path resource [org/springframework/ws/config/annotation/DelegatingWsConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping]: Factory method 'payloadRootAnnotationMethodEndpointMapping' threw exception; nested exception is java.lang.ExceptionInInitializerError
Failed to instantiate [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping]: Factory method 'payloadRootAnnotationMethodEndpointMapping' threw exception; nested exception is java.lang.ExceptionInInitializerError
Not supported: http://javax.xml.XMLConstants/property/accessExternalDTD
I have fixed this problem by adding the following to pom.xml:
<exclusion>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
</exclusion>
Maybe it shouldn't have xalan in the Maven dependencies.

Maven Dependency for Oracle RDS on AWS

I'm having trouble connecting to my AWS Oracle RDS instance, I have a connection in SQL developer all cool and fine.
Upon loading my application context (spring boot | java 8)>
*org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException:
........................................................................................................................................................
Caused by: java.lang.IllegalStateException: Could not load JDBC driver class [jdbc:oracle:thin:#########:1521/DBNAME]*
would be greatly appreciated if someone could point me in the correct direction as to what artifactid groupid and version I should use. Current is below and wrong:
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4</version>
</dependency>
Full Stack Trace:
2018-07-06 07:03:15.670 ERROR 88631 --- [ost-startStop-1] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthEndpoint]: Factory method 'healthEndpoint' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthIndicatorAutoConfiguration': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthIndicatorAutoConfiguration$$EnhancerBySpringCGLIB$$d6e2375e]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaDBDataSource' defined in class path resource [com/config/DataSourceConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'jpaDBDataSource' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [jdbc:oracle:thin:#****************************************]

Resources