You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jun Suzuki <ju...@gmail.com> on 2024/02/23 17:26:57 UTC

No classes have been predefined during the image build to load from bytecodes at runtime

By reference to the AOT support guide,
https://tomcat.apache.org/tomcat-9.0-doc/graal.html, I built a spring
framework 6.x based web application into a native image.
I'm using GraalVM for JDK17.
When finally ran the native image, it gave following error message:

INFO: Initializing Spring root WebApplicationContext
Feb 23, 2024 4:04:24 PM org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Exception sending context initialized event to listener instance of
class [org.springframework.web.context.ContextLoaderListener]
com.oracle.svm.core.jdk.UnsupportedFeatureError: No classes have been
predefined during the image build to load from bytecodes at runtime.
        at
org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:92)
        at
org.graalvm.nativeimage.builder/com.oracle.svm.core.hub.PredefinedClassesSupport.throwNoBytecodeClasses(PredefinedClassesSupport.java:76)
        at
org.graalvm.nativeimage.builder/com.oracle.svm.core.hub.PredefinedClassesSupport.loadClass(PredefinedClassesSupport.java:130)
        at java.base@17.0.10
/java.lang.ClassLoader.defineClass(ClassLoader.java:294)

The web application is running well in terms of WAR on Tomcat10.x, and
tomcat-stuffed-1.0.jar also running well.
Could you please confirm whether a spring framework 6.x web application is
also applicable to the AOT support approach?
And I would appreciate your insights on above native image runtime errors.

Best regards,
Jun