Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-4259

ClassNotFound exception when connecting a remote HornetQ client over SSL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 9.0.0.Beta1
    • 8.1.0.Final, 8.2.0.Final
    • JMS
    • None
    • Hide

      Configure Wildfly to use HornetQ messaging similar to the following:

      <subsystem xmlns="urn:jboss:domain:messaging:2.0">
      <hornetq-server>
      <security-enabled>false</security-enabled>
      <connectors>
      <netty-connector name="netty-ssl-connector" socket-binding="https">
      <param key="ssl-enabled" value="true"/>
      <param key="trust-store-path" value="/foo/trust.jks"/>
      <param key="trust-store-password" value="xxx"/>
      <param key="key-store-path" value="/foo/key.jks"/>
      <param key="key-store-password" value="xxx"/>
      <param key="host" value="localhost"/>
      </netty-connector>
      <in-vm-connector name="in-vm" server-id="0"/>
      </connectors>

      <acceptors>
      <netty-acceptor name="netty-ssl-acceptor" socket-binding="https">
      <param key="ssl-enabled" value="true"/>
      <param key="trust-store-path" value="/foo/trust.jks"/>
      <param key="trust-store-password" value="xxx"/>
      <param key="key-store-path" value="/foo/key.jks"/>
      <param key="key-store-password" value="password"/>
      <param key="host" value="localhost"/>
      </netty-acceptor>
      <in-vm-acceptor name="in-vm" server-id="0"/>
      </acceptors>

      <jms-connection-factories>
      <connection-factory name="ConnectionFactory">
      <connectors>
      <connector-ref connector-name="netty-ssl-connector"/>
      </connectors>
      <entries>
      <entry name="java:/jboss/exported/jms/ConnectionFactory"/>
      </entries>
      </connection-factory>
      <pooled-connection-factory name="hornetq-ra">
      <transaction mode="xa"/>
      <connectors>
      <connector-ref connector-name="in-vm"/>
      </connectors>
      <entries>
      <entry name="java:jboss/DefaultJMSConnectionFactory"/>
      </entries>
      </pooled-connection-factory>
      </jms-connection-factories>
      </hornetq-server>

      Create a remote JMS client to connect to the server using the exported connection obtained from JNDI (using http-remoting). When the client attempts to connect the server throws the ClassNotFound exception mentioned above and the connection fails.

      Show
      Configure Wildfly to use HornetQ messaging similar to the following: <subsystem xmlns="urn:jboss:domain:messaging:2.0"> <hornetq-server> <security-enabled>false</security-enabled> <connectors> <netty-connector name="netty-ssl-connector" socket-binding="https"> <param key="ssl-enabled" value="true"/> <param key="trust-store-path" value="/foo/trust.jks"/> <param key="trust-store-password" value="xxx"/> <param key="key-store-path" value="/foo/key.jks"/> <param key="key-store-password" value="xxx"/> <param key="host" value="localhost"/> </netty-connector> <in-vm-connector name="in-vm" server-id="0"/> </connectors> <acceptors> <netty-acceptor name="netty-ssl-acceptor" socket-binding="https"> <param key="ssl-enabled" value="true"/> <param key="trust-store-path" value="/foo/trust.jks"/> <param key="trust-store-password" value="xxx"/> <param key="key-store-path" value="/foo/key.jks"/> <param key="key-store-password" value="password"/> <param key="host" value="localhost"/> </netty-acceptor> <in-vm-acceptor name="in-vm" server-id="0"/> </acceptors> <jms-connection-factories> <connection-factory name="ConnectionFactory"> <connectors> <connector-ref connector-name="netty-ssl-connector"/> </connectors> <entries> <entry name="java:/jboss/exported/jms/ConnectionFactory"/> </entries> </connection-factory> <pooled-connection-factory name="hornetq-ra"> <transaction mode="xa"/> <connectors> <connector-ref connector-name="in-vm"/> </connectors> <entries> <entry name="java:jboss/DefaultJMSConnectionFactory"/> </entries> </pooled-connection-factory> </jms-connection-factories> </hornetq-server> Create a remote JMS client to connect to the server using the exported connection obtained from JNDI (using http-remoting). When the client attempts to connect the server throws the ClassNotFound exception mentioned above and the connection fails.
    • Hide

      The issue can be worked around by modifying the module.xml file as noted in the issue description.

      Show
      The issue can be worked around by modifying the module.xml file as noted in the issue description.

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              jmesnil1@redhat.com Jeff Mesnil
              jkranes@mitre.org Jon Kranes (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: