{"record":{"id":"cef283e25d928742","repo":"oracle/graal","slug":"s-is-not-an-enum-type","errorCode":null,"errorMessage":"%s is not an enum type","messagePattern":"(.+?) is not an enum type","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/annotation/EnumElement.java","lineNumber":52,"sourceCode":"     * The type of the enum.\n     */\n    public final ResolvedJavaType enumType;\n\n    /**\n     * The name of the enum constants.\n     */\n    public final String name;\n\n    /**\n     * Creates an enum constant.\n     *\n     * @param enumType the {@linkplain Enum enum type}\n     * @param name the {@linkplain Enum#name() name} of the enum\n     * @throws IllegalArgumentException if {@code enumType} is not an enum type\n     */\n    public EnumElement(ResolvedJavaType enumType, String name) {\n        if (!enumType.isEnum()) {\n            throw new IllegalArgumentException(enumType.toClassName() + \" is not an enum type\");\n        }\n        this.enumType = enumType;\n        this.name = name;\n    }\n\n    @Override\n    public String toString() {\n        return name;\n    }\n\n    @Override\n    public boolean equals(Object obj) {\n        if (obj instanceof EnumElement that) {\n            return this.enumType.equals(that.enumType) && this.name.equals(that.name);\n        }\n        return false;\n    }\n","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/annotation/EnumElement.java#L34-L70","documentation":"JNIExceptionWrapper needs its host-side entry-points class (org.graalvm.jniutils.JNIExceptionWrapperEntryPoints) loaded through JNI FindClass, first via the JVMCI classloader. If every lookup path fails and no pending JNI exception can be reported, it clears the exception and throws InternalError: the infrastructure class itself could not be loaded, so exception wrapping is impossible. This is a classloading/configuration failure in the embedded JVM setup.","triggerScenarios":"org.graalvm.jniutils jar missing from the class path visible to the host JVMCI classloader; classloader delegation hiding the class; a NoClassDefFoundError during static init of the entry-points class that was swallowed by ExceptionClear; severe classpath conflicts in an embedded Espresso/libgraal setup.","commonSituations":"Shading/relocating the jniutils jar so the binary name no longer resolves; running native-image/Espresso with a partial class path; duplicate incompatible copies of the SDK on the classpath.","solutions":["Ensure the org.graalvm.jniutils artifact (correct version) is on the class path of the host VM used by JVMCI.","Remove shading/relocation rules that rewrite org.graalvm.jniutils class names, or add them as exclusions.","Deduplicate GraalVM SDK jars (mvn dependency:tree / classpath inspection) so a single consistent version loads."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"try {\n    Class.forName(\"org.graalvm.jniutils.JNIExceptionWrapperEntryPoints\", false, jvmciClassLoader);\n} catch (ClassNotFoundException e) {\n    throw new IllegalStateException(\"jniutils jar missing from host classpath\", e);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep org.graalvm.jniutils on the host-VM class path and unshaded.","Use a GraalVM BOM so all SDK artifacts come from one consistent version.","Add a class-visibility smoke test for the entry-points class in CI."],"tags":["jni","classloading","classpath","version-mismatch"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}