As described in WFCORE-1998, custom implementation of sun.net.spi.nameservice.NameService doesn't work on EAP. Dependency to "sun.jdk:main" should be added into "org.jboss.as.server:main" because it is the TCCL when java.net.InetAddress is initialized. Though this way of NameService customization will be removed in Java 9.
Created attachment 1221052 [details] modules.zip How to reproduce: On EAP 6.4.11, prepend the attached module by editing standalone.conf like this. JBOSS_HOME=/path/to/eap6411 JBOSS_MODULEPATH="/path/to/the/modules:$JBOSS_HOME/modules" ... JAVA_OPTS="$JAVA_OPTS -Dsun.net.spi.nameservice.provider.1=dns,MyNameService" The custom name service provider impl, modules/sun/jdk/main/classes/com/example/MyNameService.java, will print a message to stdout if it is called. @Override public InetAddress[] lookupAllHostAddr(String string) throws UnknownHostException { System.out.println("*** MyNameService.lookupAllHostAddr called"); return javaNativeNameService.lookupAllHostAddr(string); } Deploy a test.jsp like below to call the method. The message won't appear unless you add the "sun.jdk:main" dependency to "org.jboss.as.server:main". <%@page contentType="text/html" pageEncoding="UTF-8"%> <html> <head> <title>Test Page</title> </head> <body> <% String name = request.getParameter("name"); if (name == null) name = "www.redhat.com"; java.net.InetAddress addr = java.net.InetAddress.getByName(name); %> <%=name%> maps to <%=addr.toString()%>. </body> </html>
PR: https://github.com/jbossas/jboss-eap/pull/2884
Verified with EAP 6.4.13.CP.CR2
Released with EAP 6.4.13 on Feb 02 2017.