Query Process fails to start intermittently due to access issues in Java 9 and later
Condition
When running a Hue service on Java 9 or later, you may encounter
IllegalAccessError
exceptions related to module access
restrictions. These errors occur because certain internal Java classes (e.g.,
sun.net.util.IPAddressUtil
) are not accessible by default due
to Java’s module system.
Example Error
Messages:
[Guice/ErrorInjectingConstructor]: IllegalAccessError: class SecurityUtil$QualifiedHostResolver (in unnamed module @0x31c88ec8)
cannot access class IPAddressUtil (in module java.base)
because module java.base does not export sun.net.util to unnamed module @0x31c88ec8
Cause
Starting with Java 9, the Java Platform Module System restricts access
to internal Java classes. If your application relies on these internal classes,
the JVM throws an IllegalAccessError
unless the module
explicitly exports the necessary packages.