JBoss Community

Re: Failure to Instantiate DnsContextFactory

created by Shelley Baker in JBoss AS7 Development - View the full discussion

I found an alternative that is slightly better. I added the jboss-deployment-structure.xml file to my EAR's META-INF directory, as follows:

<jboss-deployment-structure>

    <sub-deployment name="test-web.war">
        <dependencies>
            <module name="deployment.com.sun.jndi.dns" />
        </dependencies>
    </sub-deployment>

    <module name="deployment.com.sun.jndi.dns">
        <dependencies>
            <module name="system" export="false">
                <exports>
                    <include-set>
                        <path name="com/sun/jndi/dns"/>
                    </include-set>
                </exports>
            </module>
        </dependencies>
    </module>

</jboss-deployment-structure>

This also worked, in lieu of the manifest entry and custom module in the jboss directory. This is slightly better since it only requires modification to the application, and not also the JBoss modules, but is unfortunate that all applications that use the DnsContextFactory must include this configuration. I'm still looking for suggestions on the most appropriate, recommended approach, particularly if there is a way that we can avoid including more JBoss-specific configuration in our applications.

Reply to this message by going to Community

Start a new discussion in JBoss AS7 Development at Community