Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-627

Arquillian fails to connect to remote Glassfish instances/clusters when the node-host for the instances/clusters is "localhost"

    XMLWordPrintable

Details

    • Hide

      1. Create a new standalone Glassfish instance or cluster on a different machine, say machine B.
      2. Verify that the domain.xml contains the configuration for the Glassfish node, like the one below (note the node-host attribute value):

        <nodes>
          <node node-host="localhost" name="localhost-standalone-domain" type="CONFIG" install-dir="${com.sun.aas.productRoot}"></node>
        </nodes>
      

      3. Run the CDIJarTestCase from the glassfish-remote-3.1 project, from a different machine, say machine A, with the following arquillian.xml configuration:

              <configuration>
                  <property name="adminHost">machineB</property>
                  <property name="adminPort">4848</property>
                  <property name="adminUser">admin</property>
                  <property name="adminPassword">admin</property>
                  <property name="target">demo-cluster</property>
              </configuration>
      

      4. The CDIJarTestCase should fail.

      Show
      1. Create a new standalone Glassfish instance or cluster on a different machine, say machine B. 2. Verify that the domain.xml contains the configuration for the Glassfish node, like the one below (note the node-host attribute value): <nodes> <node node-host= "localhost" name= "localhost-standalone-domain" type= "CONFIG" install-dir= "${com.sun.aas.productRoot}" > </node> </nodes> 3. Run the CDIJarTestCase from the glassfish-remote-3.1 project, from a different machine, say machine A, with the following arquillian.xml configuration: <configuration> <property name= "adminHost" > machineB </property> <property name= "adminPort" > 4848 </property> <property name= "adminUser" > admin </property> <property name= "adminPassword" > admin </property> <property name= "target" > demo-cluster </property> </configuration> 4. The CDIJarTestCase should fail.
    • Workaround Exists
    • Hide

      Use asadmin update-node-config to update the machine name in the node configuration. If this fails (since we're updating the localhost node config, which Glassfish does not appear to like), rename the machine name in the node-host attribute from "localhost" to the FQDN that can be resolved through a name lookup, as a last resort.

      Show
      Use asadmin update-node-config to update the machine name in the node configuration. If this fails (since we're updating the localhost node config, which Glassfish does not appear to like), rename the machine name in the node-host attribute from "localhost" to the FQDN that can be resolved through a name lookup, as a last resort.

    Description

      Arquillian fails to connect to the Glassfish instance/cluster where the deployment has occurred, when the Glassfish node configuration for the domain, specifies the hostname as "localhost".

      The CDIJarTestCase was found to fail with the following exception:

      -------------------------------------------------------------------------------
      Test set: org.jboss.arquillian.container.glassfish.remote_3_1.CDIJarTestCase
      -------------------------------------------------------------------------------
      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 9.03 sec <<< FAILURE!
      test(org.jboss.arquillian.container.glassfish.remote_3_1.CDIJarTestCase) Time elapsed: 1.212 sec <<< ERROR!
      java.lang.IllegalStateException: Error launching test org.jboss.arquillian.container.glassfish.remote_3_1.CDIJarTestCase public void org.jboss.arquillian.container.glassfish.remote_3_1.CDIJarTestCase.test()
      at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.invoke(ServletMethodExecutor.java:122)
      at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.execute(RemoteTestExecuter.java:120)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
      at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
      at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)
      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)
      at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
      at org.jboss.arquillian.container.test.impl.execution.ClientTestExecuter.execute(ClientTestExecuter.java:68)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
      at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
      at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
      at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:130)
      at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createTestContext(ContainerEventController.java:117)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
      at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:82)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
      at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:68)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
      at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:54)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
      at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)
      at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111)
      at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:239)
      at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:202)
      at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:290)
      at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:45)
      at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:216)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
      at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:161)
      at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:290)
      at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:45)
      at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:175)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
      at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:123)
      at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
      at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115)
      at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102)
      at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
      at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
      Caused by: java.lang.IllegalStateException: Error launching request at http://localhost:28080/test/ArquillianServletRunner?outputMode=serializedObject&className=org.jboss.arquillian.container.glassfish.remote_3_1.CDIJarTestCase&methodName=test. No result returned
      at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.executeWithRetry(ServletMethodExecutor.java:158)
      at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.invoke(ServletMethodExecutor.java:118)
      ... 78 more
      

      when the domain.xml of the Glassfish instance, contained the following configuration element:

        <nodes>
          <node node-host="localhost" name="localhost-standalone-domain" type="CONFIG" install-dir="${com.sun.aas.productRoot}"></node>
        </nodes>
      

      Modifying the node-host from "localhost" to the actual machine name is a workaround. But this prerequisite is not needed, if Arquillian uses the adminHost value when it receives a response of "localhost", when querying for the actual hostAddress.

      Renaming is the node-host value, appears to be frowned upon, by Glassfish, as the following response was received on using the asadmin update-node-config command. A manual edit to domain.xml was required to enforce the workaround.

      C:\glassfish-standalone-3\bin>asadmin --port 4848 update-node-config --nodehost
      machineB localhost-standalone-domain
      remote failure: Cannot update node localhost-standalone-domain. It is the built-
      in localhost node.
      Command update-node-config failed.
      

      Therefore, Arquillian should attempt to use the adminHost value, when the queried nodeHost value is "localhost".

      Attachments

        Activity

          People

            vineet.reynolds_jira Vineet Reynolds (Inactive)
            vineet.reynolds_jira Vineet Reynolds (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: