[jboss-jira] [JBoss JIRA] (WFLY-4259) ClassNotFound exception when connecting a remote HornetQ client over SSL
Matteo Mortari (JIRA)
issues at jboss.org
Thu Feb 19 04:02:50 EST 2015
[ https://issues.jboss.org/browse/WFLY-4259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041715#comment-13041715 ]
Matteo Mortari commented on WFLY-4259:
--------------------------------------
I agree with the described solution/workaround which was also reported here :https://issues.jboss.org/browse/IMMUTANT-466
This also impacts JMS Core bridges because it would cause {{ClassNotFoundException: javax.net.ssl.SSLException}} when using JMS bridge over SSL / HTTPS configuration.
For example my configuration:
{code:xml}
<subsystem xmlns="urn:jboss:domain:messaging:2.0">
<hornetq-server>
<!-- ... -->
<connectors>
<!-- ... -->
<http-connector name="my_other_wildfly_server-https-connector" socket-binding="my_other_wildfly_server-https">
<param key="ssl-enabled" value="true"/>
<param key="trust-store-path" value="${jboss.server.config.dir}/server.truststore"/>
<param key="trust-store-password" value="truststore_password"/>
</http-connector>
<!-- ... -->
<in-vm-connector name="in-vm" server-id="0"/>
</connectors>
<bridges>
<bridge name="my_bridge">
<queue-name>jms.queue.myqueue</queue-name>
<forwarding-address>jms.queue.myqueue</forwarding-address>
<ha>true</ha>
<retry-interval>1000</retry-interval>
<retry-interval-multiplier>1.0</retry-interval-multiplier>
<reconnect-attempts>-1</reconnect-attempts>
<failover-on-server-shutdown>false</failover-on-server-shutdown>
<use-duplicate-detection>true</use-duplicate-detection>
<confirmation-window-size>10000000</confirmation-window-size>
<user>my_user</user>
<password>my_password</password>
<static-connectors>
<connector-ref>
my_other_wildfly_server-https-connector
</connector-ref>
</static-connectors>
</bridge>
</bridges>
<!-- ... -->
</hornetq-server>
</subsystem>
<!-- ... -->
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
<!-- ... -->
<outbound-socket-binding name="my_other_wildfly_server-https">
<remote-destination host="my_other_wildfly_server.acme.com" port="443"/>
</outbound-socket-binding>
</socket-binding-group>
{code}
If I don't modify the {{module.xml}} I would get the following in the wildfly logs:
{noformat}
2015-02-19 09:38:10,974 WARNING [io.netty.channel.ChannelInitializer] (Thread-0 (HornetQ-client-netty-threads-1521784614)) Failed to initialize a channel. Closing: [id: 0xaeae9aee]: java.lang.NoClassDefFoundError: javax/net/ssl/SSLException
at org.hornetq.core.remoting.impl.netty.NettyConnector$1.initChannel(NettyConnector.java:591) [hornetq-core-client-2.4.5.Final.jar:]
at io.netty.channel.ChannelInitializer.channelRegistered(ChannelInitializer.java:69) [netty-all-4.0.15.Final.jar:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRegistered(DefaultChannelHandlerContext.java:163) [netty-all-4.0.15.Final.jar:4.0.15.Final]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRegistered(DefaultChannelHandlerContext.java:149) [netty-all-4.0.15.Final.jar:4.0.15.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRegistered(DefaultChannelPipeline.java:730) [netty-all-4.0.15.Final.jar:4.0.15.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:442) [netty-all-4.0.15.Final.jar:4.0.15.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe.access$100(AbstractChannel.java:374) [netty-all-4.0.15.Final.jar:4.0.15.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:418) [netty-all-4.0.15.Final.jar:4.0.15.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [netty-all-4.0.15.Final.jar:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353) [netty-all-4.0.15.Final.jar:4.0.15.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [netty-all-4.0.15.Final.jar:4.0.15.Final]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_25]
Caused by: java.lang.ClassNotFoundException: javax.net.ssl.SSLException from [Module "io.netty:main" from local module loader @2471cca7 (finder: local module finder @5fe5c6f (roots: /data/wildfly-8.2.0.Final/modules,/data/wildfly-8.2.0.Final/modules/system/layers/base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final]
... 12 more
2015-02-19 09:38:10,980 ERROR [org.hornetq.core.client] (Thread-11 (HornetQ-server-HornetQServerImpl::serverUUID=76bc6c71-aae5-11e4-8153-7525608b7f2a-900496571)) HQ214016: Failed to create netty connection: java.nio.channels.ClosedChannelException
{noformat}
But with the io.netty {{module.xml}} modified as proposed, it resolve the issue.
> ClassNotFound exception when connecting a remote HornetQ client over SSL
> ------------------------------------------------------------------------
>
> Key: WFLY-4259
> URL: https://issues.jboss.org/browse/WFLY-4259
> Project: WildFly
> Issue Type: Bug
> Components: JMS
> Affects Versions: 8.1.0.Final, 8.2.0.Final
> Reporter: Jon Kranes
> Assignee: Jeff Mesnil
>
> When using HornetQ with a remote client connecting with SSL (using a netty-connector with ssl-enabled=true) the server throws an exception in ModuleClassLoader when the client attempts to connect. The exception is:
> java.lang.ClassNotFoundException: javax.net.SSLException
> After doing some investigation I was able to resolve this issue by adding a dependency in the io.netty module.xml file
> <dependencies>
> <module name="javax.api"/>
> <dependencies
> Without this dependency, it appear that Netty is unable to load classes that it needs from javax.net.ssl.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
More information about the jboss-jira
mailing list