When i add sleuth dependency in a spring boot project that uses log4j2 for logging, i get the following error
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/context/embedded/FilterRegistrationBean
Does sleuth work only with logback and it support log4j2 also ?
the error you are getting is for FilterRegistrationBean, it maybe due to the version mismatch of spring-cloud and spring-boot. There is a issue with compatibility of Spring-boot version 2.x.x and Spring-cloud version 1.x.x
refer to this:
https://github.com/spring-cloud/spring-cloud-config/issues/836#issuecomment-376846920
Related
I have spring boot project version 2.7.0.
I use the dependency-check and it reports CVE-2022-22976.
Do you know how I can solve it?
Spring security version is 5.7.1 while spring starter security version is 2.7.0.
It's a false positive that will be automatically suppressed with the upcoming release 7.1.1: https://github.com/jeremylong/DependencyCheck/issues/4563
Currently, the Spring Boot starter for Spring Security is mistaken with Spring Security itself.
Until then you'll need to suppress it manually with something like
<suppress base="true">
<notes><![CDATA[
FP per issue #4563
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.springframework\.boot/spring-boot-starter-security#.*$</packageUrl>
<cpe>cpe:/a:vmware:spring_security</cpe>
</suppress>
We're trying to upgrade spring boot version to 2.6.6 and faced up with "Spring Boot [2.6.6] is not compatible with this Spring Cloud release train" (when running integration tests).
In additional
spring-cloud.version = 2021
We're using org.springframework.cloud (spring-cloud-starter-openfeign & spring-cloud-openfeign-cores) 3.1.1
according to the documentation , spring boot support 2.6.6 should be compatible.
You could try and set your spring cloud version to
spring-cloud.version = 2021.0.1
If it is not that simple mistake I am sorry. The documentation that you linked to is correct. Spring Boot [2.6.6] is compatible with spring-cloud.version 2021.x.x. openfeign 3.1.1 is also part of springCloud 2021.x.x. I have multiple project with this configuration running. In all of them the runtime as well as the integration test are working properly. Otherwise a stacktrace would be nice to gain further information :)
I have multimodule project using maven.
After migrating for Spring-Boot version 2.4.2 to 2.6.6, I face multiple issues.
First one is the application won't be able to find the Bootstrap class. The error is:
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.Bootstrapper
To fix the issue I need to add the dependency in the pom.xml of the module:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
Second problem I face is to this "Spring Cloud release train"
In this case I need to upgrade the Spring-Cloud version to "2021.0.1" which is compatible with Spring-Boot 2.6.6
Third problem I face is this error while starting the application:
"No spring.config.import property has been defined"
The reason for this error is that some of the "bootstrap.properties" files are deprecated in the new version so application won't starts. To fix this, we need to add below property in application.properties or application.yml file.
spring.config.import=optional:configserver:
I am using spring boot 2.1.5 and spring-kafka, version not specified. Project is gradle 6.0, java 1.8
I am getting this error
error creating bean with name 'org.springframework.boot.autoconfigure.kafka.kafkaannotationdrivenconfiguration': unexpected exception during bean creation; nested exception is java.lang.typenotpresentexception: type org.springframework.kafka.listener.recordinterceptor not present
What could be this due to? Please help.
2.1.5 is nearly a year old; the current Boot 2.1.x release is 2.1.13.
2.1.5 uses spring-kafka 2.2.6 so I don't see how you can get that error, based on your description.
RecordInterceptor was added in spring-kafka 2.2.7.
It was added to the Spring Boot autoconfiguration in 2.2.0.
So what you are describing makes no sense; you must be using Boot 2.2.x and an old spring-kafka version.
You have mis-matched Boot/Kafka versions.
Upgrade to Boot 2.1.13 (or preferably 2.2.6).
I have an already existing SpringBoot 1.x application which is using Java 7.I want to upgrade spring boot version from 1.x to 2.x.
For up gradation I have upgraded java version from 1.7 to 1.8 in maven pom.xml.
In existing application I am using apache log4j(org.apache.log4j.*) for logging purpose.Getting compilation error for log4j after up gradation.
Thanks in advance.
As of Spring Boot 1.4, the log4j (1.x) starter module is no longer available:
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.4-Release-Notes#deprecations-from-spring-boot-13
You can either switch to log4j2 (which still has a starter module) or you'll have to manually provide the log4j dependencies 1.x in your POM.
I tried upgrading a Spring Boot application from spring-data-redis 1.6.4.RELEASE to 1.7.2.RELEASE by adding the spring-data-redis dependency to the POM whilst leaving the spring-boot-starter-redis unchanged (using Spring Boot 1.3.5.RELEASE). The upgraded application fails to start with this error:
Caused by: java.lang.AbstractMethodError: org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(Ljava/lang/reflect/Method;Lorg/springframework/data/repository/core/RepositoryMetadata;Lorg/springframework/data/projection/ProjectionFactory;Lorg/springframework/data/repository/core/NamedQueries;)Lorg/springframework/data/repository/query/RepositoryQuery;
A bit cryptic.
You need to upgrade all of Spring Data, not just Spring Data Redis. By just overriding the version of Spring Data Redis you're left with an incompatible version of Spring Data Commons.
As you are using Spring Boot, you should override the version of the spring-data-releasetrain.version property to Hopper-SR2:
<properties>
<spring-data-releasetrain.version>Hopper-SR2</spring-data-releasetrain.version>
</properties>
and remove the version from any Spring Data-related dependencies you have declared so that Boot's dependency management can keep them all aligned.