Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 311 Vote(s) - 3.54 Average
  • 1
  • 2
  • 3
  • 4
  • 5
bean creation error when starting spring boot application

#1
When i try to run my spring boot application i get this Exception:



> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'configurationPropertiesBeans' defined in
> class path resource
> [org/springframework/cloud/autoconfigure/ConfigurationPropertiesRebinderAutoConfiguration.class]:
> Post-processing of merged bean definition failed; nested exception is
> java.lang.IllegalStateException: Failed to introspect Class
> [org.springframework.cloud.context.properties.ConfigurationPropertiesBeans]
> from ClassLoader
> [jdk.internal.loader.ClassLoaders$AppClassLoader@3764951d]

I think it's an version incompatibility. I imported open feign in my pom.xml and after that it wasn't working, but i dont know how to fix that. I use open feign 2.2.5.RELEASE.
Here my pom.xml:
```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

[To see links please register here]

;
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>privas.microservice</groupId>
<artifactId>sellcar</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>sellcar</name>
<description>Demo project for Spring Boot</description>

<properties>
<java.version>15</java.version>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${java.version}</maven.compiler.source>
<spring-cloud.version>Hoxton.SR8</spring-cloud.version>
</properties>

<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>


<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>2.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>2.4.1</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
```
Reply

#2
To elaborate on @M-deinum's comment, setting Spring Boot version to `2.3.4.RELEASE` (instead of `2.4.2` in my case) solved the issue. In `gradle` this meant changing:

plugins {
id 'org.springframework.boot' version '2.4.2'
...
}
To

plugins {
id 'org.springframework.boot' version '2.3.4.RELEASE'
...
}
Reply

#3
You need to change spring boot version to Released version

from

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

to

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.3.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

Reply

#4
Spring-Cloud - Hoxton.SR8 is not compatiable with Spring-boot 2.4.0

Just use either of the combinations:

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<spring-cloud.version>2020.0.3</spring-cloud.version>
Or

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<spring-cloud.version>Hoxton.SR8</spring-cloud.version>


Reply

#5
I had a same issue, and it is happening because of Spring Cloud services and Spring Boot version issues. I got rid of it by using

[To see links please register here]

to generate my project.

When you select all dependencies needed for your project, you can then click the **Explore** button and check the `pom.xml` file.

This issue happened to me when I tried to add dependency for `Eureka-client` to my `pom.xml` after generating project, so using IntelliJ.

I got the same error.

Then I went to Spring.io again select dependencies that I use for my project and also dependency for `Eureka-client`, clicked on **Explore** button and saw that I need to add this line of code under java version in `pom.xml`

<spring-cloud.version>2020.0.3</spring-cloud.version>

But also this lines as well:

<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>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

So I just copy pasted it to my existing `pom.xml` and it worked!
Reply

#6
You need to follow the release train of Spring Cloud and match the version of the Spring-boot starter. The release train is available on the spring-cloud website

[To see links please register here]


The release train as of now is:
[Release train for spring-cloud][1]


[1]:
Reply

#7
just Changing to :



<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
<version>3.1.1</version>
</dependency>

and Adding version to

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.6.6</version>
</plugin>
</plugins>
</build>

Worked Fine For Me
Reply

#8
This worked for me.
Go ti spring initialize start.spring.io and add the dependancies again. Compare your .pom with downloaded pom. I got my issue.

<spring-cloud.version>2021.0.3-SNAPSHOT</spring-cloud.version>

I was having diffent version of spring cloud hence there was a conflict.
Reply

#9
<repository>
<id>netflix-candidates</id>
<name>Netflix Candidates</name>
<url>https://artifactory-oss.prod.netflix.net/artifactory/maven-oss-candidates</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>

add this to the repository
Reply

#10
In my case, Im using build.gradle.

Changed from:

ext {
set('springCloudVersion', "Hoxton.SR1")
}

to:

ext {
set('springCloudVersion', "2021.0.4")
}

Note: Im using


id 'org.springframework.boot' version '2.6.1'
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through