1 Reply Latest reply on Sep 23, 2013 5:08 AM by Petr Mensik

    Can't deploy to the Glassfish Managed

    Petr Mensik Newbie

      Hey, I am trying to run functional tests on Glassfish in Managed mode but I wasn't able to succeed. So this is the profile I am using

       

      <profile>
                  <id>glassfish-managed-3-1</id>
                  <dependencies>
                      <dependency>
                          <groupId>org.jboss.arquillian.container</groupId>
                          <artifactId>arquillian-glassfish-managed-3.1</artifactId>
                          <version>1.0.0.CR4</version>
                          <!--<scope>test</scope>-->
                      </dependency>
                      <dependency>
                          <groupId>org.jboss.spec</groupId>
                          <artifactId>jboss-javaee-6.0</artifactId>
                          <version>1.0.0.Final</version>
                          <type>pom</type>
                          <scope>provided</scope>
                      </dependency>
      <!--                <dependency>
                          <groupId>javax</groupId>
                          <artifactId>javaee-api</artifactId>
                          <version>6.0</version>
                          <scope>provided</scope>
                      </dependency>-->
                      <!--This caused java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/mail/MessagingException-->
                  </dependencies>
                  <build>
                      <plugins>
                          <plugin>
                              <artifactId>maven-dependency-plugin</artifactId>
                              <executions>
                                  <execution>
                                      <id>unpack</id>
                                      <phase>process-test-classes</phase>
                                      <goals>
                                          <goal>unpack</goal>
                                      </goals>
                                      <configuration>
                                          <artifactItems>
                                              <artifactItem>
                                                  <groupId>org.glassfish.main.distributions</groupId>
                                                  <artifactId>glassfish</artifactId>
                                                  <version>3.1.2</version>
                                                  <type>zip</type>
                                                  <outputDirectory>${project.build.directory}</outputDirectory>
                                              </artifactItem>
                                          </artifactItems>
                                      </configuration>
                                  </execution>
                              </executions>
                          </plugin>
                          <plugin>
                              <artifactId>maven-surefire-plugin</artifactId>
                              <version>2.16</version>
                              <configuration>
                                  <systemProperties>
                                      <arquillian.launch>glassfish-managed-3-1</arquillian.launch>
                                  </systemProperties>
                                  <environmentVariables>
                                      <GLASSFISH_HOME>${project.build.directory}/glassfish3</GLASSFISH_HOME>
                                  </environmentVariables>
                              </configuration>
                          </plugin>
                      </plugins>
                  </build>
              </profile>
      

      This is my entry in arquillian.xml

      <container qualifier="glassfish-managed-3-1">
          <property name="javaVmArguments">-Xms1024m -Xmx1024m -XX:MaxPermSize=512m</property>
          <property name="enableAssertions">false</property>
      </container>
      

       

      and the deployment method

      @Deployment(testable = false)
      public static WebArchive createDeployment() {
           return ShrinkWrap.createFromZipFile(WebArchive.class, new File("target/faces.war"));
      }
      

       

      And so when I run mvn verify -Pglassfish-managed-3-1 I get

      arquillianBeforeSuite(com.mkyong.common.test.TestHelloWorld)  Time elapsed: 3.288 sec  <<< FAILURE!
      org.jboss.arquillian.container.spi.client.container.LifecycleException: Could not start container
          at org.jboss.arquillian.container.glassfish.managed_3_1.GlassFishServerControl.start(GlassFishServerControl.java:53)
          at org.jboss.arquillian.container.glassfish.managed_3_1.GlassFishManagedDeployableContainer.start(GlassFishManagedDeployableContainer.java:79)
          at org.jboss.arquillian.container.impl.ContainerImpl.start(ContainerImpl.java:199)
      
      

       

      Any hints? Thanks