Eclipse: сервис не регистрируется на сервере eureka При запуске из eclipse - PullRequest
0 голосов
/ 08 мая 2019

Я создал проект ConfigServer, Eureka Server и Rest Service (UserService). Все проекты Spring-boot gradle. ConfigServer, Eureka Server запускается нормально и работает нормально.

Для UserService, когда я создаю сборку Gradle и запускаю толстый флягу с командой java -jar jarname.jar
служба регистрируется на сервере Eureka и отображается на консоли Eureka.

Но когда я запускаю тот же проект UserService из eclipse, что и Java-приложение, выбирающее основной класс, оно запускается, но никогда не регистрируется на сервере Eureka.

Сравнил журналы для запуска в обоих случаях. Следующие журналы отсутствуют при запуске из затмения против работы в виде толстой банки. Почему служба не регистрируется при запуске из Eclipse? Любые предложения будут приветствоваться.

 Starting beans in phase 0
2019-05-07 12:26:02.858  INFO [user-service,,,] 21568 ---
2019-05-07 12:26:02.639  INFO [user-service,,,] 21568 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Registering beans for JMX exposure on startup
2019-05-07 12:26:02.640  INFO [user-service,,,] 21568 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageChannel errorChannel
2019-05-07 12:26:02.644  INFO [user-service,,,] 21568 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Located managed bean 'org.springframework.integration:type=MessageChannel,name=errorChannel': registering with JMX server as MBean [org.springframework.integration:type=MessageChannel,name=errorChannel]
2019-05-07 12:26:02.709  INFO [user-service,,,] 21568 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageChannel nullChannel
2019-05-07 12:26:02.712  INFO [user-service,,,] 21568 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Located managed bean 'org.springframework.integration:type=MessageChannel,name=nullChannel': registering with JMX server as MBean [org.springframework.integration:type=MessageChannel,name=nullChannel]
2019-05-07 12:26:02.726  INFO [user-service,,,] 21568 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageHandler errorLogger
2019-05-07 12:26:02.728  INFO [user-service,,,] 21568 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Located managed bean 'org.springframework.integration:type=MessageHandler,name=errorLogger,bean=internal': registering with JMX server as MBean [org.springframework.integration:type=MessageHandler,name=errorLogger,bean=internal]
2019-05-07 12:26:02.767  INFO [user-service,,,] 21568 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 0
2019-05-07 12:26:02.858  INFO [user-service,,,] 21568 --- [           main] com.netflix.discovery.DiscoveryClient    : Initializing Eureka in region us-east-1
2019-05-07 12:26:03.164  INFO [user-service,,,] 21568 --- [           main] c.n.d.provider.DiscoveryJerseyProvider   : Using JSON encoding codec LegacyJacksonJson
2019-05-07 12:26:03.164  INFO [user-service,,,] 21568 --- [           main] c.n.d.provider.DiscoveryJerseyProvider   : Using JSON decoding codec LegacyJacksonJson
2019-05-07 12:26:03.332  INFO [user-service,,,] 21568 --- [           main] c.n.d.provider.DiscoveryJerseyProvider   : Using XML encoding codec XStreamXml
2019-05-07 12:26:03.332  INFO [user-service,,,] 21568 --- [           main] c.n.d.provider.DiscoveryJerseyProvider   : Using XML decoding codec XStreamXml
2019-05-07 12:26:03.607  INFO [user-service,,,] 21568 --- [           main] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2019-05-07 12:26:03.651  INFO [user-service,,,] 21568 --- [           main] com.netflix.discovery.DiscoveryClient    : Disable delta property : false
2019-05-07 12:26:03.666  INFO [user-service,,,] 21568 --- [           main] com.netflix.discovery.DiscoveryClient    : Single vip registry refresh property : null
2019-05-07 12:26:03.666  INFO [user-service,,,] 21568 --- [           main] com.netflix.discovery.DiscoveryClient    : Force full registry fetch : false
2019-05-07 12:26:03.666  INFO [user-service,,,] 21568 --- [           main] com.netflix.discovery.DiscoveryClient    : Application is null : false
2019-05-07 12:26:03.666  INFO [user-service,,,] 21568 --- [           main] com.netflix.discovery.DiscoveryClient    : Registered Applications size is zero : true
2019-05-07 12:26:03.666  INFO [user-service,,,] 21568 --- [           main] com.netflix.discovery.DiscoveryClient    : Application version is -1: true
2019-05-07 12:26:03.666  INFO [user-service,,,] 21568 --- [           main] com.netflix.discovery.DiscoveryClient    : Getting all instance registry info from the eureka server
2019-05-07 12:26:03.847  INFO [user-service,,,] 21568 --- [           main] com.netflix.discovery.DiscoveryClient    : The response status is 200
2019-05-07 12:26:03.849  INFO [user-service,,,] 21568 --- [           main] com.netflix.discovery.DiscoveryClient    : Starting heartbeat executor: renew interval is: 30
2019-05-07 12:26:03.851  INFO [user-service,,,] 21568 --- [           main] c.n.discovery.InstanceInfoReplicator     : InstanceInfoReplicator onDemand update allowed rate per min is 4
2019-05-07 12:26:03.855  INFO [user-service,,,] 21568 --- [           main] com.netflix.discovery.DiscoveryClient    : Discovery Client initialized at timestamp 1557212163854 with initial instances count: 4
2019-05-07 12:26:03.864  INFO [user-service,,,] 21568 --- [           main] com.netflix.discovery.DiscoveryClient    : Saw local status change event StatusChangeEvent [timestamp=1557212163864, current=UP, previous=STARTING]

