报错:
2018-05-30 18:07:35.436 INFO 7912 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@20ce78ec: startup date [Wed May 30 18:07:35 CST 2018]; root of context hierarchy
2018-05-30 18:07:35.652 INFO 7912 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2018-05-30 18:07:35.699 INFO 7912 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$a1cf77d7] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.0.2.RELEASE)
2018-05-30 18:07:36.603 INFO 7912 --- [ main] com.zsl.client.ClientApplication : No active profile set, falling back to default profiles: default
2018-05-30 18:07:36.616 INFO 7912 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@198d6542: startup date [Wed May 30 18:07:36 CST 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@20ce78ec
2018-05-30 18:07:36.977 INFO 7912 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=c0d788a6-3698-3a44-a78c-18f4704863ee
2018-05-30 18:07:36.990 INFO 7912 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2018-05-30 18:07:37.047 INFO 7912 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$a1cf77d7] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-05-30 18:07:37.155 WARN 7912 --- [ main] o.s.c.n.a.ArchaiusAutoConfiguration : No spring.application.name found, defaulting to 'application'
2018-05-30 18:07:37.157 WARN 7912 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2018-05-30 18:07:37.158 INFO 7912 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2018-05-30 18:07:37.162 WARN 7912 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2018-05-30 18:07:37.162 INFO 7912 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2018-05-30 18:07:38.757 INFO 7912 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-05-30 18:07:38.764 INFO 7912 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'configurationPropertiesRebinder' has been autodetected for JMX exposure
2018-05-30 18:07:38.765 INFO 7912 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'environmentManager' has been autodetected for JMX exposure
2018-05-30 18:07:38.765 INFO 7912 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'refreshScope' has been autodetected for JMX exposure
2018-05-30 18:07:38.768 INFO 7912 --- [ 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-05-30 18:07:38.780 INFO 7912 --- [ 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-05-30 18:07:38.789 INFO 7912 --- [ 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=198d6542,type=ConfigurationPropertiesRebinder]
2018-05-30 18:07:38.797 INFO 7912 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 0
2018-05-30 18:07:38.805 INFO 7912 --- [ main] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING
2018-05-30 18:07:38.842 INFO 7912 --- [ main] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-1
2018-05-30 18:07:39.072 INFO 7912 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2018-05-30 18:07:39.072 INFO 7912 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2018-05-30 18:07:39.188 INFO 7912 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2018-05-30 18:07:39.188 INFO 7912 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
2018-05-30 18:07:39.376 INFO 7912 --- [ main] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration
2018-05-30 18:07:39.763 INFO 7912 --- [ main] com.netflix.discovery.DiscoveryClient : Disable delta property : false
2018-05-30 18:07:39.763 INFO 7912 --- [ main] com.netflix.discovery.DiscoveryClient : Single vip registry refresh property : null
2018-05-30 18:07:39.764 INFO 7912 --- [ main] com.netflix.discovery.DiscoveryClient : Force full registry fetch : false
2018-05-30 18:07:39.764 INFO 7912 --- [ main] com.netflix.discovery.DiscoveryClient : Application is null : false
2018-05-30 18:07:39.764 INFO 7912 --- [ main] com.netflix.discovery.DiscoveryClient : Registered Applications size is zero : true
2018-05-30 18:07:39.764 INFO 7912 --- [ main] com.netflix.discovery.DiscoveryClient : Application version is -1: true
2018-05-30 18:07:39.764 INFO 7912 --- [ main] com.netflix.discovery.DiscoveryClient : Getting all instance registry info from the eureka server
2018-05-30 18:07:39.916 INFO 7912 --- [ main] com.netflix.discovery.DiscoveryClient : The response status is 200
2018-05-30 18:07:39.919 INFO 7912 --- [ main] com.netflix.discovery.DiscoveryClient : Starting heartbeat executor: renew interval is: 30
2018-05-30 18:07:39.921 INFO 7912 --- [ main] c.n.discovery.InstanceInfoReplicator : InstanceInfoReplicator onDemand update allowed rate per min is 4
2018-05-30 18:07:39.926 INFO 7912 --- [ main] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1527674859924 with initial instances count: 1
2018-05-30 18:07:39.930 INFO 7912 --- [ main] o.s.c.n.e.s.EurekaServiceRegistry : Registering application unknown with eureka with status UP
2018-05-30 18:07:39.930 INFO 7912 --- [ main] com.netflix.discovery.DiscoveryClient : Saw local status change event StatusChangeEvent [timestamp=1527674859930, current=UP, previous=STARTING]
2018-05-30 18:07:39.932 INFO 7912 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_UNKNOWN/OnePiece: registering service...
2018-05-30 18:07:39.948 INFO 7912 --- [ main] com.zsl.client.ClientApplication : Started ClientApplication in 6.129 seconds (JVM running for 7.74)
2018-05-30 18:07:39.952 INFO 7912 --- [ Thread-18] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@198d6542: startup date [Wed May 30 18:07:36 CST 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@20ce78ec
2018-05-30 18:07:39.953 INFO 7912 --- [ Thread-18] o.s.c.n.e.s.EurekaServiceRegistry : Unregistering application unknown with eureka with status DOWN
2018-05-30 18:07:39.953 WARN 7912 --- [ Thread-18] com.netflix.discovery.DiscoveryClient : Saw local status change event StatusChangeEvent [timestamp=1527674859953, current=DOWN, previous=UP]
2018-05-30 18:07:39.956 INFO 7912 --- [ Thread-18] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 0
2018-05-30 18:07:39.958 INFO 7912 --- [ Thread-18] com.netflix.discovery.DiscoveryClient : Shutting down DiscoveryClient ...
2018-05-30 18:07:39.974 INFO 7912 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_UNKNOWN/OnePiece - registration status: 204
2018-05-30 18:07:39.975 INFO 7912 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_UNKNOWN/OnePiece: registering service...
2018-05-30 18:07:39.981 INFO 7912 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_UNKNOWN/OnePiece - registration status: 204
2018-05-30 18:07:39.982 INFO 7912 --- [ Thread-18] com.netflix.discovery.DiscoveryClient : Unregistering ...
2018-05-30 18:07:39.989 INFO 7912 --- [ Thread-18] com.netflix.discovery.DiscoveryClient : DiscoveryClient_UNKNOWN/OnePiece - deregister status: 200
2018-05-30 18:07:39.999 INFO 7912 --- [ Thread-18] com.netflix.discovery.DiscoveryClient : Completed shut down of DiscoveryClient
2018-05-30 18:07:40.000 INFO 7912 --- [ Thread-18] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2018-05-30 18:07:40.000 INFO 7912 --- [ Thread-18] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans
Process finished with exit code 0
解决方法:
在pom.xml中加入
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
即可
SpringCloud客户端Client启动时自动停止
最新推荐文章于 2024-09-08 08:55:49 发布