Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
5.15.8
-
None
-
None
-
Patch Available
Description
We are trying to run a broker in JDK 11 and run into the following exception:
2018-12-07 12:44:41,363 ERROR main o.a.a.u.IntrospectionSupport Could not set property soTimeout on ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=9505] java.lang.IllegalAccessException: class org.apache.activemq.util.IntrospectionSupport cannot access a member of class sun.nio.ch.ServerSocketAdaptor (in module java.base) with modifiers "public" at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361) at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:591) at java.base/java.lang.reflect.Method.invoke(Method.java:558) at org.apache.activemq.util.IntrospectionSupport.setProperty(IntrospectionSupport.java:184) at org.apache.activemq.util.IntrospectionSupport.setProperties(IntrospectionSupport.java:155) at org.apache.activemq.transport.tcp.TcpTransportServer.configureServerSocket(TcpTransportServer.java:187) at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:142) at org.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:62) at org.apache.activemq.transport.TransportFactorySupport.bind(TransportFactorySupport.java:40) at org.apache.activemq.broker.TransportConnector.createTransportServer(TransportConnector.java:318) at org.apache.activemq.broker.TransportConnector.getServer(TransportConnector.java:141)
Note that we also see
Could not set property reuseAddress ...
These are caused by sun.nio.ch.ServerSocketAdaptor becoming a non-public class in JDK 11 (if not earlier).
It can be fixed simply by having IntrospectionSupport.setProperty call setter.setAccessible(true) before it invokes any methods on it.
Otherwise we find our local broker runs perfectly fine.