1 Reply Latest reply on Aug 12, 2014 11:35 PM by Android Galaxyman

    java.lang.ClassNotFoundException: javax.net.ssl.HandshakeCompletedListener from [Module "com.ibm.mq:main" from local module loader

    Android Galaxyman Newbie

      Dear All, we are having client component which post messages inside IBM MQ Brokers. This component actually plugged inside ear component which deployed inside the jboss EAP 6.1. Especially in jBoss4, 5, 6 version the deployment architecture is same, but notably jBoss EAP changed their architecture. So that we are under migration of the components. As we came to know there will be two ways to load the dependent modules  1. create the global modules 2. use jboss-deployment-descriptor file to load the dependent libraries. The Client component which requires IBM MQ Libraries , those IBM libraries requires sun specific ssl implementation javax.net.ssl.HandshakeCompletedListener . So that i have created the modules in JBOSS_HOME\modules\com\ibm\mq\main , here i copied all libraries of MQ .i added new module.xml . i downloaded the sun specific implementation jar from internt [javax-ssl-1_1.jar] , copied here too. This approach is working. Anyway downloading Sun jars and using here , even the Sun jdk used for starting of application server. i presume it completely not an proper way. i read jboss forums said changing of \modules\system\layers\base\sun\jdk\main\module.xml. My Requirement is i shouldn't alter the module.xml for Application container specific inside \modules\system\layers\base\sun\jdk\main , i meant not to edit module.xml. The same time i have to load the MQ libraries as well dependent SSL Sun implementation too. i tried with the approach of loading the system specific libraries (Class Loading in AS7 - JBoss AS 7.1 - Project Documentation Editor), i can't able to do that. Even i set the classpath for C:\jdk\jdk1.6.0_29-64\jre\lib\jsse.jar , but no use. i facing lots of exception, if anyone could help on this case, i could able to crack it down. Thanks in advance.

       

      Approach Tried Links:

      ************************

      java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider while depolying a war file

      https://community.jboss.org/thread/231636?tstart=0

      https://community.jboss.org/thread/169608

      https://community.jboss.org/message/616776#616776

      How to add bouncycastle to JBoss AS 7.

      1

      https://community.jboss.org/message/638335

      Re: Alternative to defining dependency without modifying sun.jdk module

      logs:

      ****

      16:23:43,567 INFO  [stdout] (MQListener-Thread-163) INFO  mqseries - MQListener.run(), Listener thread started
      16:23:43,568 INFO  [stdout] (MQListener-Thread-163) WARN  mqseries - WAITINTERVAL is not set or wrong value in the myserver.xml, default of 10 seconds (10000 ms) is used now. 
      16:23:43,568 INFO  [stdout] (MQListener-Thread-163) If any problem occurs when accessing queue, please set an appropriate value in the myserver.xml.
      16:23:43,569 INFO  [stdout] (MQListener-Thread-163) WARN  mqseries - Resposne message EXPIRY not set or wrong value, default of -1 is used null
      16:23:43,569 INFO  [stdout] (MQListener-Thread-163) WARN  mqseries - No Default BACKOUTTHRESHOLD specified. Make sure the backoutCount is specified in your Queue definition
      16:23:43,570 INFO  [stdout] (MQListener-Thread-163) INFO  mqseries - No RETRYCOUNT specified. Defaulting to '2'
      16:23:43,570 INFO  [stdout] (MQListener-Thread-163) INFO  mqseries - No RESPONSEDIRECTORY specified. Defaulting to '\D:\ApplicationServers\jboss-eap-6.1-Final\bin\content\tocfee.ear\tocfplugin-ra.rar\tcommon.jar\com\ccompanyx\tocf\common\\failures'
      16:23:43,839 WARN  [org.jboss.modules] (MQListener-Thread-163) Failed to define class com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection in Module "com.ibm.mq:main" from local module loader @2de12f6d (finder: local module finder @1af0b4a3 (roots: D:\ApplicationServers\jboss-eap-6.1-Final\modules,D:\ApplicationServers\jboss-eap-6.1-Final\modules\system\layers\base)): java.lang.LinkageError: Failed to link com/ibm/mq/jmqi/remote/internal/RemoteTCPConnection (Module "com.ibm.mq:main" from local module loader @2de12f6d (finder: local module finder @1af0b4a3 (roots: D:\ApplicationServers\jboss-eap-6.1-Final\modules,D:\ApplicationServers\jboss-eap-6.1-Final\modules\system\layers\base)))
        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:427) [jboss-modules.jar:1.2.0.Final-redhat-1]
        at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:260) [jboss-modules.jar:1.2.0.Final-redhat-1]
        at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:75) [jboss-modules.jar:1.2.0.Final-redhat-1]
        at org.jboss.modules.Module.loadModuleClass(Module.java:526) [jboss-modules.jar:1.2.0.Final-redhat-1]
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:188) [jboss-modules.jar:1.2.0.Final-redhat-1]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:399) [jboss-modules.jar:1.2.0.Final-redhat-1]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]
        at com.ibm.mq.jmqi.remote.internal.system.RemoteConnectionPool.getConnection(RemoteConnectionPool.java:245) [com.ibm.mq.jmqi.jar:7.0.1.0 - k000-L090724]
        at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1488) [com.ibm.mq.jmqi.jar:7.0.1.0 - k000-L090724]
        at com.ibm.mq.MQSESSION.MQCONNX_j(MQSESSION.java:915) [com.ibm.mq.jar:7.0.1.0 - k000-L090724]
        at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:224) [com.ibm.mq.jar:7.0.1.0 - k000-L090724]
        at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:505) [com.ibm.mq.jar:7.0.1.0 - k000-L090724]
        at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:547) [com.ibm.mq.jar:7.0.1.0 - k000-L090724]
        at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:95) [com.ibm.mq.jar:7.0.1.0 - k000-L090724]
        at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:182) [com.ibm.mq.jar:7.0.1.0 - k000-L090724]
        at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:869) [com.ibm.mq.jar:7.0.1.0 - k000-L090724]
        at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:761) [com.ibm.mq.jar:7.0.1.0 - k000-L090724]
        at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:712) [com.ibm.mq.jar:7.0.1.0 - k000-L090724]
        at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:171) [com.ibm.mq.jar:7.0.1.0 - k000-L090724]
        at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:597) [com.ibm.mq.jar:7.0.1.0 - k000-L090724]
        at com.ccompanyx.plugin.mq.MQHandler.accessQueueManager(MQHandler.java:287) [mqlistener.jar:tc_R10.0.7_GA]
        at com.ccompanyx.plugin.mq.MQHandler.Initialize(MQHandler.java:93) [mqlistener.jar:tc_R10.0.7_GA]
        at com.ccompanyx.plugin.mq.MQHandler.Initialize(MQHandler.java:71) [mqlistener.jar:tc_R10.0.7_GA]
        at com.ccompanyx.plugin.mq.MQListenerPool.run(MQListenerPool.java:328) [mqlistener.jar:tc_R10.0.7_GA]
        at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_29]
      Caused by: java.lang.NoClassDefFoundError: javax/net/ssl/HandshakeCompletedListener
        at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.6.0_29]
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) [rt.jar:1.6.0_29]
        at java.lang.ClassLoader.defineClass(ClassLoader.java:615) [rt.jar:1.6.0_29]
        at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:344) [jboss-modules.jar:1.2.0.Final-redhat-1]
        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:422) [jboss-modules.jar:1.2.0.Final-redhat-1]
        ... 27 more
      Caused by: java.lang.ClassNotFoundException: javax.net.ssl.HandshakeCompletedListener from [Module "com.ibm.mq:main" from local module loader @2de12f6d (finder: local module finder @1af0b4a3 (roots: D:\ApplicationServers\jboss-eap-6.1-Final\modules,D:\ApplicationServers\jboss-eap-6.1-Final\modules\system\layers\base))]
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:399) [jboss-modules.jar:1.2.0.Final-redhat-1]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:399) [jboss-modules.jar:1.2.0.Final-redhat-1]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]
        ... 32 more
      16:23:43,864 ERROR [stderr] (MQListener-Thread-163) Exception in thread "MQListener-Thread-163" java.lang.LinkageError: Failed to link com/ibm/mq/jmqi/remote/internal/RemoteTCPConnection (Module "com.ibm.mq:main" from local module loader @2de12f6d (finder: local module finder @1af0b4a3 (roots: D:\ApplicationServers\jboss-eap-6.1-Final\modules,D:\ApplicationServers\jboss-eap-6.1-Final\modules\system\layers\base)))
      16:23:43,865 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:427)
      16:23:43,866 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:260)
      16:23:43,866 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:75)
      16:23:43,867 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.Module.loadModuleClass(Module.java:526)
      16:23:43,868 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:188)
      16:23:43,868 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444)
      16:23:43,869 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432)
      16:23:43,869 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:399)
      16:23:43,870 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374)
      16:23:43,870 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119)
      16:23:43,871 ERROR [stderr] (MQListener-Thread-163) at com.ibm.mq.jmqi.remote.internal.system.RemoteConnectionPool.getConnection(RemoteConnectionPool.java:245)
      16:23:43,871 ERROR [stderr] (MQListener-Thread-163) at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1488)
      16:23:43,872 ERROR [stderr] (MQListener-Thread-163) at com.ibm.mq.MQSESSION.MQCONNX_j(MQSESSION.java:915)
      16:23:43,873 ERROR [stderr] (MQListener-Thread-163) at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:224)
      16:23:43,873 ERROR [stderr] (MQListener-Thread-163) at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:505)
      16:23:43,874 ERROR [stderr] (MQListener-Thread-163) at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:547)
      16:23:43,874 ERROR [stderr] (MQListener-Thread-163) at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:95)
      16:23:43,875 ERROR [stderr] (MQListener-Thread-163) at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:182)
      16:23:43,875 ERROR [stderr] (MQListener-Thread-163) at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:869)
      16:23:43,876 ERROR [stderr] (MQListener-Thread-163) at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:761)
      16:23:43,876 ERROR [stderr] (MQListener-Thread-163) at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:712)
      16:23:43,877 ERROR [stderr] (MQListener-Thread-163) at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:171)
      16:23:43,878 ERROR [stderr] (MQListener-Thread-163) at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:597)
      16:23:43,878 ERROR [stderr] (MQListener-Thread-163) at com.ccompanyx.plugin.mq.MQHandler.accessQueueManager(MQHandler.java:287)
      16:23:43,879 ERROR [stderr] (MQListener-Thread-163) at com.ccompanyx.plugin.mq.MQHandler.Initialize(MQHandler.java:93)
      16:23:43,880 ERROR [stderr] (MQListener-Thread-163) at com.ccompanyx.plugin.mq.MQHandler.Initialize(MQHandler.java:71)
      16:23:43,880 ERROR [stderr] (MQListener-Thread-163) at com.ccompanyx.plugin.mq.MQListenerPool.run(MQListenerPool.java:328)
      16:23:43,881 ERROR [stderr] (MQListener-Thread-163) at java.lang.Thread.run(Thread.java:662)
      16:23:43,881 ERROR [stderr] (MQListener-Thread-163) Caused by: java.lang.NoClassDefFoundError: javax/net/ssl/HandshakeCompletedListener
      16:23:43,882 ERROR [stderr] (MQListener-Thread-163) at java.lang.ClassLoader.defineClass1(Native Method)
      16:23:43,883 ERROR [stderr] (MQListener-Thread-163) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
      16:23:43,883 ERROR [stderr] (MQListener-Thread-163) at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
      16:23:43,884 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:344)
      16:23:43,884 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:422)
      16:23:43,885 ERROR [stderr] (MQListener-Thread-163) ... 27 more
      16:23:43,886 ERROR [stderr] (MQListener-Thread-163) Caused by: java.lang.ClassNotFoundException: javax.net.ssl.HandshakeCompletedListener from [Module "com.ibm.mq:main" from local module loader @2de12f6d (finder: local module finder @1af0b4a3 (roots: D:\ApplicationServers\jboss-eap-6.1-Final\modules,D:\ApplicationServers\jboss-eap-6.1-Final\modules\system\layers\base))]
      16:23:43,886 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196)
      16:23:43,887 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444)
      16:23:43,888 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432)
      16:23:43,888 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:399)
      16:23:43,889 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:399)
      16:23:43,890 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374)
      16:23:43,890 ERROR [stderr] (MQListener-Thread-163) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119)
      6:23:43,891 ERROR [stderr] (MQListener-Thread-163) ... 32 more
      

       

       

      jboss-deployment-structure.xml

      ***********************************

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
          <!-- for top deployment, e.g. ear -->
           <deployment>
           <!-- Adding Resource Adapter As Explicit Module Dependency for all sub-deployment Will access -->
              <dependencies>
        <module name="deployment.xxxxxxx-ra.rar" export="TRUE"/>
      
        <system export="true">  
                      <paths>  
                           <path name="javax/net/ssl" /> 
                      </paths>  
              </system>  
        </dependencies>
              <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
            <exclusions>
                  <module name="org.apache.log4j"/>
              </exclusions>
      
          </deployment>
          
          <!-- for sub deployment, e.g. war. sub-deployment is required when ear contains one or more wars -->
          <sub-deployment name="xxx-ejb.jar">
              <!--Preventing Application Server Implicit Module Libraries [LOG4J] loading for each sub-deployment -->
              <exclusions>
                  <module name="org.apache.log4j" />
              </exclusions>
          </sub-deployment>
          <sub-deployment name="xxx-ejb.jar">
              <exclusions>
                  <module name="org.apache.log4j" />
              </exclusions>
          </sub-deployment>
        <sub-deployment name="xxx-ejb.jar">
              <exclusions>
                  <module name="org.apache.log4j" />
              </exclusions>
          </sub-deployment>
        <sub-deployment name="xxx-ra.rar">
              <exclusions>
                  <module name="org.apache.log4j" />
              </exclusions>
             
          
          </sub-deployment>
      </jboss-deployment-structure>
      

       

       

      module.xml

      *************

      <module xmlns="urn:jboss:module:1.0" name="com.ibm.mq">
        <resources>
          <!-- Insert resources here -->
        <!--IBM MQ Series V 7.0 Libraries , Copied from the IBM installation--> 
        <resource-root path="CL3Export.jar" />
        <resource-root path="CL3Nonexport.jar" />
        <resource-root path="com.ibm.mq.commonservices.jar" />
        <resource-root path="com.ibm.mq.defaultconfig.jar" />
        <resource-root path="com.ibm.mq.headers.jar" />
        <resource-root path="com.ibm.mq.jar" />
        <resource-root path="com.ibm.mq.jmqi.jar" />
        <resource-root path="com.ibm.mq.jms.Nojndi.jar" />
        <resource-root path="com.ibm.mq.pcf.jar" />
        <resource-root path="com.ibm.mq.postcard.jar" />
        <resource-root path="com.ibm.mq.soap.jar" />
        <resource-root path="com.ibm.mq.tools.ras.jar" />
        <resource-root path="com.ibm.mqjms.jar" />
        <resource-root path="connector.jar" />
        <resource-root path="dhbcore.jar" />
        <resource-root path="fscontext.jar" />
        <resource-root path="jms.jar" />
        <resource-root path="jndi.jar" />
        <resource-root path="jta.jar" />
        <resource-root path="ldap.jar" />
        <resource-root path="providerutil.jar" />
        <resource-root path="rmm.jar" />
        <!--
        <resource-root path="javax-ssl-1_1.jar" />
        -->
        </resources>
       </module>