EurekaServer这几个错误 你可以这样解决
程序调试遇到了不启动的几个问题
- pom.xml 更改前
- EnableDiscoveryClient cannot be resolved to a type
- 错误信息
- eclipse的Problem窗口显示有错误
- Run App 报错
- 解决办法
- ClassNotFoundException: com.google.common.cache.CacheBuilder
- 错误信息
- Run -as Spring Boot App 报错
- 解决办法
- 最终pom配置
- AuditEventsEndpointAutoConfiguration
- Cannot execute request on any known server
- 特别感谢
- 注意事项
pom.xml 更改前
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.lonson</groupId><artifactId>micro-cloud-config</artifactId><version>1.0.0-SNAPSHOT</version><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>1.5.10.RELEASE</version></parent><dependencies><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-config-server</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-security</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>org.springframework.security</groupId><artifactId>spring-security-rsa</artifactId></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-eureka</artifactId></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins><defaultGoal>compile</defaultGoal></build>
</project>
EnableDiscoveryClient cannot be resolved to a type
错误信息
eclipse的Problem窗口显示有错误
Description Resource Path Location Type
EnableDiscoveryClient cannot be resolved to a type EurekaServerApplication.java /micro-cloud-eureka/src/main/java/com/lonson/eureka line 10 Java Problem
Run App 报错
2018-11-22 14:00:26.535 INFO 13304 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2d1ef81a: startup date [Thu Nov 22 14:00:26 CST 2018]; root of context hierarchy
2018-11-22 14:00:27.454 INFO 13304 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2018-11-22 14:00:27.697 INFO 13304 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$7e88a91c] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). ____ _ __ _ _/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/ ___)| |_)| | | | | || (_| | ) ) ) )' |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot :: (v1.5.6.RELEASE)2018-11-22 14:00:30.270 INFO 13304 --- [ main] c.lonson.eureka.EurekaServerApplication : The following profiles are active: localhost
2018-11-22 14:00:30.321 INFO 13304 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@76012793: startup date [Thu Nov 22 14:00:30 CST 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@2d1ef81a
2018-11-22 14:00:30.457 WARN 13304 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.lonson.eureka.EurekaServerApplication]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.cloud.netflix.eureka.server.EurekaServerConfiguration
2018-11-22 14:00:30.561 ERROR 13304 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exceptionjava.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@76012793: startup date [Thu Nov 22 14:00:30 CST 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@2d1ef81aat org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:414)at org.springframework.context.support.ApplicationListenerDetector.postProcessBeforeDestruction(ApplicationListenerDetector.java:97)at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253)at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:578)at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:554)at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:961)at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:523)at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.destroySingletons(FactoryBeanRegistrySupport.java:230)at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:968)at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1030)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:556)at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)at com.lonson.eureka.EurekaServerApplication.main(EurekaServerApplication.java:14)2018-11-22 14:00:38.784 ERROR 13304 --- [ main] o.s.boot.SpringApplication : Application startup failedorg.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.lonson.eureka.EurekaServerApplication]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.cloud.netflix.eureka.server.EurekaServerConfigurationat org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:616)at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:299)at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245)at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:198)at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:167)at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:308)at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228)at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:270)at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93)at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:525)at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)at com.lonson.eureka.EurekaServerApplication.main(EurekaServerApplication.java:14)
Caused by: java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.cloud.netflix.eureka.server.EurekaServerConfigurationat org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:163)at org.springframework.context.annotation.ConfigurationClassParser.retrieveBeanMethodMetadata(ConfigurationClassParser.java:380)at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:314)at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245)at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:606)... 17 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/context/embedded/FilterRegistrationBeanat java.lang.Class.getDeclaredMethods0(Native Method)at java.lang.Class.privateGetDeclaredMethods(Unknown Source)at java.lang.Class.getDeclaredMethods(Unknown Source)at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:152)... 21 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.embedded.FilterRegistrationBeanat java.net.URLClassLoader.findClass(Unknown Source)at java.lang.ClassLoader.loadClass(Unknown Source)at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)at java.lang.ClassLoader.loadClass(Unknown Source)... 25 common frames omitted
解决办法
调整spring-boot-starter-parent的版本
增加完整 spring-cloud-dependencies依赖
更改
<parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>1.5.10.RELEASE</version></parent>
为
<parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>1.5.4.RELEASE</version><!-- lookup parent from repository --></parent>
增加 dependency
<dependencyManagement><dependencies><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>Dalston.RELEASE</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement>
问题解决!
之后提示另一个错误
ClassNotFoundException: com.google.common.cache.CacheBuilder
错误信息
Run -as Spring Boot App 报错
2018-11-22 17:37:44.005 WARN 14400 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration': Unsatisfied dependency expressed through field 'eurekaServerBootstrap'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eurekaServerBootstrap' defined in class path resource [org/springframework/cloud/netflix/eureka/server/EurekaServerAutoConfiguration.class]: Unsatisfied dependency expressed through method 'eurekaServerBootstrap' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'peerAwareInstanceRegistry' defined in class path resource [org/springframework/cloud/netflix/eureka/server/EurekaServerAutoConfiguration.class]: 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 java.lang.NoClassDefFoundError: com/google/common/cache/CacheBuilder
2018-11-22 17:37:44.010 INFO 14400 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2018-11-22 17:37:44.013 INFO 14400 --- [ main] com.netflix.discovery.DiscoveryClient : Shutting down DiscoveryClient ...
2018-11-22 17:37:44.013 INFO 14400 --- [ main] com.netflix.discovery.DiscoveryClient : Completed shut down of DiscoveryClient
2018-11-22 17:37:44.014 INFO 14400 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2018-11-22 17:37:44.039 INFO 14400 --- [ main] utoConfigurationReportLoggingInitializer : Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2018-11-22 17:37:44.050 ERROR 14400 --- [ main] o.s.boot.SpringApplication : Application startup failedorg.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration': Unsatisfied dependency expressed through field 'eurekaServerBootstrap'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eurekaServerBootstrap' defined in class path resource [org/springframework/cloud/netflix/eureka/server/EurekaServerAutoConfiguration.class]: Unsatisfied dependency expressed through method 'eurekaServerBootstrap' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'peerAwareInstanceRegistry' defined in class path resource [org/springframework/cloud/netflix/eureka/server/EurekaServerAutoConfiguration.class]: 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 java.lang.NoClassDefFoundError: com/google/common/cache/CacheBuilderat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)at com.lonson.eureka.EurekaServerApplication.main(EurekaServerApplication.java:14)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eurekaServerBootstrap' defined in class path resource [org/springframework/cloud/netflix/eureka/server/EurekaServerAutoConfiguration.class]: Unsatisfied dependency expressed through method 'eurekaServerBootstrap' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'peerAwareInstanceRegistry' defined in class path resource [org/springframework/cloud/netflix/eureka/server/EurekaServerAutoConfiguration.class]: 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 java.lang.NoClassDefFoundError: com/google/common/cache/CacheBuilderat org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:467)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)... 19 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'peerAwareInstanceRegistry' defined in class path resource [org/springframework/cloud/netflix/eureka/server/EurekaServerAutoConfiguration.class]: 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 java.lang.NoClassDefFoundError: com/google/common/cache/CacheBuilderat org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)... 32 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netflix.eureka.registry.PeerAwareInstanceRegistry]: Factory method 'peerAwareInstanceRegistry' threw exception; nested exception is java.lang.NoClassDefFoundError: com/google/common/cache/CacheBuilderat org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)... 45 common frames omitted
Caused by: java.lang.NoClassDefFoundError: com/google/common/cache/CacheBuilderat com.netflix.eureka.registry.AbstractInstanceRegistry.<init>(AbstractInstanceRegistry.java:83)at com.netflix.eureka.registry.PeerAwareInstanceRegistryImpl.<init>(PeerAwareInstanceRegistryImpl.java:134)at org.springframework.cloud.netflix.eureka.server.InstanceRegistry.<init>(InstanceRegistry.java:55)at org.springframework.cloud.netflix.eureka.server.EurekaServerAutoConfiguration.peerAwareInstanceRegistry(EurekaServerAutoConfiguration.java:165)at org.springframework.cloud.netflix.eureka.server.EurekaServerAutoConfiguration$$EnhancerBySpringCGLIB$$e7d2610a.CGLIB$peerAwareInstanceRegistry$5(<generated>)at org.springframework.cloud.netflix.eureka.server.EurekaServerAutoConfiguration$$EnhancerBySpringCGLIB$$e7d2610a$$FastClassBySpringCGLIB$$e7aaac6c.invoke(<generated>)at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358)at org.springframework.cloud.netflix.eureka.server.EurekaServerAutoConfiguration$$EnhancerBySpringCGLIB$$e7d2610a.peerAwareInstanceRegistry(<generated>)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at java.lang.reflect.Method.invoke(Unknown Source)at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)... 46 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.google.common.cache.CacheBuilderat java.net.URLClassLoader.findClass(Unknown Source)at java.lang.ClassLoader.loadClass(Unknown Source)at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)at java.lang.ClassLoader.loadClass(Unknown Source)... 60 common frames omitted
解决办法
查看 pom的 Dependency Hierachy 发现 google的guava版本不对
根据 提示 最高使用的版本是19.0
增加dependency
<!-- https://mvnrepository.com/artifact/com.google.guava/guava --><dependency><groupId>com.google.guava</groupId><artifactId>guava</artifactId><version>19.0</version></dependency>
搞定!
2018-11-22 17:41:34.136 INFO 13612 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'environmentManager': registering with JMX server as MBean [org.springframework.cloud.context.environment:name=environmentManager,type=EnvironmentManager]
2018-11-22 17:41:34.155 INFO 13612 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'restartEndpoint': registering with JMX server as MBean [org.springframework.cloud.context.restart:name=restartEndpoint,type=RestartEndpoint]
2018-11-22 17:41:34.170 INFO 13612 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'serviceRegistryEndpoint': registering with JMX server as MBean [org.springframework.cloud.client.serviceregistry.endpoint:name=serviceRegistryEndpoint,type=ServiceRegistryEndpoint]
2018-11-22 17:41:34.181 INFO 13612 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'refreshScope': registering with JMX server as MBean [org.springframework.cloud.context.scope.refresh:name=refreshScope,type=RefreshScope]
2018-11-22 17:41:34.195 INFO 13612 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'configurationPropertiesRebinder': registering with JMX server as MBean [org.springframework.cloud.context.properties:name=configurationPropertiesRebinder,context=6d3c5255,type=ConfigurationPropertiesRebinder]
2018-11-22 17:41:34.203 INFO 13612 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'refreshEndpoint': registering with JMX server as MBean [org.springframework.cloud.endpoint:name=refreshEndpoint,type=RefreshEndpoint]
2018-11-22 17:41:34.534 INFO 13612 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 0
2018-11-22 17:41:34.534 INFO 13612 --- [ main] o.s.c.n.e.s.EurekaServiceRegistry : Registering application unknown with eureka with status UP
2018-11-22 17:41:34.582 INFO 13612 --- [ Thread-12] o.s.c.n.e.server.EurekaServerBootstrap : Setting the eureka configuration..
2018-11-22 17:41:34.583 INFO 13612 --- [ Thread-12] o.s.c.n.e.server.EurekaServerBootstrap : Eureka data center value eureka.datacenter is not set, defaulting to default
2018-11-22 17:41:34.583 INFO 13612 --- [ Thread-12] o.s.c.n.e.server.EurekaServerBootstrap : Eureka environment value eureka.environment is not set, defaulting to test
2018-11-22 17:41:34.599 INFO 13612 --- [ Thread-12] o.s.c.n.e.server.EurekaServerBootstrap : isAws returned false
2018-11-22 17:41:34.600 INFO 13612 --- [ Thread-12] o.s.c.n.e.server.EurekaServerBootstrap : Initialized server context
2018-11-22 17:41:34.600 INFO 13612 --- [ Thread-12] c.n.e.r.PeerAwareInstanceRegistryImpl : Got 1 instances from neighboring DS node
2018-11-22 17:41:34.600 INFO 13612 --- [ Thread-12] c.n.e.r.PeerAwareInstanceRegistryImpl : Renew threshold is: 1
2018-11-22 17:41:34.600 INFO 13612 --- [ Thread-12] c.n.e.r.PeerAwareInstanceRegistryImpl : Changing status to UP
2018-11-22 17:41:34.613 INFO 13612 --- [ Thread-12] e.s.EurekaServerInitializerConfiguration : Started Eureka Server
2018-11-22 17:41:34.670 INFO 13612 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8761 (http)
2018-11-22 17:41:34.672 INFO 13612 --- [ main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 8761
2018-11-22 17:41:34.677 INFO 13612 --- [ main] c.lonson.eureka.EurekaServerApplication : Started EurekaServerApplication in 9.674 seconds (JVM running for 11.255)
2018-11-22 17:42:34.602 INFO 13612 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
最终pom配置
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.lonson</groupId><artifactId>micro-cloud-eureka</artifactId><version>1.0.0-SNAPSHOT</version><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>1.5.4.RELEASE</version><!-- lookup parent from repository --></parent><dependencyManagement><dependencies><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>Dalston.RELEASE</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement><dependencies> <!-- https://mvnrepository.com/artifact/com.google.guava/guava --><dependency><groupId>com.google.guava</groupId><artifactId>guava</artifactId><version>19.0</version></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-eureka-server</artifactId></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-ribbon</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency></dependencies><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><configuration><source>1.8</source><target>1.8</target></configuration></plugin><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins><defaultGoal>compile</defaultGoal></build>
</project>
AuditEventsEndpointAutoConfiguration
IllegalStateException: Error processing condition on org.springframework.boot.actuate.autoconfigure.audit.AuditEventsEndpointAutoConfiguration
产生问题原因:
1.依赖包不存在
2.依赖包冲突
3.排包有问题
Cannot execute request on any known server
netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
产生问题原因:
1.eureka.client.service-url.defaultZone 配置地址不对
2.localhost拼写不对
3.eureka.client.service-url.defaultZone 引用的其他参数不对
特别感谢
https://blog.csdn.net/lucy06/article/details/78063288
https://bbs.csdn.net/topics/392295992
注意事项
spring boot 和 cloud之间有版本对应关系的,因此要注意,我目前功能是能正常部署,但是后续问题有没有目前不清楚,如果有的话我也会尽量贴出来
自己mark一下也好!
EurekaServer这几个错误 你可以这样解决相关推荐
- mysql workbench kernelbase.dll_电脑出现kernelbase.dll错误的两种解决方法
KernelBase.dll是Windows操作系统的重要文件,它为各种应用程序提供服务.如果电脑提示kernelbase.dll错误,这该怎么处理?大家可以用电脑自带的防火墙或者是第三方软件来进行故 ...
- Ubuntu安装deb软件包错误(依赖关系问题)解决
Ubuntu安装deb软件包错误(依赖关系问题)解决 参考文章: (1)Ubuntu安装deb软件包错误(依赖关系问题)解决 (2)https://www.cnblogs.com/congyucn/p ...
- nginx产生【413 request entity too large】错误的原因与解决方法
nginx产生[413 request entity too large]错误的原因与解决方法 参考文章: (1)nginx产生[413 request entity too large]错误的原因与 ...
- Chrome浏览器偶尔提示错误net::ERR_EMPTY_RESPONSE的解决方法
Chrome浏览器偶尔提示错误net::ERR_EMPTY_RESPONSE的解决方法 参考文章: (1)Chrome浏览器偶尔提示错误net::ERR_EMPTY_RESPONSE的解决方法 (2) ...
- 【Java】SAX解析characters 错误截取问题的解决
SAX解析characters 错误截取问题的解决 SAX characters bug_百度搜索SAX解析characters 错误截取问题的解决 - CSDN博客[Android]SAX解析之错误 ...
- ceph集群报 Monitor clock skew detected 错误问题排查,解决
ceph集群报 Monitor clock skew detected 错误问题排查,解决 告警信息如下: [root@ceph-100-80 ceph]# ceph -w ...
- 【转】error while loading shared libraries: xxx.so.x 错误的原因和解决办法
原博客地址:http://www.cnblogs.com/Anker/p/3209876.html#undefined error while loading shared libraries: xx ...
- 400错误是什么原因_499错误是什么?499错误的原因及解决方法
HTTP状态码出现499错误有多种情况,499错误是什么?下面我们来学习Nginx 499错误的原因及解决方法. 日志记录中HTTP状态码出现499错误有多种情况,比如nginx反代到一个永远打不 ...
- html文件打开系统错误,win7打开word提示“无法打开文件Normal因为内容有错误”的两种解决方法...
win7系统打开Word的时候,弹出提示"无法打开文件Normal.dotm,因为内容有错误",为什么会出现错误提示呢?小编就按照错误提示寻找文件,最后发现是Word自动生成的模板 ...
最新文章
- sublime python3中读取和写入文件时如何解决编码问题
- 基于Pytorch再次解析AlexNet现代卷积神经网络
- poj2253 Frogger dijkstra
- Atlas指南: 建立一个AJAX 涂鸦程序(三)
- python列表比大小_Python列表按组大小排序
- dell保修及其升级3CC
- 解决npm install xxx -g问题
- 平板app尺寸html5,app界面设计尺寸规范大全
- 随笔集:H5如何对接原生app的方法
- 2008中国网游老总语录之史玉柱
- python中求和符号怎么打_SymPy求和表达式中的代换符号
- Codeforces Round #506 (Div. 3)题解
- vb实现webbrowser显示html,VB.NET 通过窗口句柄,获取webbrowser控件HTML内容
- 8086CPU结构与功能
- jsTree插件简介(一)
- java excel 列数_JAVA使用POI获取Excel的列数与行数
- ubuntu16怎么升级到ubuntu18
- 阿里云发布首款云电脑“无影”,价格仅传统电脑的一半
- (项目)生鲜超市(三)
- 顶点计划三——Process book
热门文章
- 一份漂亮的健康体检报告(一)
- SpringBoot集成Liquibase
- 淮南师范学院计算机组成原理试卷,淮南师范学院2008-2009学年度第一学期电机及拖动试卷(2份,有答案)...
- 进程互斥锁,队列,IPC进程间通信,生产者与消费者,线程,线程对象的属性,先行互斥锁...
- 微型计算机内存为16m,微型计算机的内存为16M,指的是其内存容量为()。
- keep sb updated_keep me updated是什么意思
- 解决思科 Cisco Packet Tracer 7.3登录问题
- 2021邓州市二高高考成绩查询,邓州市二高中举行2021届高三冲刺高考誓师大会暨毕业典礼...
- 【Excel函数】相对定位与绝对定位
- String 转表情, Swift 与 OC 中调用