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

BeanCreationNotAllowedException after deregistering service with consul #842

Open
DongSeungLee opened this issue Oct 30, 2024 · 0 comments

Comments

@DongSeungLee
Copy link

DongSeungLee commented Oct 30, 2024

Describe the bug
Please provide details of the problem, including the version of Spring Cloud that you
are using.
My development environment is like below.
spring boot 2.5.13
spring boot starter consul discovery 3.0.4
spring boot starter gateway 3.0.6

i have customHealthIndicator implementing ReactiveHealthIndicator, thus, i always health down before shutdown my application.
sometimes, after health down, around 30s elapsed, i kill -15 pid(my application pid), errors are printed like below.

2024-10-29 08:09:04.313  INFO 266172 --- [SpringApplicationShutdownHook] o.s.c.c.s.ConsulServiceRegistry          : Deregistering service with consul: server:xxxxxxxxxx

2024-10-29 08:09:04.352 ERROR 266172 --- [catalogWatchTaskScheduler-1] o.s.c.gateway.route.CachingRouteLocator  : Refresh routes error !!!

org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'defaultValidator': 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!)

2024-10-29 08:09:04.354 ERROR 266172 --- [catalogWatchTaskScheduler-1] o.s.c.c.discovery.ConsulDiscoveryClient  : Error watching Consul CatalogServices

org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'cachedCompositeRouteLocator': 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!)

it seems my application try to generate bean after receiving shutdown signal.
how can i overcome this problem? and i'd like to identify the cause

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

No branches or pull requests

2 participants