[
https://issues.apache.org/jira/browse/AMQ-7121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jean-Baptiste Onofré reassigned AMQ-7121:
-----------------------------------------
Assignee: Jean-Baptiste Onofré
> IntrospectionSupport.setProperty should call method.setAccessible(true)
> -----------------------------------------------------------------------
>
> Key: AMQ-7121
> URL: https://issues.apache.org/jira/browse/AMQ-7121
> Project: ActiveMQ
> Issue Type: Bug
> Affects Versions: 5.15.8
> Reporter: Ollie Robertshaw
> Assignee: Jean-Baptiste Onofré
> Priority: Minor
> Fix For: 5.16.0
>
> Attachments: AMQ-7121_Set_accessible.patch
>
> Original Estimate: 2m
> Remaining Estimate: 2m
>
> We are trying to run a broker in JDK 11 and run into the following exception:
> {code:java}
> 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){code}
> Note that we also see
> {code:java}
> Could not set property reuseAddress ...{code}
> 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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)