Closed tomasbjerre closed 8 months ago
Hi @tomasbjerre, thank you for reaching out. Unfortunately, there isn't enough information for us to be able to debug this issue. If you can provide us with a reproducer that is safe to share that would be helpful.
I think it is possible to add more information in this exception without me providing a reproduceable example.
Perhaps throw new AnnotationExtractionError(e);
can be changed to throw new AnnotationExtractionError(message,e);
. Where message
contains information from AnnotatedElement element
. That would hopefully give users something to work with. Perhaps it would tell me some specific class in some specific library is the culprit.
I am not expecting you to solve my actual problem here, I just think you can provide a better error.
Feel free to close the issue if you disagree with this. I cannot provide more information.
@fniephaus should I create a GR for this ?
Thanks for raising this, @tomasbjerre. Sure, we could extend the error message as you suggested. It would still be interesting to know if this is caused by normal end-user code or because you are accessing SVM internals?
Also, have you checked that throw new AnnotationExtractionError(message, e);
actually helps you find the issue?
BTW: Why are you using a Quarkus builder image and Mandrel for building a Spring Boot application?
I am new to Graalvm, I don't know what SVM internals
are. I would suggest you include enough information in the error in order to determine that.
No I have not checked if it would help me. That would mean debugging Graalvm during the build? I cannot do that.
I am using the Quarkus image and Mandrel because that is what my organization provides.
I am new to Graalvm, I don't know what SVM internals are. I would suggest you include enough information in the error in order to determine that.
Ok, good to know. Could you at least hint at what you've done to run into this issue? Instead of blindly changing errors, I'd like to actually confirm that we have made the error better.
This is our first attempt at trying to use Graalvm and Spring Native. So we have not really changed anything. I tried to compile "ahead of time" and also run that with ./gradlew bootRun -Pspring.aot.enabled=true
and that works well on OpenJDK 17.0.2
.
I think you should blindly change errors. I think both users, and you, would benefit of providing clear errors in all three throws
in that findRoot
method. I don't see why you would want to hide information like you currently do.
...
} catch (InvocationTargetException e) {
Throwable targetException = e.getTargetException();
if (targetException instanceof LinkageError) {
throw (LinkageError) targetException;
}
throw new AnnotationExtractionError(e);
} catch (IllegalAccessException e) {
throw new AnnotationExtractionError(e);
}
...
I noticed that if I remove this dependency:
implementation "com.sun.xml.ws:jaxws-rt:4.0.1"
I will get a successful build. But will later get a ClassNotFoundException
at runtime: Caused by: javax.xml.ws.WebServiceException: Provider com.sun.xml.internal.ws.spi.ProviderImpl not found
.
I was able to successfully build and run another one of our apps using the same build chain (Tekton pipeline, Gradle version and Gradle script). I tried adding that dependency to that app, it still worked.
But still, the real issue here is the NPE
and it would be really nice to know something about AnnotatedElement
in the error.
I can only find the fix (419d06cd17f1c686551d139476944fab4b4749db) in master
.
When can we expect this to be released and what version?
This fix will ship with the release of GraalVM for JDK 23 on September 17, 2024. In the meantime, you can use an EA build for JDK 23 or JDK 24.
Describe the issue
I am getting an NPE during
./gradlew nativeBuild
with a Springboot 3.2.2 app. I would suggest changing the code to avoid NPE and instead throw some exception that describes what is wrong.Gradle will run command
/opt/mandrel/bin/native-image -cp xxx -H:+ReportExceptionStackTraces
Steps to reproduce the issue Sorry, cannot supply this information.
Describe GraalVM and your environment:
I know you want me to test with latest versions here, but I am unable to do that because this happens within an organization that does not provide more recent versions.