5 Replies Latest reply on Feb 24, 2014 4:14 AM by aslak

    Multiple Deployments on multiple remote glassfish <group> leads to "Invalid user name or password"

    ziti

      Hey there,

       

      my environment is the following:

      Glassfishv4 1 (remote) running on localhost.

      Eclipse IDE running on localhost containing source / test code.

      Glassfishv4 2, running on a virtual machine. Reachable over the network.

       

      My arquillian.xml looks like:

      <?xml version="1.0"?>

      <arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xmlns="http://jboss.org/schema/arquillian"

          xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

       

          <container qualifier="local" >

              <configuration>

                  <property name="adminPort">4848</property>

                  <property name="adminHost">localhost</property>

                  <property name="adminHttps">false</property>

                  <property name="adminUser">myadmin</property>

                  <property name="adminPassword">myadminpwd</property>

                  <property name="target">server</property>

              </configuration>

          </container>

       

          <container qualifier="remote" default="true">

              <configuration>

                  <property name="adminPort">4848</property>

                  <property name="adminHost">myvm015</property>

                  <property name="adminHttps">true</property>

                  <property name="adminUser">myadmin</property>

                  <property name="adminPassword">myadminpwd</property>

                  <property name="target">server</property>

              </configuration>

          </container>

      </arquillian>

       

      I have a test class like:

       

      @RunWith(Arquillian.class)

      public class DataTransferCreateExportIT {

          @Deployment

          public static EnterpriseArchive deployLocal() {

          ...

          ...

          return myArchive;

          }

       

          @EJB

          private DataTransferFacade dtf;

       

          @Inject

          private Logger logger;

       

          @Inject

          private FileManagementService fileManagementService;

       

          @Test

          public void testGenerateExport() {

              ...

              ...      

          }  

      }

       

      This deployment and the coresssponding tests work on both servers. That means if I switch the "default="true""

      property in the arquillian.xml from one server to the other, the deployment and tests are issued on the desired server.

       

      I have a Import/Export scenario, where I need data from one glassfish / database (local) being transfered to the other glassfish (remote).

       

      For this case I created an other test class:

       

      @RunWith(Arquillian.class)

      public class DataTransferImportExportIT {

          @Deployment(name = "depLocal")

          @TargetsContainer("local")

          public static EnterpriseArchive deployLocal() {

              ...

              return myArchive;

          }

       

          @Deployment(name = "depRemote")

          @TargetsContainer("remote")

          public static EnterpriseArchive deployRemote() {

              ...

              return myArchive;

          }

       

          private File export;

          private FileHandle fHandle;

       

          @EJB

          private DataTransferFacade dtf;

       

          @Inject

          private Logger logger;

       

          @Inject

          private FileManagementService fileManagementService;

       

          @Test

          @OperateOnDeployment("depLocal")

          public void testGenerateExport() {

              ...

          }

       

          @Test

          @OperateOnDeployment("depRemote")

          public void testImport() {

              ...

          }

      }

       

      At first I got a:

      - DeploymentScenario contains a target (local) not matching any defined Container in the registry.

      exception.

       

      Then I added the <group> tag to my arquillian.xml. My arquillian.xml now looks like:

       

      <?xml version="1.0"?>

      <arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xmlns="http://jboss.org/schema/arquillian"

          xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

       

      <group qualifier="glassfish_cluster">

          <container qualifier="local" >

              <configuration>

                  <property name="adminPort">4848</property>

                  <property name="adminHost">localhost</property>

                  <property name="adminHttps">false</property>

                  <property name="adminUser">myadmin</property>

                  <property name="adminPassword">myadminpwd</property>

                  <property name="target">server</property>

              </configuration>

          </container>

       

          <container qualifier="remote" default="true">

              <configuration>

                  <property name="adminPort">4848</property>

                  <property name="adminHost">myvm015</property>

                  <property name="adminHttps">true</property>

                  <property name="adminUser">myadmin</property>

                  <property name="adminPassword">myadminpwd</property>

                  <property name="target">server</property>

              </configuration>

          </container>

      </group>

      </arquillian>

       

      But then, there is no deployment happening anymore (as far as the server logs say).

      And I get the following error:

      SEVERE: exit_code: FAILURE, message: Invalid user name or password. [status: CLIENT_ERROR reason: Unauthorized]

       

      Now I'm running out of ideas. What have I done wrong?

      If I address the servers seperately, everything works fine. For me, that means the servers are reachable and the user credentials are correct.

      Even the first test case (DataTransferCreateExportIT) is failing with the same error.

       

      Thanks for your help in advance!

       

      Timo

       

      Nachricht geändert durch Timo Zimmermann - Emphasized the group tags in arquillian.xml