SpringBoot 2.7.2 Springfox version compatibility - java

I am using SpringBoot 2.7.2 in my project. And using springfox version 3.0.0 for swagger documentation.
The exception thrown is org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException.
What is the solution for it? Please assist.

spring fox behaves like a stranger in the new version of spring boot. you can try spring doc openapi
it works fine with spring boot 2.7.*.

Related

Error creating bean with name 'tomcatServletWebServerFactory' when migrating from Spring-Boot 2.2.2 t Spring-Boot 2.3.7

I've been upgraded the spring-Boot version to 4.3.7 but I got this:
Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException:Error creating bean with name 'tomcatServletWebServerFactory'
What is the problem?

Spring boot 2.2.2 fail with Caused by: java.lang.ClassNotFoundException: org.springframework.core.log.LogMessage

I have some problem with spring boot 2.2.2. It failed with error Caused by: java.lang.ClassNotFoundException: org.springframework.core.log.LogMessage
when some libs not found in classpath.
Main reason than LogMessage not found beacuse spring devtool 2.2.2 have dependence spring core 5.1.2
In this version no class founds LogMessage you can see in screenshots. This class is added only 5.2.0. Is it issue? LogMessage.class in 5.2.4
Cached version, update maven index fix problem. Now can close question!
I am using Spring boot 2.2.5 and it finds the LogMessage class just fine. Make sure you have all the Spring Boot files downloaded.

Failed to Load Application Context after upgrading to Spring Boot 2.2.2

I am trying to upgrade to spring-boot 2.2/Spring 5.2. We are using the reactive WebClient in combination with plain JDBC.
After upgrading we receive the following error:-
Failed to introspect Class [org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration] from ClassLoader [jdk.internal.loader.ClassLoaders
java.lang.NoClassDefFoundError: org/springframework/transaction/ReactiveTransactionManager
java.lang.ClassNotFoundException: org.springframework.transaction.ReactiveTransactionManager
What is the path we need to follow to upgrade in the case where #transactional is used and reactive streams is on the classpath?

Spring boot embedded Kafka integration throws NoClassDefFoundError

Spring Boot: 2.0.3.RELEASE
org.apache.kafka.kafka-streams: 1.0.0
org.apache.kafka.kafka-clients: 1.0.0
org.springframwork.kafka:spring-kafka-test:2.1.7.RELEASE
I have a working Spring boot application with Kafka. I am trying to follow https://blog.mimacom.com/testing-apache-kafka-with-spring-boot/ to create an integration test.
When I add the #EmbeddedKafka annotation I get the error when I run
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'kafkaEmbedded': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/kafka/common/record/RecordFormat
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1699) ~[spring-beans-5.0.8.RELEASE.jar:5.0.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:407) ~[spring-beans-5.0.8.RELEASE.jar:5.0.8.RELEASE]
There are a few google results on this error however they are all on old kafka-client versions and they should be fixed in the version I use.
This looks like a version mismatch but it is not clear to me what I am supposed to me.
As indicated in comments errors like these are always due to library version incompatibilities. The following combination worked
spring boot: 2.1
spring-streams/spring-client: 2.0.1 (Using 2.2.0 creates some compatibility issues)
spring-kafka: 2.2.5.RELEASE

Multiple annotations found at this line: Factory bean not Found

I am building a Spring project in Spring Tool Suite(3.6.4.RELEASE).
I am trying to upgrade spring framework version from 4.0.3.RELEASE to 4.2.7.RELEASE using maven.
Before upgradation there was no error and everything running smoothly. Now project is compiling and running without error but login page is not showing and also I am getting error in my spring security configuration xml.
Error in spring-security.xml:
Showing following error on STS hovering:
Multiple annotations found at this line:
- Factory bean 'org.springframework.security.config.http.FilterInvocationSecurityMetadataSourceParser
$DefaultWebSecurityExpressionHandlerBeanFactory' not found [config set: mcare-dashboard-web/web-context]
- Factory bean 'org.springframework.security.config.http.HttpConfigurationBuilder
$SecurityContextHolderAwareRequestFilterBeanFactory' not found [config set: mcare-dashboard-web/web-context]
Project Hierarchy:
My pom.xml was like following:
Then I just changed the version number like this:
After that spring-security.xml was showing the error.
Can anybody explain why is this happening?
You state that you are upgrading Spring from version 4.0.3.RELEASE to 4.2.7.RELEASE. However effectively you are upgrading both Spring and Spring Security. This due to having a single version property, named org.springframework-version, to manage both the version of the Spring and Spring Security dependencies.
So changing org.springframework-version to 4.2.7.RELEASE effectively upgrades Spring Security as well.
To fix this you want to have two distinct version properties one for Spring and another for Spring Security. You can than upgrade only Spring or Spring Security.

Categories

Resources