Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when shutting down feign client #6

Open
igorp1024 opened this issue Jun 6, 2017 · 8 comments
Open

Exception when shutting down feign client #6

igorp1024 opened this issue Jun 6, 2017 · 8 comments

Comments

@igorp1024
Copy link

igorp1024 commented Jun 6, 2017

When you stop application with Feign client (feign-eureka/client in our case) via actuator shutdown endpoint (POST http://localhost:7211/shutdown) it complains with the following exception:

2017-06-06 14:19:35.527  INFO 4440 --- [       Thread-6] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_HELLOCLIENT/192.168.1.180:HelloClient:7211 - deregister  status: 200
2017-06-06 14:19:35.531  INFO 4440 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_HELLOCLIENT/192.168.1.180:HelloClient:7211 - registration status: 204
2017-06-06 14:19:35.540  INFO 4440 --- [       Thread-6] com.netflix.discovery.DiscoveryClient    : Completed shut down of DiscoveryClient
2017-06-06 14:19:35.543  INFO 4440 --- [       Thread-6] o.s.c.support.DefaultLifecycleProcessor  : Stopping beans in phase 0
2017-06-06 14:19:35.552  INFO 4440 --- [       Thread-6] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
2017-06-06 14:19:35.552  INFO 4440 --- [       Thread-6] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans
2017-06-06 14:19:35.555  INFO 4440 --- [       Thread-6] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@59474f18: startup date [Tue Jun 06 14:19:19 MSK 2017]; parent: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@3498ed
2017-06-06 14:19:35.568  WARN 4440 --- [       Thread-6] s.c.a.AnnotationConfigApplicationContext : Exception thrown from ApplicationListener handling ContextClosedEvent

org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'org.springframework.cloud.netflix.eureka.EurekaDiscoveryClientConfiguration': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:216) [spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1081) [spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.context.event.ApplicationListenerMethodAdapter.getTargetBean(ApplicationListenerMethodAdapter.java:280) ~[spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:250) ~[spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:174) ~[spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:137) ~[spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:166) ~[spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138) ~[spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:383) [spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:389) [spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:337) [spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:994) [spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:961) [spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.cloud.context.named.NamedContextFactory.destroy(NamedContextFactory.java:70) [spring-cloud-context-1.1.10.BUILD-SNAPSHOT.jar!/:1.1.10.BUILD-SNAPSHOT]
	at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:272) [spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:578) [spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:554) [spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:954) [spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:523) [spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:961) [spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1033) [spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1009) [spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:961) [spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
	at org.springframework.boot.actuate.endpoint.ShutdownEndpoint$1.run(ShutdownEndpoint.java:74) [spring-boot-actuator-1.4.2.RELEASE.jar!/:1.4.2.RELEASE]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]

@spencergibb
Copy link
Contributor

Removing feign results in not logging the warning?

@igorp1024
Copy link
Author

Yes. There's no exception after removing @FeignClientfrom client/src/main/java/demo/HelloClientApplication.java.

@spencergibb
Copy link
Contributor

You keep referencing your app like I know what's in it, care to share it? (and not as comments).

@igorp1024
Copy link
Author

igorp1024 commented Jun 7, 2017

I'm referencing the official spring-cloud-samples/feign-eureka. :) Sorry for being that unclear.
The issue I'm facing is in the official sample in this repository.

@NameYoung
Copy link

I have the same problem

@icehockeystar
Copy link

I'm experiencing the same problem

@xiaowan
Copy link

xiaowan commented Feb 13, 2018

I want to know how to fix this problem

@spencergibb
Copy link
Contributor

It's a warning, not an error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants