org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.cloud.netflix.eureka.server.EurekaServerBootstrap org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration.eurekaServerBootstrap; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eurekaServerBootstrap' defined in class org.springframework.cloud.netflix.eureka.server.EurekaServerConfiguration: Unsatisfied dependency expressed through constructor argument with index 0 of type [com.netflix.eureka.registry.PeerAwareInstanceRegistry]: : Error creating bean with name 'peerAwareInstanceRegistry' defined in class org.springframework.cloud.netflix.eureka.server.EurekaServerConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netflix.eureka.registry.PeerAwareInstanceRegistry]: Factory method 'peerAwareInstanceRegistry' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.eurekaClient' defined in class path resource [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netflix.discovery.EurekaClient]: Factory method 'eurekaClient' threw exception; nested exception is java.lang.NoClassDefFoundError: com/google/common/base/Function; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'peerAwareInstanceRegistry' defined in class org.springframework.cloud.netflix.eureka.server.EurekaServerConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netflix.eureka.registry.PeerAwareInstanceRegistry]: Factory method 'peerAwareInstanceRegistry' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.eurekaClient' defined in class path resource [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netflix.discovery.EurekaClient]: Factory method 'eurekaClient' threw exception; nested exception is java.lang.NoClassDefFoundError: com/google/common/base/Function

