2 Replies Latest reply on Feb 1, 2018 11:21 AM by tiago.ventosa

    Cannot run Arquillian test on the latest JBoss AS managed container

    varminas

      I have been following Basic Arquillian tutorial Getting Started · Arquillian Guides

      Since dependencies used in that tutorial are outdated I have updated to the recent as Java to the version 8. Tests work on embedded containers but not on the standallone "JBoss AS" managed.

      The problem is as follows:

       

      16:52:22,494 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990

      16:52:22,494 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss EAP 6.4.7.GA (AS 7.5.7.Final-redhat-3) started in 6642ms - Started 153 of 191 services (57 services are lazy, passive or on-demand)

      [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 62.306 s <<< FAILURE! - in example.GreeterTest

      [ERROR] example.GreeterTest  Time elapsed: 62.302 s  <<< ERROR!

      org.jboss.arquillian.container.spi.client.container.LifecycleException: Could not start container

      Caused by: java.util.concurrent.TimeoutException: Managed server was not started within [60] s

       

      I believe there is some mismatch with these two dependencies:

      <groupId>org.jboss.as</groupId>

      <artifactId>jboss-as-dist</artifactId>

      <version>7.5.7.Final-redhat-3</version>

       

      and

       

      <dependency>

         <groupId>org.jboss.as</groupId>

         <artifactId>jboss-as-arquillian-container-managed</artifactId>

         <version>7.5.13.Final-redhat-2</version>

         <scope>test</scope>

      </dependency>

       

      This is how the pom.xml looks like:

       

      <properties>

         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

      </properties>

       

      <build>

         <plugins>

         <plugin>

         <groupId>org.apache.maven.plugins</groupId>

         <artifactId>maven-compiler-plugin</artifactId>

         <version>3.6.1</version>

         <configuration>

         <source>1.8</source>

         <target>1.8</target>

         </configuration>

         </plugin>

       

         <plugin>

         <artifactId>maven-surefire-plugin</artifactId>

         <version>2.20</version>

         </plugin>

       

         <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.jboss.as</groupId>

         <artifactId>jboss-as-dist</artifactId>

         <version>7.5.7.Final-redhat-3</version>

         <type>zip</type>

         <overWrite>false</overWrite>

         <outputDirectory>target</outputDirectory>

         </artifactItem>

         </artifactItems>

         </configuration>

         </execution>

         </executions>

         </plugin>

         </plugins>

      </build>

       

      <dependencies>

         <dependency>

         <groupId>junit</groupId>

         <artifactId>junit</artifactId>

         <version>4.12</version>

         <scope>test</scope>

         </dependency>

         <dependency>

         <groupId>org.jboss.arquillian.junit</groupId>

         <artifactId>arquillian-junit-container</artifactId>

         <scope>test</scope>

         </dependency>

      </dependencies>

       

      <profiles>

         <profile>

         <id>arquillian-weld-ee-embedded</id>

         <activation>

         <activeByDefault>true</activeByDefault>

         </activation>

         <dependencies>

         <dependency>

         <groupId>org.jboss.spec</groupId>

         <artifactId>jboss-javaee-7.0</artifactId>

         <version>1.1.0.Final</version>

         <type>pom</type>

         <scope>provided</scope>

         </dependency>

         <dependency>

         <groupId>org.jboss.arquillian.container</groupId>

         <artifactId>arquillian-weld-ee-embedded-1.1</artifactId>

         <version>1.0.0.Final</version>

         <scope>test</scope>

         </dependency>

         <dependency>

         <groupId>org.jboss.weld</groupId>

         <artifactId>weld-core</artifactId>

         <version>2.4.3.Final</version>

         <scope>test</scope>

         </dependency>

         <dependency>

         <groupId>org.slf4j</groupId>

         <artifactId>slf4j-simple</artifactId>

         <version>1.7.25</version>

         <scope>test</scope>

         </dependency>

         </dependencies>

         </profile>

       

         <profile>

         <id>arquillian-glassfish-embedded</id>

         <dependencies>

         <dependency>

         <groupId>org.jboss.arquillian.container</groupId>

         <artifactId>arquillian-glassfish-embedded-3.1</artifactId>

         <version>1.0.0.Final</version>

         <scope>test</scope>

         </dependency>

         <dependency>

         <groupId>org.glassfish.main.extras</groupId>

         <artifactId>glassfish-embedded-all</artifactId>

         <version>4.1.2</version>

         <scope>provided</scope>

         </dependency>

         </dependencies>

         </profile>

       

         <profile>

         <id>arquillian-jbossas-managed</id>

         <dependencies>

         <dependency>

         <groupId>org.jboss.spec</groupId>

         <artifactId>jboss-javaee-7.0</artifactId>

         <version>1.1.0.Final</version>

         <type>pom</type>

         <scope>provided</scope>

         </dependency>

         <dependency>

         <groupId>org.jboss.as</groupId>

         <artifactId>jboss-as-arquillian-container-managed</artifactId>

         <version>7.5.13.Final-redhat-2</version>

         <scope>test</scope>

         </dependency>

         <dependency>

         <groupId>org.jboss.arquillian.protocol</groupId>

         <artifactId>arquillian-protocol-servlet</artifactId>

         <scope>test</scope>

         </dependency>

         </dependencies>

         </profile>

      </profiles>

       

      <dependencyManagement>

         <dependencies>

         <dependency>

         <groupId>org.jboss.arquillian</groupId>

         <artifactId>arquillian-bom</artifactId>

         <version>1.1.13.Final</version>

         <scope>import</scope>

         <type>pom</type>

         </dependency>

         </dependencies>

      </dependencyManagement>

       

      <repositories>

         <repository>

         <id>maven-rredgat</id>

         <name>Redgat</name>

         <url>https://maven.repository.redhat.com/ga/</url>

         </repository>

      </repositories>

        • 1. Re: Cannot run Arquillian test on the latest JBoss AS managed container
          mjobanek

          Hi,

           

          yeah, the getting started guide is quite outdated - we are planning to update it really soon - sorry for an inconvenience.

           

          Have you tried to use the same version of the container adapter as you use the distribution?

          <dependency>

             <groupId>org.jboss.as</groupId>

             <artifactId>jboss-as-arquillian-container-managed</artifactId>

             <version>7.5.7.Final-redhat-3</version>

             <scope>test</scope>

          </dependency>

          • 2. Re: Cannot run Arquillian test on the latest JBoss AS managed container
            tiago.ventosa

            Not sure if this is still relevant to you, but I had the same problem... unfortunately I coudn't make it work with the most recent versions of the arquillian container managed.

             

            The most recent version that I could use, compatible with JBoss EAP 6.4.7.GA was 7.2.0.FINAL:

             

            <dependency>

                <groupId>org.jboss.as</groupId>

                <artifactId>jboss-as-arquillian-container-managed</artifactId>

                <version>7.2.0.Final</version>

                <scope>test</scope>

            </dependency>