Eureka server instance fails to start locally with the following exception:-

Caused by: java.lang.NoClassDefFoundError: com/google/common/cache/CacheBuilder at com.netflix.eureka.registry.AbstractInstanceRegistry.<init>(AbstractInstanceRegistry.java:84) ~[eureka-core-2.0.3.jar:2.0.3] at com.netflix.eureka.registry.PeerAwareInstanceRegistryImpl.<init>(PeerAwareInstanceRegistryImpl.java:136) ~[eureka-core-2.0.3.jar:2.0.3] at org.springframework.cloud.netflix.eureka.server.InstanceRegistry.<init>(InstanceRegistry.java:55) ~[spring-cloud-netflix-eureka-server-4.1.3.jar:4.1.3] at org.springframework.cloud.netflix.eureka.server.EurekaServerAutoConfiguration.peerAwareInstanceRegistry(EurekaServerAutoConfiguration.java:246) ~[spring-cloud-netflix-eureka-server-4.1.3.jar:4.1.3] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:146) ~[spring-beans-6.1.11.jar:6.1.11] ... 48 common frames omitted Caused by: java.lang.ClassNotFoundException: com.google.common.cache.CacheBuilder 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:525) ~[na:na] ... 55 common frames omitted

Steps:-

  1. Configure a simple eureka server project at spring initializr with:
  2. Maven
  3. Java 22
  4. v 3.3.2
  5. Dependencies - Eureka server

  6. Import in IntelliJ and add properties: spring.application.name=eureka-server server.port=8761 eureka.instance.hostname=localhost eureka.client.fetch-registry=false eureka.client.register-with-eureka=false

  7. Start the application and notice it fails due to the above exception

Note - The issue is not observed if I change the spring-cloud.version from 2023.0.3 to 2023.0.2 in pom.xml.

Comment From: OlgaMaciaszek

Hello @swagatrath, thanks fro reporting the issue. Please provide a minimal, complete, verifiable example that reproduces the issue.

Comment From: spring-cloud-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-cloud-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.