-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
ClassNotFoundException can be thrown for classes in nested jars when under GC pressure #31853
Comments
Thanks for the report. Unfortunately, I think we'll need to be able to reproduce the problem, ideally without running on Openshift, to diagnose it. Can you please provide a complete yet minimal sample that does so? Unless this is a problem that's specific to OpenShift, it should be possible to reproduce the problem by running the same image locally. |
I'll see what I can do. This may take a few days due to the fact that in my workplace the source code can only move in one direction: in. |
Had the same issue after upgrading from 2.6.x to 2.7.2. After I downgraded to 2.7.0 it works fine again. |
@MrWong99 if you can share a sample that we can run that would be much appreciated. |
I tried to extract the crucial parts without leaking any company code. It is however not tested in that format. pom.xml
Dockerfile
The application.yml has nothing special but some settings for spring.cloud.vault and active profiles. |
@MrWong99 We're going to need an actual sample for this. I don't see anything that could cause that behavior in the code snippets you've shared. Starting from a sample application created from start.spring.io and adding relevant bits until you reproduce the problem should give us the information we need. Thanks! |
I'm doing essentially this: https://github.com/ayashkov/spring-boot-31853. Several things though:
I will keep working on it for a few days more, hopefully with better outcome. |
Here is an additional piece of data that may be relevant here. I was able to stop the breakage of the original code by removing <configuration>
<mainClass>com.baml.starter.angular.web.WebApp</mainClass>
<layout>ZIP</layout>
<classifier>exec</classifier>
</configuration> In other words, the following works just fine: <configuration>
<mainClass>com.baml.starter.angular.web.WebApp</mainClass>
<classifier>exec</classifier>
</configuration> |
The issue is reproducible in Docker. Please see https://github.com/ayashkov/spring-boot-31853. |
Digging into this a bit today and the fix for #29356 has caused the regression. The It looks like |
@ayashkov Thanks so much for putting the sample application together, it was really helpful! |
I've pushed something that I hope will fix this but I'm not totally confident. If it doesn't work we may well need to revert the fix for #29356. We're planning a release on Thursday so for anyone watching this issue, once CI build 1110 finishes, please try the latest SNAPSHOT to see if you still have the same problem. |
Unfortunately we're now facing file locking issues on Windows again. I'm going to revert the fix for #29356 |
Overview
A very simple Spring Boot based application locks up on the very first HTTP request with
java.lang.NoClassDefFoundError
present in the logs. Killing the application also causesjava.lang.NoClassDefFoundError
in the logs.The matrix below outlines when the locking happens by the version and the execution environment.
Normal execution
Here is how a normal execution looks.
Stuck execution
Here is how the stuck request looks. I had to press
^C
to abort thecurl
run.This particular application uses WebFlux to serve the request. I tried to convert it to WebMVC. It also gets stuck with
java.lang.NoClassDefFoundError
albeit in a different class.I did a quick diff between 2.6.8 and 2.6.9. I see some changes in
org.springframework.boot.loader.jar
package that may be relevant here. I'm referring to this commit. For what it's worth.The text was updated successfully, but these errors were encountered: