2 Replies Latest reply on May 18, 2016 5:17 AM by Panagiotis Chavariotis

    External JNDI Lookup Exception in EAP 6.4

    Tapash Paul Newbie

      See following details:

      The code snippet below results in exception "Failed to define class com.sun.jndi.ldap.LdapURL in Module "org.jboss.genericjms.provider"

       

      I checked and found this sun-jndi-ldap.jar within this module does contain com.sun.jndi.ldap.LdapURL class.

      So why is it throwing this exception in EAP 6.4?

       

      Any idea as what this exception trying to tell?

       

      These code lines:

      javax.naming.Context context = new InitialContext();

      Object q1 = context.lookup("java:global/jms/NsdbQCF");

       

      is attempting to read following JNDI bidings in standalone.xml

              <subsystem xmlns="urn:jboss:domain:naming:1.4">

                  <bindings>

                      <external-context name="java:global/jms/NsdbQCF" module="org.jboss.genericjms.provider" class="javax.naming.directory.InitialDirContext" cache="true">

                          <environment>

                              <property name="java.naming.factory.initial" value="com.sun.jndi.ldap.LdapCtxFactory"/>

                              <property name="java.naming.provider.url" value="ldap://emlprd02.sbc.com:4299 ldap://emlprd03.sbc.com:4299 ldap://emlprd01.sbc.com:4299"/>

                              <property name="java.naming.security.authentication" value="uid"/>

                              <property name="java.naming.security.principal" value="cn=prdQCF,ou=1_0,ou=nsdb,o=network,t=jms,c=us"/>

                              <property name="java.naming.security.credentials" value="password"/>

                          </environment>

                      </external-context>

       

      module="org.jboss.genericjms.provider":

      <?xml version='1.0' encoding='UTF-8'?>

      <module xmlns="urn:jboss:module:1.1" name="org.jboss.genericjms.provider">

          <resources>

             <resource-root path="jndi-1.2.1.jar"/>

             <resource-root path="sun-jndi-ldap.jar"/>

             <resource-root path="gnu-regexp-1.0.6.jar"/>

             <resource-root path="sonic_ASPI.jar"/>

             <resource-root path="sonic_Client.jar"/>

             <resource-root path="sonic_Crypto.jar"/>

             <resource-root path="sonic_Selector.jar"/>

             <resource-root path="sonic_XA.jar"/>

              <!-- Insert resources here -->

          </resources>

          <dependencies>

           <module name="javax.api"/>

           <module name="javax.jms.api"/>

          </dependencies>

      </module>

       

      Getting this exception stack trace:

       

       

      10:52:23,445 INFO  [stdout] (http-127.0.0.1/127.0.0.1:8080-1) >> Attempting to acquire connection factory "java:global/jms/NsdbQCF"


      10:52:23,451 WARN  [org.jboss.modules] (http-127.0.0.1/127.0.0.1:8080-1) Failed to define class com.sun.jndi.ldap.LdapURL in Module "org.jboss.genericjms.provider:main" from local module loader @4344ee21 (finder: local module finder @626ddb07 (roots: C:\EAP_HOME\jboss-eap-6.4\modules,C:\EAP_HOME\jboss-eap-6.4\modules\system\layers\base\.overlays\layer-base-jboss-eap-6.4.6.CP,C:\EAP_HOME\jboss-eap-6.4\modules\system\layers\base)): java.lang.LinkageError: Failed to link com/sun/jndi/ldap/LdapURL (Module "org.jboss.genericjms.provider:main" from local module loader @4344ee21 (finder: local module finder @626ddb07 (roots: C:\EAP_HOME\jboss-eap-6.4\modules,C:\EAP_HOME\jboss-eap-6.4\modules\system\layers\base\.overlays\layer-base-jboss-eap-6.4.6.CP,C:\EAP_HOME\jboss-eap-6.4\modules\system\layers\base)))

      at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:487) [jboss-modules.jar:1.3.7.Final-redhat-1]

      at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:277) [jboss-modules.jar:1.3.7.Final-redhat-1]

      at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:92) [jboss-modules.jar:1.3.7.Final-redhat-1]

      at org.jboss.modules.Module.loadModuleClass(Module.java:568) [jboss-modules.jar:1.3.7.Final-redhat-1]

      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205) [jboss-modules.jar:1.3.7.Final-redhat-1]

      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.7.Final-redhat-1]

      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.7.Final-redhat-1]

      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.7.Final-redhat-1]

      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.7.Final-redhat-1]

      at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:58) [sun-jndi-ldap.jar:Fri Dec 14 02:40:54 PST 2001 197442503 38]

      at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:122)

      at org.jboss.as.naming.InitialContext.init(InitialContext.java:107)

      at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:153) [rt.jar:1.7.0_72]

      at org.jboss.as.naming.InitialContext.<init>(InitialContext.java:98)

      at org.jboss.as.naming.InitialContextFactory.getInitialContext(InitialContextFactory.java:44)

      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684) [rt.jar:1.7.0_72]

      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307) [rt.jar:1.7.0_72]

      at javax.naming.InitialContext.init(InitialContext.java:242) [rt.jar:1.7.0_72]

      at javax.naming.InitialContext.<init>(InitialContext.java:216) [rt.jar:1.7.0_72]

      at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:101) [rt.jar:1.7.0_72]

      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_72]

      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_72]

      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_72]

      at java.lang.reflect.Constructor.newInstance(Constructor.java:526) [rt.jar:1.7.0_72]