-
Notifications
You must be signed in to change notification settings - Fork 114
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
Upgrading from JAXB 4.0.1 to 4.0.2 throws ClassNotFoundException #1703
Comments
Nothing jaxb code related in the stack trace. |
@lukasj Just to clarify in case it was misunderstood. Literally the ONLY thing I changed in the application is the following: I was using:
And I changed it to:
And the application throws this exception. So what do you suggest I do here? |
mvn dependency:tree comparision can be good start and perhaps can lead to finding real cause eventually |
Thanks for the suggestion @lukasj I did what you proposed and found the artefact that causes the issue. It's jaxb-runtime, version 4.0.2. |
Also note that I do not know what your app is, how/if it manages classloading, on which JDK and how exactly it is expected to run, during which operation does the exception appear, so whatever I say is just a blind guess - at least till steps to reproduce are provided. Anyway, one obvious workaround is to add graal-sdk to the classpath or modulepath, another is to lower versions of jaxb-runtime dependencies |
After analyzing this myself this stems from JAXB upgrading a dependency. There was NOTHING in the application code that caused the issue. To make it work I had to exclude the angus-activation that was updated. For folks hitting this issue I changed my dependency to be:
|
The question on how to reproduce the issue with standalone reproducer remains unanswered |
@lukasj maybe this one is a problem? Seemingly this class is being picked up by a non-Graal JVM too, and then it obviously all comes down. |
@arjantijms WHY is that class being picked up, by who and when? It is not - or should not be - reachable by any other VM just by itself; unless there is some sort of eager loading in place - if there is, it should not be difficult to provide details. |
@lukasj After some investigation I managed to obtain some more details. It concerns Piranha Web Profile, which can be found here: https://github.com/piranhacloud/piranha/tree/current/dist/webprofile The issue occurs when annotation scanning takes place, which looks at all classes in the class loader. That's why it picks up that class. So: WHY - Annotation scanning looks at all classes Reproducer: Checkout https://github.com/manorrock/persian (https://github.com/manorrock/persian.git) |
missing parts of the stacktrace which clearly identify the WHO part of the problem - shouldn't this been part of the initial report?:
to me this looks like a problem in how missing annotations are handled in Piranha Cloud. Consider following case:
=> all one can see is following in the output and application seems to run fine:
or following case:
=> application seems to run fine (there's nothing in the log)
=> log shows following and application startup fails
If piranha is able to handle missing |
@lukasj Thank you for these details. This will help a LOT! |
Caused by: java.lang.ClassNotFoundException: org.graalvm.nativeimage.hosted.Feature
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
... 30 more
The text was updated successfully, but these errors were encountered: