1 Reply Latest reply on Nov 4, 2011 2:02 PM by viggo.navarsete

    How to run embedded jboss 6 on different port?

    viggo.navarsete

      I'm already having a jboss running on port 8080, and I want my Arquillian tests running on an embedded jboss 6 to be able to run at the same time without getting into port conflicts. I've read MANY good blogs about how this could be done:

      https://github.com/joserodolfofreitas/faces/blob/jfsunit_arqullian/tests/src/test/resources/arquillian.xml

      http://techblog.joserodolfo.com/2011/06/arquillian-tip-starting-jboss-on-different-ports/

      http://community.jboss.org/message/602539

      https://github.com/arquillian/arquillian-showcase/blob/master/jaxrs/src/test/resources/arquillian.xml

       

      BUT, none have been working for me, I *always* ending up with a conflict on port 8080

       

      Questions:

      1. Can someone assist me in showing a correct arquillian.xml that I can use?

      2. Do I need a jndi.properties? Think the answer is no, but still, good to have it confirmed:)

      3. Any limitations using embedded vs managed when it comes to what you can control in arquillian.xml? Can ports be defined using embedded?

       

      This is one (of many..) arquillian.xml configurations I've tried:

      <?xml version="1.0" encoding="UTF-8"?>

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

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

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

       

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

              <configuration>

                  <property name="profileName">default</property>

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

                  <property name="httpPort">8181</property>

                  <property name="rmiPort">1199</property>

              </configuration>       

          </container> 

      </arquillian>

        • 1. Re: How to run embedded jboss 6 on different port?
          viggo.navarsete

          To make it work you have to:

          1. Add a portset to the argLine in pom.xml (where you have your maven-surefire-plugin/maven-failsafe-plugin defind): -Djboss.service.binding.set=ports-02

          2. You need an arquillian.xml which looks like this:

          <?xml version="1.0" encoding="UTF-8"?>

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

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

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

           

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

                  <configuration>

                      <property name="profileName">default</property>

                      <property name="bindAddress">0.0.0.0</property>

                      <property name="httpPort">8280</property>

                      <property name="rmiPort">1299</property>

                  </configuration>       

              </container> 

          </arquillian>

           

          Important that the port set used (in my example ports-02) match the httpPort AND rmiPort used in arquillian.xml. ports-02 means that all ports will be incremented by 200 from default, so httpPort increases from 8080 to 8280, and rmiPort increases from 1099 to 1299. ports-03 would have httpPort 8380 and rmiPort 1399.

          profileName is the jboss profile used in $JBOSS_HOME/server/<profileName>.