Журналы с консоли Eclipse при запуске, когда служба запускается без регистрации службы

2019-05-08 17:36:29.088  INFO [user-service,,,] 21184 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageChannel nullChannel
2019-05-08 17:36:29.092  INFO [user-service,,,] 21184 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Located managed bean 'org.springframework.integration:type=MessageChannel,name=nullChannel': registering with JMX server as MBean [org.springframework.integration:type=MessageChannel,name=nullChannel]
2019-05-08 17:36:29.098  INFO [user-service,,,] 21184 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageChannel errorChannel
2019-05-08 17:36:29.101  INFO [user-service,,,] 21184 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Located managed bean 'org.springframework.integration:type=MessageChannel,name=errorChannel': registering with JMX server as MBean [org.springframework.integration:type=MessageChannel,name=errorChannel]
2019-05-08 17:36:29.142  INFO [user-service,,,] 21184 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageHandler errorLogger
2019-05-08 17:36:29.144  INFO [user-service,,,] 21184 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Located managed bean 'org.springframework.integration:type=MessageHandler,name=errorLogger,bean=internal': registering with JMX server as MBean [org.springframework.integration:type=MessageHandler,name=errorLogger,bean=internal]
2019-05-08 17:36:29.172  INFO [user-service,,,] 21184 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 0
2019-05-08 17:36:29.172  INFO [user-service,,,] 21184 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2019-05-08 17:36:29.172  INFO [user-service,,,] 21184 --- [           main] o.s.i.channel.PublishSubscribeChannel    : Channel 'user-service-1.errorChannel' has 1 subscriber(s).
2019-05-08 17:36:29.172  INFO [user-service,,,] 21184 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : started _org.springframework.integration.errorLogger
2019-05-08 17:36:29.172  INFO [user-service,,,] 21184 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 2147483647
2019-05-08 17:36:29.230  INFO [user-service,,,] 21184 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8084 (http) with context path ''
2019-05-08 17:36:29.233  INFO [user-service,,,] 21184 --- [           main] io.pivotal.user.UserApplication          : Started UserApplication in 16.091 seconds (JVM running for 17.037)```

1 Ответ

0 голосов
/ 13 мая 2019

Запустил тот же код с STS, и он работал.Кажется, некоторые проблемы с затмением версии кислорода.Он также хорошо работал в Eclipse последней версии 2018-12

...