-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capsules don't start with Java 9 #110
Comments
Ah, Capsule runs a sub-jvm? Perhaps it's not a big deal - I think JMX is mostly used these days with custom agents to export the data anyway. I bet it could be done via reflection and just dropped on Java 9 for now. |
Yes, when not trampolining with a "real executable capsule". After all, Capsule must configure the application's JVM. When trampolining, the app's JVM is replaced by the app's using
I'll try using |
It's actually this one: CAPSULE EXCEPTION: class Capsule (in unnamed module @0x4f9a3314) cannot access class com.sun.jmx.mbeanserver.JmxMBeanServer (in module java.management) because module java.management does not export com.sun.jmx.mbeanserver to unnamed module @0x4f9a3314 (for stack trace, run with -Dcapsule.log=verbose) |
Oh, that may be an even easier fix, but I'll need to learn more about the module system's rules re reflection. Do you have a link for info about the module system (I've never tried it)? |
It's "complicated" :( The place to start reading is here: http://openjdk.java.net/projects/jigsaw The JEP that's relevant to users of internal APIs is here: http://openjdk.java.net/jeps/260 By default, the module system also blocks reflection at runtime into internal APIs. Modules can opt in to having compile time but not runtime encapsulation, but I don't think the JDK modules do this. There are a variety of back doors. One is a command line flag that forcibly exports things from a module i.e. de-encapsulates them. As Capsule controls the JVM command line flags, that is probably the simplest fix, if there isn't a cleaner way to do it. It sounds like this is really just a workaround for a bug/missing feature in the JDK itself though. Shouldn't the JMX server be a daemon thread? Perhaps the best fix is to get the underlying problem resolved in time for Java 9 so the internal accesses are no longer needed. |
Oh, the daemon problem, currently handled by the In the meantime I'll just log the error and ignore it. |
OK. It's a java.lang.IllegalAccessError |
The SNAPSHOT version should now run on JDK 9 (without JMX tunneling) |
What the planned release date of a version including this jdk9 compatibility fix? |
Capsules use JMX internal APIs as part of their startup sequence, which fails on Java 9. It wasn't clear to me from a 30 second glance at the code what exactly Capsule is doing with JMX. The docs don't mention any interactions with it.
I suggest one of the following:
The text was updated successfully, but these errors were encountered: