-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
ClassNotFound during static init build step corrupts delayed logging #45650
Comments
/cc @dmlloyd (logging) |
That would indeed make it much easier for us to verify any potential fixes |
A basic attempt of doing a little better can be found in #45713 |
@geoand @dmlloyd the sequence here:
@geoand I think your solution will work, or a better close ordering could be attempted, or a more graceful handling of getRoot/getRoots after closure could be used. |
I think the main bug to fix here would be that |
The idea of nulling things is that we should avoid loading classes from closed class loaders. In the end, we would have liked throwing an error when it happens. So ideally I would prefer if we dumped the logs before we close the CL. But I haven’t looked at the code at all. |
Describe the bug
An underlying classnotfound exception during a static init build step is causing the delayed logging handling to fail with a NullPointerException and the delayed logging is incomplete.
Expected behavior
The delayed logging should work and/or the underlying exception should be propogated to the caller of QuarkusEntryPoint.main().
Actual behavior
With an underlying class not found exception during a static init build step (captured via a debug session):
There is then an attempt to purge the delayed logging entries:
However that triggers a NullPointerException, so that Keycloak shows:
How to Reproduce?
Add a jar to the provider directory with a missing class - I used https://github.com/keycloak/keycloak-quickstarts/tree/main/extension/authenticator and remove the Provider classes referenced by the Factories, see also keycloak/keycloak#36482
Run a build
I can also try to isolate this to a non-Keycloak quarkus project if needed.
Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
3.15.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
The Keycloak user reported that this behavior did not occur with Keycloak based upon Quarkus 3.8.5.
The text was updated successfully, but these errors were encountered: