2 Replies Latest reply on Oct 7, 2011 5:02 AM by Vinicius Carvalho

    JBoss AS 7 Managed vs Remote

    Vinicius Carvalho Apprentice

      Hi there! As I said on many other posts (sorry again about the spam)

       

      The only container I was able to use so far was JBAS 7 with Arquillian 1.0.0.CR5 (Since we are targeting JBAS7 I'm trying to avoid 6 at all)

       

      I'm using JBAS7 with the same config found at (https://github.com/kpiwko/blog/blob/master/drone-selenium/pom.xml and https://github.com/kpiwko/blog/blob/master/drone-selenium/src/test/resources/arquillian.xml)  (not being able to debug, I believe I'm missing some property on my container configuration)

       

      Well, so I first ran with the managed-profile. Test executes, starts my jboss 7.0.1 located at target/ and deploys the service (can't debug)

       

      So, change to remote profile, and started jboss outside eclipse.

       

      On first attempt to run I get an error saying there's already a running jboss, that was a little bit shocking, isnt't the whole remote thing based on having a running container? Well, add a property "allowConnectingToRunningServer" and fired the test again

       

      This time, for my surprise again. It starts the server, which will run in loads of problems because of the port conflicts and then deploys my test on the remote service.

       

      Is this normal? Having a remote container running but the test booting a local version as well?

       

      I'm still really confused on how setup arquillian. Read all the FAQs and loads of discussions, but it seems that most of examples are out dated.

       

      Still, don't want to give up on the framework, it is a brilliant idea.

       

      Regards

        • 1. Re: JBoss AS 7 Managed vs Remote
          Aslak Knutsen Master

          It seems your not actually running with the Remote container, but still using Managed.

           

          Could you post your pom.xml?

          1 of 1 people found this helpful
          • 2. Re: JBoss AS 7 Managed vs Remote
            Vinicius Carvalho Apprentice

            Sure thing, I got this from the drone-selenium pom example (mixed other profiles as well as I'm trying different alternatives)

             

            What I'm really hoping to achieve is to have jboss-7 remote for our CI, jboss-7 managed or embedded for local development, and also weld-ee for some basic testing that don't require AS resources (like events, decorators and such)

             

            But so far, I could only get jboss-7 embedded to work. Again, amazing project, I'll not give up on this, I'm pushing it forward here to get arquillian to be the defacto testing platform for our systems.

             

            Regards

             

             

            <?xml version="1.0"?>
            <project
                      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
                      xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                      <modelVersion>4.0.0</modelVersion>
                      <parent>
                                <artifactId>service-bus</artifactId>
                                <groupId>com.ericsson.oss</groupId>
                                <version>0.0.1-SNAPSHOT</version>
                      </parent>
                      <groupId>com.ericsson.oss</groupId>
                      <artifactId>service-bus-jgroups-test</artifactId>
                      <version>0.0.1-SNAPSHOT</version>
                      <name>service-bus-jgroups-test</name>
                      <url>http://maven.apache.org</url>
                      <properties>
                                <version.arquillian_core>1.0.0.CR5</version.arquillian_core>
                                <version.jbossas_7>7.0.1.Final</version.jbossas_7>
                                <version.jboss_60>6.0.0.Final</version.jboss_60>
                                <version.junit>4.8.2</version.junit>
                                <version.weld_core>1.0.1-SP4</version.weld_core>
                                <version.weld_core_11>1.1.0.Final</version.weld_core_11>
                                <JBOSS_HOME>C:/java/jboss-6.0.0.Final</JBOSS_HOME>
                      </properties>
                      <profiles>
                                <profile>
                                          <id>weld-se-embedded</id>
                                          <dependencies>
                                                    <dependency>
                                                              <groupId>org.jboss.arquillian.container</groupId>
                                                              <artifactId>arquillian-weld-se-embedded-1</artifactId>
                                                              <version>${version.arquillian_core}</version>
                                                    </dependency>
                                                    <dependency>
                                                              <!-- Need on all profiles except Glassfish to compile, api is not 100% 
                                                                        up to date with final spec -->
                                                              <groupId>org.jboss.ejb3</groupId>
                                                              <artifactId>jboss-ejb3-api</artifactId>
                                                              <version>3.1.0</version>
                                                    </dependency>
                                                    <!-- org.jboss.weld -->
                                                    <dependency>
                                                              <groupId>org.jboss.weld</groupId>
                                                              <artifactId>weld-core</artifactId>
                                                    </dependency>
                                                    <dependency>
                                                              <groupId>org.jboss.weld</groupId>
                                                              <artifactId>weld-api</artifactId>
                                                    </dependency>
                                                    <dependency>
                                                              <groupId>org.slf4j</groupId>
                                                              <artifactId>slf4j-simple</artifactId>
                                                    </dependency>
                                                    <dependency>
                                                              <groupId>javax.el</groupId>
                                                              <artifactId>el-api</artifactId>
                                                              <version>2.2</version>
                                                    </dependency>
                                          </dependencies>
                                          <dependencyManagement>
                                                    <dependencies>
                                                              <!-- org.jboss.weld -->
                                                              <dependency>
                                                                        <groupId>org.jboss.weld</groupId>
                                                                        <artifactId>weld-core-bom</artifactId>
                                                                        <version>${version.arquillian_core}</version>
                                                                        <type>pom</type>
                                                                        <scope>import</scope>
                                                              </dependency>
                                                    </dependencies>
                                          </dependencyManagement>
                                          <build>
                                                    <plugins>
                                                              <plugin>
                                                                        <groupId>org.apache.maven.plugins</groupId>
                                                                        <artifactId>maven-surefire-plugin</artifactId>
                                                                        <configuration>
                                                                        </configuration>
                                                              </plugin>
                                                    </plugins>
                                          </build>
                                </profile>
                                <profile>
                                          <id>weld-ee-embedded</id>
                                          <dependencies>
                                                    <dependency>
                                                              <groupId>org.jboss.arquillian.container</groupId>
                                                              <artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
                                                              <version>1.0.0-SNAPSHOT</version>
                                                    </dependency>
                                                    <dependency>
                                                              <!-- Need on all profiles except Glassfish to compile, api is not 100% 
                                                                        up to date with final spec -->
                                                              <groupId>org.jboss.ejb3</groupId>
                                                              <artifactId>jboss-ejb3-api</artifactId>
                                                              <version>3.1.0</version>
                                                    </dependency>
                                                    <!-- org.jboss.weld -->
                                                    <dependency>
                                                              <groupId>org.jboss.weld</groupId>
                                                              <artifactId>weld-core</artifactId>
                                                    </dependency>
                                                    <dependency>
                                                              <groupId>org.jboss.weld</groupId>
                                                              <artifactId>weld-api</artifactId>
                                                    </dependency>
                                                    <dependency>
                                                              <groupId>org.slf4j</groupId>
                                                              <artifactId>slf4j-simple</artifactId>
                                                    </dependency>
                                                    <dependency>
                                                              <groupId>javax.el</groupId>
                                                              <artifactId>el-api</artifactId>
                                                              <version>2.2</version>
                                                    </dependency>
                                                    <dependency>
                                                              <groupId>javax.transaction</groupId>
                                                              <artifactId>jta</artifactId>
                                                              <version>1.1</version>
                                                              <scope>provided</scope>
                                                    </dependency>
            
            
                                                    <dependency>
                                                              <groupId>javax.persistence</groupId>
                                                              <artifactId>persistence-api</artifactId>
                                                              <version>1.0</version>
                                                              <scope>provided</scope>
                                                    </dependency>
                                                    <dependency>
                                                              <groupId>javax.validation</groupId>
                                                              <artifactId>validation-api</artifactId>
                                                              <version>1.0.0.GA</version>
                                                              <scope>provided</scope>
                                                    </dependency>
                                                    <dependency>
                                                              <groupId>org.jboss.spec.javax.servlet</groupId>
                                                              <artifactId>jboss-servlet-api_3.0_spec</artifactId>
                                                              <version>1.0.0.Beta2</version>
                                                              <scope>provided</scope>
                                                    </dependency>
            
            
                                          </dependencies>
                                          <dependencyManagement>
                                                    <dependencies>
                                                              <!-- org.jboss.weld -->
                                                              <dependency>
                                                                        <groupId>org.jboss.weld</groupId>
                                                                        <artifactId>weld-core-bom</artifactId>
                                                                        <version>${version.weld_core_11}</version>
                                                                        <type>pom</type>
                                                                        <scope>import</scope>
                                                              </dependency>
                                                    </dependencies>
                                          </dependencyManagement>
                                          <build>
                                                    <plugins>
                                                              <plugin>
                                                                        <groupId>org.apache.maven.plugins</groupId>
                                                                        <artifactId>maven-surefire-plugin</artifactId>
            
            
                                                              </plugin>
                                                    </plugins>
                                          </build>
                                </profile>
            <profile>
                                          <id>jbossas-remote-6</id>
                                          <dependencies>
                                                    <dependency>
                                                              <groupId>org.jboss.arquillian.container</groupId>
                                                              <artifactId>arquillian-jbossas-remote-6</artifactId>
                                                              <version>1.0.0-SNAPSHOT</version>
                                                    </dependency>
                                                    <dependency>
                                                              <!--
                                                                        Need on all profiles except Glassfish to compile, api is not 100%
                                                                        up to date with final spec
                                                              -->
                                                              <groupId>org.jboss.ejb3</groupId>
                                                              <artifactId>jboss-ejb3-api</artifactId>
                                                              <version>3.1.0</version>
                                                    </dependency>
                                                    <dependency>
                                                              <groupId>org.jboss.jbossas</groupId>
                                                              <artifactId>jboss-as-client</artifactId>
                                                              <version>${version.jboss_60}</version>
                                                              <type>pom</type>
                                                    </dependency>
                                          </dependencies>
                                          <build>
                                                    <plugins>
                                                              <plugin>
                                                                        <groupId>org.apache.maven.plugins</groupId>
                                                                        <artifactId>maven-surefire-plugin</artifactId>
                                                                        <configuration>
                                                                                  <excludes>
                                                                                            <exclude>com/acme/cdi/conversation/*</exclude>
                                                                                  </excludes>
                                                                        </configuration>
                                                              </plugin>
                                                    </plugins>
                                          </build>
                                </profile>
                                <profile>
            
            
                                          <id>jbossas-managed-6</id>
                                          <dependencies>
                                                    <dependency>
                                                              <groupId>org.jboss.arquillian.container</groupId>
                                                              <artifactId>arquillian-jbossas-managed-6</artifactId>
                                                              <version>${arquillian.version}</version>
                                                    </dependency>
                                                    <dependency>
                                                              <groupId>org.jboss.jbossas</groupId>
                                                              <artifactId>jboss-server-manager</artifactId>
                                                              <version>1.0.3.GA</version>
                                                    </dependency>
                                                    <dependency>
                                                              <groupId>org.jboss.jbossas</groupId>
                                                              <artifactId>jboss-as-client</artifactId>
                                                              <version>6.0.0.Final</version>
                                                              <type>pom</type>
                                                    </dependency>
                                          </dependencies>
                                </profile>
                                <profile>
                                          <id>jbossas-embedded-6</id>
                                          <dependencies>
                                                    <dependency>
                                                              <groupId>org.jboss.arquillian.container</groupId>
                                                              <artifactId>arquillian-jbossas-embedded-6</artifactId>
                                                              <version>1.0.0.CR2</version>
                                                    </dependency>
                                                    <dependency>
                                                              <groupId>org.jboss.jbossas</groupId>
                                                              <artifactId>jboss-as-depchain</artifactId>
                                                              <version>6.0.0.Final</version>
                                                              <type>pom</type>
                                                    </dependency>
                                          </dependencies>
                                          <dependencyManagement>
                                                    <dependencies>
                                                              <dependency>
                                                                        <groupId>org.jboss.jbossas</groupId>
                                                                        <artifactId>jboss-as-depchain</artifactId>
                                                                        <version>6.0.0.Final</version>
                                                                        <type>pom</type>
                                                                        <scope>import</scope>
                                                              </dependency>
                                                    </dependencies>
                                          </dependencyManagement>
                                          <build>
                                                    <plugins>
                                                              <plugin>
                                                                        <artifactId>maven-surefire-plugin</artifactId>
                                                                        <configuration>
                                                                                  <additionalClasspathElements>
                                                                                            <additionalClasspathElement>C:/java/jboss-6.0.0.Final/client/jbossws-native-client.jar</additionalClasspathElement>
                                                                                            <!-- Because jbossweb.sar contains shared web.xml, which must be 
                                                                                                      visible from same CL as TomcatDeployer.class.getClassLoader -->
                                                                                            <additionalClasspathElement>C:/java/jboss-6.0.0.Final/server/default/deploy/jbossweb.sar</additionalClasspathElement>
                                                                                  </additionalClasspathElements>
                                                                                  <redirectTestOutputToFile>true</redirectTestOutputToFile>
                                                                                  <trimStackTrace>false</trimStackTrace>
                                                                                  <printSummary>true</printSummary>
                                                                                  <forkMode>once</forkMode>
                                                                                  <!-- MaxPermSize Required to bump the space for relective data like 
                                                                                            classes, methods, etc. EMB-41. Endorsed required for things like WS support 
                                                                                            (EMB-61) -->
                                                                                  <argLine>-Xmx512m -XX:MaxPermSize=256m
                                                                                            -Djava.net.preferIPv4Stack=true
                                                                                            -Djava.util.logging.manager=org.jboss.logmanager.LogManager
                                                                                            -Djava.endorsed.dirs=C:/java/jboss-6.0.0.Final/lib/endorsed
                                                                                            -Djboss.home=C:/java/jboss-6.0.0.Final
                                                                                            -Djboss.boot.server.log.dir=C:/java/jboss-6.0.0.Final</argLine>
                                                                        </configuration>
                                                              </plugin>
                                                    </plugins>
            
            
                                          </build>
            
            
                                </profile>
                                <profile>
                                          <id>arq-jbossas-managed-7</id>
                                          <activation>
                                                    <activeByDefault>true</activeByDefault>
                                          </activation>
                                          <dependencies>
                                                    <dependency>
                                                              <groupId>org.jboss.as</groupId>
                                                              <artifactId>jboss-as-arquillian-container-managed</artifactId>
                                                              <version>${version.jbossas_7}</version>
                                                              <scope>test</scope>
                                                    </dependency>
                                          </dependencies>
                                          <build>
                                                    <testResources>
                                                              <testResource>
                                                                        <directory>src/test/resources</directory>
                                                              </testResource>
            
            
                                                    </testResources>
            
            
                                                    <plugins>
                                                              <!-- Download JBoss AS and unpack it to have it available during tests -->
                                                              <!-- You can specify path to JBoss AS 7 in arquillian.xml -->
                                                              <plugin>
                                                                        <groupId>org.apache.maven.plugins</groupId>
                                                                        <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>${version.jbossas_7}</version>
                                                                                                                          <type>zip</type>
                                                                                                                          <overWrite>false</overWrite>
                                                                                                                          <outputDirectory>${project.build.directory}</outputDirectory>
                                                                                                                </artifactItem>
                                                                                                      </artifactItems>
                                                                                            </configuration>
                                                                                  </execution>
                                                                        </executions>
                                                              </plugin>
                                                    </plugins>
                                          </build>
                                </profile>
                                <profile>
                                          <id>arq-jbossas-remote-7</id>
                                          <dependencies>
                                                    <dependency>
                                                              <groupId>org.jboss.as</groupId>
                                                              <artifactId>jboss-as-arquillian-container-remote</artifactId>
                                                              <version>${version.jbossas_7}</version>
                                                              <scope>test</scope>
                                                    </dependency>
                                          </dependencies>
                                          <build>
                                                    <testResources>
                                                              <testResource>
                                                                        <directory>src/test/resources</directory>
                                                              </testResource>
                                                              <testResource>
                                                                        <directory>src/test/resources-jbossas-7</directory>
                                                              </testResource>
                                                    </testResources>
                                          </build>
                                </profile>
            
            
                      </profiles>
            
            
            
            
            
            
                      <dependencyManagement>
                                <dependencies>
                                          <dependency>
                                                    <groupId>org.jboss.arquillian</groupId>
                                                    <artifactId>arquillian-bom</artifactId>
                                                    <version>${version.arquillian_core}</version>
                                                    <type>pom</type>
                                                    <scope>import</scope>
                                          </dependency>
                                </dependencies>
                      </dependencyManagement>
            
            
            
            
                      <dependencies>
            
            
            
            
                                <dependency>
                                          <groupId>com.ericsson.oss</groupId>
                                          <artifactId>service-bus-jgroups</artifactId>
                                          <version>0.0.1</version>
                                </dependency>
            
            
                                <dependency>
                                          <groupId>org.jboss.seam.solder</groupId>
                                          <artifactId>seam-solder</artifactId>
                                          <version>3.0.0.Final</version>
                                </dependency>
            
            
            
            
                                <!-- test dependencies -->
                                <dependency>
                                          <groupId>org.jboss.arquillian.junit</groupId>
                                          <artifactId>arquillian-junit-container</artifactId>
                                          <scope>test</scope>
                                </dependency>
                                <dependency>
                                          <groupId>junit</groupId>
                                          <artifactId>junit</artifactId>
                                          <scope>test</scope>
                                          <version>${version.junit}</version>
                                </dependency>
            
            
                                <!-- Resolution of JAR libraries into WAR archive -->
                                <dependency>
                                          <groupId>org.jboss.shrinkwrap.resolver</groupId>
                                          <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
                                          <scope>test</scope>
                                </dependency>
            
            
                      </dependencies>
            </project>