spring-projects / spring-boot

Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss.
https://spring.io/projects/spring-boot
Apache License 2.0
75.22k stars 40.7k forks source link

spring-boot-starter-parent:3.3.0 java 22 threads.virtual NOT WORKING #41092

Closed sysmat closed 5 months ago

sysmat commented 5 months ago
Error creating bean with name 'dataSourceScriptDatabaseInitializer': 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!)
wilkinsona commented 5 months ago

Judging by the stack trace, a request is being processed after context shutdown has begun. You've mentioned virtual threads in the issue title, but it's not clear to me how they relate to the problem.

It looks like an exception has occurred when calling findById and PersistenceExceptionTranslationInterceptor is attempting to translate it. No exception translation has occurred prior to this so it's trying to get them from the bean factory. This is failing as the bean factory is currently being destroyed.

If this somewhat educated guess is accurate, you may want to consider using Spring Boot's support for graceful shutdown to see if that helps. Beyond that, if you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.

sysmat commented 5 months ago
sysmat commented 5 months ago
openjdk 22.0.1 2024-04-16
OpenJDK Runtime Environment (Red_Hat-22.0.1.0.8-1) (build 22.0.1+8)
OpenJDK 64-Bit Server VM (Red_Hat-22.0.1.0.8-1) (build 22.0.1+8, mixed mode, sharing)

Alma 9 OS

sysmat commented 5 months ago

WMware

wilkinsona commented 5 months ago

@sysmat each comment you make on this issue potentially notifies 1000s of people. Can you please try to collect all your thoughts and the requested information and then make a single comment rather than splitting things up so much.

sysmat commented 5 months ago
wilkinsona commented 5 months ago

I'm afraid I'm going to close this now as we don't appear to be getting anywhere. If you can provide the requested minimal example we can re-open the issue and take another look.