-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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
NoClassDefFoundError Issue in Spring Boot 3.2 When Running as JAR with spring.threads.virtual.enabled=true #38719
Comments
This may be another symptom of #38611. Could you please try 3.2.1-SNAPSHOT, available from https://repo.spring.io/snapshot, and let us know if it helps? |
Okay, I will try the 3.2.1-SNAPSHOT later and let you know the results. |
Well, it seems that upgrading to 3.2.1-SNAPSHOT doesn’t solve the problem... |
Thanks for the sample. It appears to be more complex than needed as service discovery shouldn't be involved in the HTTP request handling. Please strip things down to the bare minimum that's required to reproduce the problem. If Spring Cloud Gateway is required, please hardcode it's routing if possible, rather than relying on service discovery and load balancing. |
@wilkinsona |
Additionally, If I set the configuration in my build.gradle as follows, the error will not occur: bootJar {
loaderImplementation = org.springframework.boot.loader.tools.LoaderImplementation.CLASSIC
} |
Well, I've simplified the sample for reproduction, but it still need |
@honhimW I still suspect that this is #38611. I notice from the sample that although you're using 3.2.1-SNAPSHOT in your project, you're still using Spring Boot 3.2.0 for the Spring Boot Gradle plugin. It's the plugin that contributes the classes we think we've fixed. Could you please try upgrading the plugin version to see if that fixes the issue. You'll probably also need to update pluginManagement {
repositories {
maven { url 'https://repo.spring.io/milestone' }
maven { url 'https://repo.spring.io/snapshot' }
gradlePluginPortal()
}
} |
@philwebb By the way, regarding this issue, should I close it myself or leave it to you? |
Thanks for confirming that this works with 3.2.1-SNAPSHOT. Enabling virtual threads changes the classes that are loaded and when they are loaded. It may also affect if and when threads are interrupted. One or both of these would be enough to trigger the problem that #38611 has fixed. |
NoClassDefFoundError
Issue in Spring Boot 3.2 When Running as JAR with spring.threads.virtual.enabled=true
I'm experiencing a problem when running my Spring Boot 3.2 application as a JAR with
spring.threads.virtual.enabled=true
. Under certain conditions, the following error is triggered:Upon debugging, I discovered that the actual class that could not be found is "reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber", even though this class does indeed exist in the classpath. This leads me to suspect a class loading issue.
The text was updated successfully, but these errors were encountered: