Tim Bain created AMQ-6864: ----------------------------- Summary: Add appropriate Java 9 JVM arguments to allow reflective access to sun.* classes Key: AMQ-6864 URL: https://issues.apache.org/jira/browse/AMQ-6864 Project: ActiveMQ Issue Type: Bug Reporter: Tim Bain
As reported on the user mailing list (http://activemq.2283324.n4.nabble.com/exception-while-launching-my-application-with-JRE9-when-it-tries-to-establish-a-secure-socket-connecq-td4732904.html), when ActiveMQ runs on a Java 9 JRE, it encounters security exceptions. The Java 9 JRE intentionally prevents access to non-public classes (especially the sun.* ones), which apparently includes reflective access to classes that implement (and are referred to by) public interfaces in java.* and javax.*. There are several JVM arguments that appear to allow that access; --add-exports seems to be the one best-suited to our needs based on about 10 minutes of research, but a more thorough examination of the available options (including --add-opens) should be done before settling on the approach to use. Alternatively, there may be some Java 9-compliant way to do reflection without hitting this issue, or maybe in some cases we can eliminate the use of reflection in favor of compiled code. This will probably be a game of Whack-A-Mole as different users stumble across different places where we use reflection but haven't yet added a JVM flag, but hopefully we can knock off most of the instances on the first try and only have a few places where we need to take another swing. -- This message was sent by Atlassian JIRA (v6.4.14#64029)