You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NullPointerException in Inflation.checkType() #655
This happens on native image generation with rc6 (but not rc5):
...
Caused by: java.lang.NullPointerException
at com.oracle.svm.hosted.analysis.Inflation.checkType(Inflation.java:139)
at java.lang.Iterable.forEach(Iterable.java:75)
at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080)
at com.oracle.svm.hosted.analysis.Inflation.checkObjectGraph(Inflation.java:130)
at com.oracle.graal.pointsto.BigBang.checkObjectGraph(BigBang.java:590)
at com.oracle.graal.pointsto.BigBang.finish(BigBang.java:562)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:690)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:401)
...
I have the same error while compiling Spring Fu Graal sample webapp which works with RC5. Sadly this regression makes RC6 unusable for Spring webapps. Any chance to fix this on master in order to allow us to move forward?
Thanks for reporting. We will fix this asap. Maybe we can use the Spring Fu Graal sample webapp in our regression testing - what is the license on the code?
Spring Fu code base moves a lot, so I am not sure it will be easy for you to use it, but I will provide you tomorrow a minimal Boot sample project with current other issues workaround that you will be able to use easily for regression testing.
@sdeleuze thank you! Update: this regression is only a problem for apps that have incomplete class paths. I am working on it but a proper solution will take more time. Once this is fixed I will add your example app to our internal gate.
WebApplicationContext uses javax.servlet.ServletContext which is not on the classpath.
This is reached via:
at org.springframework.boot.SpringApplication.setApplicationContextClass(SpringApplication.java:1178)
at com.example.func.BuncApplication.run(BuncApplication.java:54)
at com.example.func.BuncApplication.main(BuncApplication.java:34)
at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:163)
We get the same NoClassDefFoundError, which on the JVM is gracefully ignored, during the image building when calling Class.getDeclaredMethods() on WebApplicationContext.class which leads to some inconsistent state which leads to the NPE.
I have been able to work around this with AspectJ. You can weave an aspect at runtime into the Graal native image generator that catches the exception and swallows it. It's the same issue in Fu and the same workaround would work. IMO this needs to be fixed here though.
@dsyer yes, we plan to fully support apps with incomplete class paths as it looks like major Java frameworks use this approach. It just proves to be more difficult than we initially thought.
Activity
sdeleuze commentedon Sep 4, 2018
I have the same error while compiling Spring Fu Graal sample webapp which works with RC5. Sadly this regression makes RC6 unusable for Spring webapps. Any chance to fix this on
masterin order to allow us to move forward?thomaswue commentedon Sep 4, 2018
Thanks for reporting. We will fix this asap. Maybe we can use the Spring Fu Graal sample webapp in our regression testing - what is the license on the code?
sdeleuze commentedon Sep 4, 2018
Sure feel free to do so, it is licensed under Apache.
sdeleuze commentedon Sep 5, 2018
Spring Fu code base moves a lot, so I am not sure it will be easy for you to use it, but I will provide you tomorrow a minimal Boot sample project with current other issues workaround that you will be able to use easily for regression testing.
thomaswue commentedon Sep 5, 2018
OK, excellent, that would be great!
sdeleuze commentedon Sep 6, 2018
Please find the repro project in https://github.com/sdeleuze/spring-boot-graal-demo, it is Apache 2 licensed. Notice this is not yet a typical Boot app because I can't use
@Configurationscanning due to #630. I will create branches for other issues asap this blocking regression will be solved.sdeleuze commentedon Sep 6, 2018
I have pushed a new commit that should avoid to hit #564 with GraalVM 1.0.0.RC5
cstancu commentedon Sep 6, 2018
@sdeleuze thank you! Update: this regression is only a problem for apps that have incomplete class paths. I am working on it but a proper solution will take more time. Once this is fixed I will add your example app to our internal gate.
sdeleuze commentedon Sep 7, 2018
Do you know what is the missing dependency in this case (this is not obvious from the error message)?
cstancu commentedon Sep 7, 2018
@sdeleuze for the original issue reported by @dsyer the problem is in
SpringApplication.isWebApplicationContext:WebApplicationContextusesjavax.servlet.ServletContextwhich is not on the classpath.This is reached via:
We get the same
NoClassDefFoundError, which on the JVM is gracefully ignored, during the image building when callingClass.getDeclaredMethods()onWebApplicationContext.classwhich leads to some inconsistent state which leads to the NPE.(I haven't looked in the Spring Fu failure yet.)
dsyer commentedon Sep 7, 2018
I have been able to work around this with AspectJ. You can weave an aspect at runtime into the Graal native image generator that catches the exception and swallows it. It's the same issue in Fu and the same workaround would work. IMO this needs to be fixed here though.
cstancu commentedon Sep 7, 2018
@dsyer yes, we plan to fully support apps with incomplete class paths as it looks like major Java frameworks use this approach. It just proves to be more difficult than we initially thought.
sdeleuze commentedon Nov 11, 2018
This issue is solved by
--allow-incomplete-classpathand can be closed.