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?