here's the full error :
java.lang.IllegalStateException: Failed to introspect Class \[org.springframework.cloud.loadbalancer.config.LoadBalancerAutoConfiguration\] from ClassLoader \[jdk.internal.loader.ClassLoaders$AppClassLoader@4b1210ee\]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:485) \~\[spring-core-5.3.27.jar:5.3.27\]
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:361) \~\[spring-core-5.3.27.jar:5.3.27\]
at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:418) \~\[spring-core-5.3.27.jar:5.3.27\]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.lambda$getTypeForFactoryMethod$2(AbstractAutowireCapableBeanFactory.java:765) \~\[spring-beans-5.3.27.jar:5.3.27\]
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) \~\[na:na\]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:764) \~\[spring-beans-5.3.27.jar:5.3.27\]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:703) \~\[spring-beans-5.3.27.jar:5.3.27\]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:674) \~\[spring-beans-5.3.27.jar:5.3.27\]
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1684) \~\[spring-beans-5.3.27.jar:5.3.27\]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:570) \~\[spring-beans-5.3.27.jar:5.3.27\]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:542) \~\[spring-beans-5.3.27.jar:5.3.27\]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:669) \~\[spring-beans-5.3.27.jar:5.3.27\]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:661) \~\[spring-beans-5.3.27.jar:5.3.27\]
at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1302) \~\[spring-context-5.3.27.jar:5.3.27\]
at org.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:864) \~\[spring-boot-2.7.11.jar:2.7.11\]
at org.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:852) \~\[spring-boot-2.7.11.jar:2.7.11\]
at org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:839) \~\[spring-boot-2.7.11.jar:2.7.11\]
at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:779) \~\[spring-boot-2.7.11.jar:2.7.11\]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:317) \~\[spring-boot-2.7.11.jar:2.7.11\]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) \~\[spring-boot-2.7.11.jar:2.7.11\]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) \~\[spring-boot-2.7.11.jar:2.7.11\]
at org.sid.BillingServiceApplication.main(BillingServiceApplication.java:10) \~\[classes/:na\]
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) \~\[na:na\]
at java.base/java.lang.reflect.Method.invoke(Method.java:577) \~\[na:na\]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) \~\[spring-boot-devtools-2.7.11.jar:2.7.11\]
Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/factory/aot/BeanRegistrationAotProcessor
at java.base/java.lang.ClassLoader.defineClass1(Native Method) \~\[na:na\]
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1013) \~\[na:na\]
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) \~\[na:na\]
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862) \~\[na:na\]
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760) \~\[na:na\]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681) \~\[na:na\]
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639) \~\[na:na\]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) \~\[na:na\]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) \~\[na:na\]
at java.base/java.lang.Class.getDeclaredMethods0(Native Method) \~\[na:na\]
at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3434) \~\[na:na\]
at java.base/java.lang.Class.getDeclaredMethods(Class.java:2536) \~\[na:na\]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:467) \~\[spring-core-5.3.27.jar:5.3.27\]
... 24 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.aot.BeanRegistrationAotProcessor
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) \~\[na:na\]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) \~\[na:na\]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) \~\[na:na\]
... 37 common frames omitted
here's the pom.xml file
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</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.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
</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>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
here's the main code :
package org.sid;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableFeignClients
public class BillingServiceApplication {
public static void main(String[] args) {
SpringApplication.run(BillingServiceApplication.class, args);
}
}
here's the application.proprities
\</project\>
it was a problem with the pom.xml file here's the correct version :
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</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-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</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>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2021.0.8</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>