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


Samebug tips

A few things cause this exception:
1) Check if you have all jars and if they're in the correct path.
2) Your classpath might be broken, you can define it in the command line with java -cp yourClassPath or at your IDE if you're using one.


9 months ago
Expert tip

If you're using Hibernate, this indicates you're missing FasterXML Classmate dependency, which you can add to your dependencies. To add it, the groupId is com.fasterxml and artifactId is Classmate.


7 months ago
Expert tip

Solutions on the web

Solution icon of github
via GitHub by SafeKhayati
, 9 months ago
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

Solution icon of github
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'liquibase' defined in class path resource [com/nuodb/myapp/config/DatabaseConfiguration.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type

Solution icon of stackoverflow
index 0 of type [javax.sql.DataSource]: : Error creating bean with name 'dataSource' defined in class path resource [com/myapp/shoppingcart/config/DatabaseConfiguration.class]: Bean instantiation via factory method failed; nested exception is

Solution icon of stackoverflow
index 0 of type [javax.sql.DataSource]: : Error creating bean with name 'dataSource' defined in class path resource [com/daytech/hubtalents/config/DatabaseConfiguration.class]: Bean instantiation via factory method failed; nested exception is

Solution icon of github
through constructor argument with index 0 of type [javax.sql.DataSource]: : Error creating bean with name 'dataSource' defined in class path resource [com/digitalmentejason/contaapp/config/DatabaseConfiguration.class]: Bean instantiation via factory

Solution icon of stackoverflow
via Stack Overflow by Servietsky
, 5 months ago
$MappingJackson2HttpMessageConverterConfiguration.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [com.fasterxml.jackson.databind.ObjectMapper]: Error creating bean with name 'jacksonObjectMapper' defined in class path resource [org/springframework/boot

Solution icon of stackoverflow
]: Unsatisfied dependency expressed through constructor argument with index 0 of type [javax.sql.DataSource]: : Error creating bean with name 'dataSource' defined in class path resource [ee/st/running/config/DatabaseConfiguration.class]: Instantiation of bean

Solution icon of web
]: Unsatisfied dependency expressed through constructor argument with index 0 of type [javax.sql.DataSource]: : Error creating bean with name 'dataSource' defined in class path resource [ee/st/running/config/DatabaseConfiguration.class]: Instantiation of bean

Solution icon of github
via GitHub by vachacz
, 9 months ago
Error creating bean with name 'net.chrisrichardson.eventstore.subscriptions.config.EventStoreSubscriptionsConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could

Solution icon of github
via GitHub by superandrew
, 10 months ago
constructor argument with index 0 of type [javax.sql.DataSource]: : Error creating bean with name 'dataSource' defined in class path resource [cc/officina/nowr/config/DatabaseConfiguration.class]: Bean instantiation via factory method failed; nested

Stack trace

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/cloudetflix/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/cloudetflix/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
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
	at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
	at com.example.EurekaServerApplication.main(EurekaServerApplication.java:12)[classes/:na]
Caused by: 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/cloudetflix/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/cloudetflix/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
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	... 17 more
Caused by: 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/cloudetflix/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/cloudetflix/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
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:464)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1192)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1116)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	... 19 more
Caused by: 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/cloudetflix/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
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1192)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1116)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	... 32 more
Caused by: 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/cloudetflix/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
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	... 45 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.eurekaClient' defined in class path resource [org/springframework/cloudetflix/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
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:345)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.cloud.context.scope.GenericScope$BeanLifecycleWrapper.getBean(GenericScope.java:359)[spring-cloud-context-1.1.6.RELEASE.jar:1.1.6.RELEASE]
	at org.springframework.cloud.context.scope.GenericScope.get(GenericScope.java:176)[spring-cloud-context-1.1.6.RELEASE.jar:1.1.6.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:340)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:35)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:187)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at com.sun.proxy.$Proxy87.getApplications(Unknown Source)[na:na]
	at 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]
	at 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]
	at 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]
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[spring-core-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:355)[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at 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]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_77]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[na:1.8.0_77]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)[na:1.8.0_77]
	at java.lang.reflect.Method.invoke(Unknown Source)[na:1.8.0_77]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	... 46 more
Caused by: 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
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	... 69 more
Caused by: java.lang.NoClassDefFoundError: com/google/common/base/Function
	at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:128)[eureka-client-1.4.12.jar:1.4.12]
	at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:304)[eureka-client-1.4.12.jar:1.4.12]
	at org.springframework.cloud.netflix.eureka.CloudEurekaClient.<init>(CloudEurekaClient.java:51)[spring-cloud-netflix-eureka-client-1.2.3.RELEASE.jar:1.2.3.RELEASE]
	at 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]
	at 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]
	at 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]
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[spring-core-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:355)[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	at 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]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_77]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[na:1.8.0_77]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)[na:1.8.0_77]
	at java.lang.reflect.Method.invoke(Unknown Source)[na:1.8.0_77]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
	... 70 more
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Function
	at java.net.URLClassLoader.findClass(Unknown Source)[na:1.8.0_77]
	at java.lang.ClassLoader.loadClass(Unknown Source)[na:1.8.0_77]
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)[na:1.8.0_77]
	at java.lang.ClassLoader.loadClass(Unknown Source)[na:1.8.0_77]
	... 84 more

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
2 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
2476 more bugmates