GitHub | SafeKhayati | 2 weeks ago
  1. 0
    Spring expects that the EntityManagerFactory has to be called "entityManagerFactory". It uses convention over configuration to make it easier to use.
  2. 0
    Check Servers Launch Configuration in Eclipse. See the details below.
  3. 0
    Add slf4j dependency to your pom.xml
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassNotFoundException

    com.google.common.base.Function

    at java.net.URLClassLoader.findClass()
  2. Java RT
    ClassLoader.loadClass
    1. java.net.URLClassLoader.findClass(Unknown Source)[na:1.8.0_77]
    2. java.lang.ClassLoader.loadClass(Unknown Source)[na:1.8.0_77]
    3. sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)[na:1.8.0_77]
    4. java.lang.ClassLoader.loadClass(Unknown Source)[na:1.8.0_77]
    4 frames
  3. eureka-client
    DiscoveryClient.<init>
    1. com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:128)[eureka-client-1.4.12.jar:1.4.12]
    2. com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:304)[eureka-client-1.4.12.jar:1.4.12]
    2 frames
  4. org.springframework.cloud
    EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration$$EnhancerBySpringCGLIB$$4f44895a$$FastClassBySpringCGLIB$$13c92b81.invoke
    1. org.springframework.cloud.netflix.eureka.CloudEurekaClient.<init>(CloudEurekaClient.java:51)[spring-cloud-netflix-eureka-client-1.2.3.RELEASE.jar:1.2.3.RELEASE]
    2. org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration.eurekaClient(EurekaClientAutoConfiguration.java:192)[spring-cloud-netflix-eureka-client-1.2.3.RELEASE.jar:1.2.3.RELEASE]
    3. org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration$$EnhancerBySpringCGLIB$$4f44895a.CGLIB$eurekaClient$1(<generated>)[spring-cloud-netflix-eureka-client-1.2.3.RELEASE.jar:1.2.3.RELEASE]
    4. org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration$$EnhancerBySpringCGLIB$$4f44895a$$FastClassBySpringCGLIB$$13c92b81.invoke(<generated>)[spring-cloud-netflix-eureka-client-1.2.3.RELEASE.jar:1.2.3.RELEASE]
    4 frames
  5. Spring Core
    MethodProxy.invokeSuper
    1. org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[spring-core-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    1 frame
  6. Spring Context
    ConfigurationClassEnhancer$BeanMethodInterceptor.intercept
    1. org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:355)[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    1 frame
  7. org.springframework.cloud
    EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration$$EnhancerBySpringCGLIB$$4f44895a.eurekaClient
    1. org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration$$EnhancerBySpringCGLIB$$4f44895a.eurekaClient(<generated>)[spring-cloud-netflix-eureka-client-1.2.3.RELEASE.jar:1.2.3.RELEASE]
    1 frame
  8. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_77]
    2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[na:1.8.0_77]
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)[na:1.8.0_77]
    4. java.lang.reflect.Method.invoke(Unknown Source)[na:1.8.0_77]
    4 frames
  9. Spring Beans
    AbstractBeanFactory$2.getObject
    1. org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    2. org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    7. org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:345)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    7 frames
  10. org.springframework.cloud
    GenericScope.get
    1. org.springframework.cloud.context.scope.GenericScope$BeanLifecycleWrapper.getBean(GenericScope.java:359)[spring-cloud-context-1.1.6.RELEASE.jar:1.1.6.RELEASE]
    2. org.springframework.cloud.context.scope.GenericScope.get(GenericScope.java:176)[spring-cloud-context-1.1.6.RELEASE.jar:1.1.6.RELEASE]
    2 frames
  11. Spring Beans
    AbstractBeanFactory.getBean
    1. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:340)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    2. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    2 frames
  12. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:35)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:187)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    2 frames
  13. com.sun.proxy
    $Proxy87.getApplications
    1. com.sun.proxy.$Proxy87.getApplications(Unknown Source)[na:na]
    1 frame
  14. org.springframework.cloud
    EurekaServerConfiguration$$EnhancerBySpringCGLIB$$25b6534b$$FastClassBySpringCGLIB$$98ba5d54.invoke
    1. org.springframework.cloud.netflix.eureka.server.EurekaServerConfiguration.peerAwareInstanceRegistry(EurekaServerConfiguration.java:158)[spring-cloud-netflix-eureka-server-1.2.3.RELEASE.jar:1.2.3.RELEASE]
    2. org.springframework.cloud.netflix.eureka.server.EurekaServerConfiguration$$EnhancerBySpringCGLIB$$25b6534b.CGLIB$peerAwareInstanceRegistry$5(<generated>)[spring-cloud-netflix-eureka-server-1.2.3.RELEASE.jar:1.2.3.RELEASE]
    3. org.springframework.cloud.netflix.eureka.server.EurekaServerConfiguration$$EnhancerBySpringCGLIB$$25b6534b$$FastClassBySpringCGLIB$$98ba5d54.invoke(<generated>)[spring-cloud-netflix-eureka-server-1.2.3.RELEASE.jar:1.2.3.RELEASE]
    3 frames
  15. Spring Core
    MethodProxy.invokeSuper
    1. org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[spring-core-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    1 frame
  16. Spring Context
    ConfigurationClassEnhancer$BeanMethodInterceptor.intercept
    1. org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:355)[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    1 frame
  17. org.springframework.cloud
    EurekaServerConfiguration$$EnhancerBySpringCGLIB$$25b6534b.peerAwareInstanceRegistry
    1. org.springframework.cloud.netflix.eureka.server.EurekaServerConfiguration$$EnhancerBySpringCGLIB$$25b6534b.peerAwareInstanceRegistry(<generated>)[spring-cloud-netflix-eureka-server-1.2.3.RELEASE.jar:1.2.3.RELEASE]
    1 frame
  18. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_77]
    2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[na:1.8.0_77]
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)[na:1.8.0_77]
    4. java.lang.reflect.Method.invoke(Unknown Source)[na:1.8.0_77]
    4 frames
  19. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    2. org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    7. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    8. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    9. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    10. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    11. org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1192)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    12. org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1116)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    13. org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    14. org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    15. org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    16. org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:464)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    17. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    18. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    19. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    20. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    21. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    22. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    23. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    24. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    25. org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1192)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    26. org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1116)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    27. org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    28. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    29. org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    30. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    31. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    32. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    33. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    34. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    35. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    36. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    37. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    38. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    38 frames
  20. Spring Context
    AbstractApplicationContext.refresh
    1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    2 frames
  21. Spring Boot
    SpringApplication.run
    1. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    2. org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    3. org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    4. org.springframework.boot.SpringApplication.run(SpringApplication.java:307)[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    5. org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    6. org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
    6 frames
  22. com.example
    EurekaServerApplication.main
    1. com.example.EurekaServerApplication.main(EurekaServerApplication.java:12)[classes/:na]
    1 frame