[jboss-dev-forums] [JBoss AS7 Development] - Failure to Instantiate DnsContextFactory

Shelley Baker do-not-reply at jboss.com
Thu Aug 4 17:57:51 EDT 2011


Shelley Baker [http://community.jboss.org/people/shelleyb] created the discussion

"Failure to Instantiate DnsContextFactory"

To view the discussion, visit: http://community.jboss.org/message/619522#619522

--------------------------------------------------------------
When attempting to create a new InitialDirContext using the com.sun.jndi.dns.DnsContextFactory, the following exception occurs:
Caused by: javax.naming.NamingException: Failed instantiate InitialContextFactory com.sun.jndi.dns.DnsContextFactory from classloader ModuleClassLoader for Module "deployment.test-case.ear.test-web.war:main" from Service Module Loader
        at org.jboss.as.naming.InitialContextFactoryBuilder.createInitialContextFactory(InitialContextFactoryBuilder.java:58)
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:664) [:1.6.0_26]
        at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) [:1.6.0_26]
        at javax.naming.InitialContext.init(InitialContext.java:223) [:1.6.0_26]
        at javax.naming.InitialContext.(InitialContext.java:197) [:1.6.0_26]
        at javax.naming.directory.InitialDirContext.(InitialDirContext.java:82) [:1.6.0_26]
        at com.test.messaging.internal.resource.dns.DnsClientImpl.querySrv(DnsClientImpl.java:328) [dns-lookup-jar.jar:]
        ...

16:36:36,000 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-5) Error listenerStart
16:36:36,013 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-5) Context [/test] startup failed due to previous errors
16:36:36,023 INFO  [org.jboss.web] (MSC service thread 1-5) registering web context: /test

Here is my relevant code snippet:
Hashtable env = new Hashtable();
env.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory");
env.put("java.naming.authoritative", "false");
env.put("com.sun.jndi.dns.recursion", "true");
env.put("com.sun.jndi.dns.timeout.initial", timeoutProp);
env.put("com.sun.jndi.dns.timeout.retries", "1");
env.put("java.naming.provider.url", providerProp);
DirContext ctx = new InitialDirContext(env);

I found  http://community.jboss.org/message/608523#608523 this thread which seemed very similar to the problem that I am running into, but setting the "jboss.modules.system.pkgs" property to "com.sun.jndi.dns" had no effect.
I'm running JBoss AS 7.0.0.Final, using the 1.6.0_26 JRE.
Any suggestions on how to resolve this problem would be greatly appreciated.
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/619522#619522]

Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20110804/a9b2d88c/attachment.html 


More information about the jboss-dev-forums mailing list