ClassNotFoundException, NoSuchMethodException, NoSuchFieldException at runtime |
missing reflection metadata |
tracing agent; framework hints; reflect-config.json |
MissingReflectionRegistrationError |
same, reported precisely |
register the named type/member |
Resource null / FileNotFoundException for classpath files |
resource not included |
resource-config.json pattern; framework resource setting |
Proxy class defined by interfaces [...] not found |
missing proxy metadata |
proxy-config.json / framework hints |
Classes that should be initialized at run time got initialized during image building |
build-time init of a class holding runtime state (random, sockets, threads, system properties) |
--initialize-at-run-time=<class> |
Object of type X was found in the image heap (random, threads, file handles) |
build-time init stored non-image-safe state |
move init to run time for the owning class |
Detected a started Thread in the image heap |
thread started in a static initializer |
defer to run time |
UnsatisfiedLinkError |
missing JNI/native lib |
jni-config.json; ship or link the native library |
Unsupported features in ... / Discovered unresolved type during parsing |
an optional dependency is missing or the library is unsupported |
add the dependency; upgrade the library; check the reachability metadata repository |
Serialization errors (java.io.Serializable) |
missing serialization metadata |
serialization-config.json / framework hints |
| Out of memory during build |
native build needs several GB |
raise container/CI memory; -J-Xmx<size> as a build arg; close other processes |
| Build very slow |
normal for full optimization |
-O b for dev only; use CI caching; build only in a profile |
| Binary behaves differently from JVM |
build-time initialization, missing metadata, no dynamic class loading |
native tests; tracing agent over the full test suite |
| Large binary |
many dependencies |
review dependencies; -Os; on Oracle GraalVM check --emit build-report (not available in Community Edition) |
Dynamic class loading, Class.forName on unknown names, agents, MethodHandles tricks |
not supported in native images |
refactor to static registration |