Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-7370

[GSS](7.0.z) Custom NameService by sun.net.spi.nameservice.provider.n doesn't work on WildFly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.0.5.CR1, 7.0.5.GA
    • 7.0.3.GA
    • Modules
    • None
    • Hide

      Run the test.sh which is a standalone module application.

      $ unzip nameserviceProviderTest.zip;
      $ cd nameserviceProviderTest
      $ JBOSS_HOME=~/java/wildfly-10.1.0.Final ./test.sh
      17:53:58,131 INFO  [org.jboss.modules] (main) JBoss Modules version 1.5.2.Final
      *** MyNameService.lookupAllHostAddr called
      

      "*** MyNameService.lookupAllHostAddr called" is printed in stdout if the custom NameService has been enabled.

      On WildFly, define a system property in standalone.conf:

         JAVA_OPTS="$JAVA_OPTS -Dsun.net.spi.nameservice.provider.1=dns,MyNameService"
      

      And prepend the new module path in standalone.sh:

          JBOSS_MODULEPATH="/path/to/nameserviceProviderTest/modules:$JBOSS_HOME/modules"
      

      Then deploy the testweb.war in the archive and access http://localhost:8080/testweb/test.jsp. The message is not printed in stdout.

      Show
      Run the test.sh which is a standalone module application. $ unzip nameserviceProviderTest.zip; $ cd nameserviceProviderTest $ JBOSS_HOME=~/java/wildfly-10.1.0.Final ./test.sh 17:53:58,131 INFO [org.jboss.modules] (main) JBoss Modules version 1.5.2.Final *** MyNameService.lookupAllHostAddr called " *** MyNameService.lookupAllHostAddr called " is printed in stdout if the custom NameService has been enabled. On WildFly, define a system property in standalone.conf: JAVA_OPTS= "$JAVA_OPTS -Dsun.net.spi.nameservice.provider.1=dns,MyNameService" And prepend the new module path in standalone.sh: JBOSS_MODULEPATH= "/path/to/nameserviceProviderTest/modules:$JBOSS_HOME/modules" Then deploy the testweb.war in the archive and access http://localhost:8080/testweb/test.jsp . The message is not printed in stdout.
    • EAP 7.0.5

      System property sun.net.spi.nameservice.provider.<n> allows a user to customize a NameService. It works on a standalone java, which is using JBoss Modules, if services="import" is added on sun.jdk module dependency and the sun.jdk module has the following additional dependencies.

                      <path name="sun/net/spi/nameservice"/>
                      <path name="sun/net/spi/nameservice/dns"/>
      

      Though it doesn't work as a web application which has the same module path and the same dependency in jboss-deployment-structure.xml.

              rhn-cservice-bbaranow Bartosz Baranowski
              rhn-support-bmaxwell Brad Maxwell
              Peter Mackay Peter Mackay
              Peter Mackay Peter Mackay
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: