-
1. Re: Unable to use com.sun.jndi.ldap.LdapCtxFactory
matt.drees Jun 6, 2011 10:50 AM (in response to matt.drees)For the record, using this property did solve the problem.
-
2. Re: Unable to use com.sun.jndi.ldap.LdapCtxFactory
jason.greene Jun 6, 2011 11:30 AM (in response to matt.drees)That approach will certainly work. The drawback is that it exposes this to all modules, which you don't necessarily want (a big benefit to hiding internal jdk classes is that you know right away when you have a non-portable app).
Another solution we could do is offer a JDK API specific module for the major jdks, and allow you to import those. What do you think?
-
3. Re: Unable to use com.sun.jndi.ldap.LdapCtxFactory
matt.drees Jun 6, 2011 4:32 PM (in response to jason.greene)Jason Greene wrote:
Another solution we could do is offer a JDK API specific module for the major jdks, and allow you to import those. What do you think?
Yeah, I would rather use something like that than jboss.modules.system.pkgs, definitely.
-
4. Re: Unable to use com.sun.jndi.ldap.LdapCtxFactory
dlofthouse Jun 9, 2011 5:47 AM (in response to matt.drees)There is now a module called com.sun.jndi.ldap that can be used to define a dependency that will give access to theLdapCtxFactory class.
-
5. Re: Unable to use com.sun.jndi.ldap.LdapCtxFactory
matt.drees Jun 9, 2011 1:17 PM (in response to dlofthouse)Great, thanks Darran.
-
6. Re: Unable to use com.sun.jndi.ldap.LdapCtxFactory
greg.newton Jul 29, 2011 7:41 PM (in response to dlofthouse)Hi Darran,
I started developing on Jboss 7.0 a few days ago and ran into this same issue. Can you give a pointer on the next step now that the module reference above is defined?
Thanks!
Greg
-
7. Re: Unable to use com.sun.jndi.ldap.LdapCtxFactory
jensmander Jul 30, 2011 4:14 AM (in response to greg.newton)Hi,
declaring the dependancy in the Manifest-file and using the existing code without any changes worked fine for me.
Sascha
-
8. Re: Unable to use com.sun.jndi.ldap.LdapCtxFactory
matt.drees Aug 18, 2011 3:19 PM (in response to matt.drees)It looks like the com.sun.jndi.ldap module was removed for 7.0.1. Referencing instead the sun.jdk module seems to work ok.
Just a note for anyone who stumbles on this thread.
-
9. Re: Unable to use com.sun.jndi.ldap.LdapCtxFactory
jayvijayraj Aug 3, 2012 11:25 AM (in response to matt.drees)Hi I am facing the same issue with jboss-as-7.1 and I have tried above solution but doesnot work for me.
in standalone.xml i have
<subsystem xmlns="urn:jboss:domain:ee:1.0">
<global-modules>
<module name="sun.jdk" slot="main"/>
</global-modules>
</subsystem>
In the my subsystem module i have in module.xml
<dependencies>
<module name="sun.jdk"/>
</dependencies>
and at my manifest file
Dependencies: sun.jdk
but still I am getting below error.
2012-08-03 16:59:14,312 [ServerService Thread Pool -- 33] ERROR stderr - javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory com.sun.jndi.ldap.LdapCtxFactory from classloader ModuleClassLoader for Module "org.jboss.as.controller:main" from local module loader @1f31c4e (roots: C:\eplatform\jboss-platform\jboss\jboss-as-7.1\modules)
2012-08-03 16:59:14,312 [ServerService Thread Pool -- 33] ERROR stderr - at org.jboss.as.naming.InitialContextFactoryBuilder.createInitialContextFactory(InitialContextFactoryBuilder.java:64)
2012-08-03 16:59:14,312 [ServerService Thread Pool -- 33] ERROR stderr - at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:681)
2012-08-03 16:59:14,312 [ServerService Thread Pool -- 33] ERROR stderr - at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
2012-08-03 16:59:14,312 [ServerService Thread Pool -- 33] ERROR stderr - at javax.naming.InitialContext.init(InitialContext.java:242)
2012-08-03 16:59:14,327 [ServerService Thread Pool -- 33] ERROR stderr - at javax.naming.InitialContext.<init>(InitialContext.java:216)
please help me what I am doing wrong?
regards,
Jay
PS:
Now i have solved it by adding "sun.jdk" dependency into module "org.jboss.as.controller", but question still remains is why it did not found this from global module?