You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2020/06/23 04:39:00 UTC

[jira] [Commented] (AMQ-7121) IntrospectionSupport.setProperty should call method.setAccessible(true)

    [ https://issues.apache.org/jira/browse/AMQ-7121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17142626#comment-17142626 ] 

ASF subversion and git services commented on AMQ-7121:
------------------------------------------------------

Commit 88525ce650e0843b555b1ef45834435ef719d2f6 in activemq's branch refs/heads/master from jbonofre
[ https://gitbox.apache.org/repos/asf?p=activemq.git;h=88525ce ]

[AMQ-7121] Set setter accessible (for JDK 11)


> 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
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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)