Bug 1395543
Summary: | [GSS](6.4.z) Custom NameService by sun.net.spi.nameservice.provider.n doesn't work on EAP | ||||||
---|---|---|---|---|---|---|---|
Product: | [JBoss] JBoss Enterprise Application Platform 6 | Reporter: | Osamu Nagano <onagano> | ||||
Component: | Class Loading | Assignee: | Petr Jurak <pjurak> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Peter Mackay <pmackay> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 6.3.2 | CC: | bmaxwell, david.lloyd, jbilek, msochure, pjurak, pmackay, rstancel | ||||
Target Milestone: | CR1 | ||||||
Target Release: | EAP 6.4.13 | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2017-02-03 16:45:59 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 1386335 | ||||||
Attachments: |
|
Description
Osamu Nagano
2016-11-16 07:19:39 UTC
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>
Verified with EAP 6.4.13.CP.CR2 Released with EAP 6.4.13 on Feb 02 2017. |