1 Reply Latest reply on Oct 21, 2011 7:10 AM by Aslak Knutsen

    running server: due to the possible harmful effect of connecting to the wrong server

    nimo stephan Master

      I am running a test with arquillian managed mode.

       

      If my (local jboss7) server is not running, then arquillian starts the server appropriate and stops after testing.

       

      However, I want to test it against a running server to save the time for starting up and shutting down.

       

      When doing so, arquillian complains:

       

      org.jboss.arquillian.container.spi.client.container.LifecycleException: The server is already running! Managed containers does not support connecting to running server instances due to the possible harmful effect of connecting to the wrong server. Please stop server before running or change to another type of container.

      To disable this check and allow Arquillian to connect to a running server, set allowConnectingToRunningServer to true in the container configuration

          at org.jboss.as.arquillian.container.managed.ManagedDeployableContainer.verifyNoRunningServer(ManagedDeployableContainer.java:186)

       

      I added <property name="allowConnectingToRunningServer">true</property> and all works right.

       

      However, I only have one question about this:

       

      {quote}"due to the possible harmful effect of connecting to the wrong server."{quote}

       

      I dont understand the statement above.

      I have exactly defined the server within arquillian.xml,

      so there should be no probability to connect to (another) wrong server.

       

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

            <protocol type="jmx-as7">

               <property name="executionType">REMOTE</property>

            </protocol>

            <configuration>

               <property name="jbossHome">C:\boss-as-7.0.2.Final</property>

               <!-- Faster startup -->

               <property name="javaVmArguments">-d32 -noverify</property>

            </configuration>

         </container>

       

      Did I interpret the message wrong?

        • 1. Re: running server: due to the possible harmful effect of connecting to the wrong server
          Aslak Knutsen Master

          This came as a request from a medical client early on. The point is, that the Managed connector is suppose to start a container, and not just connect to one(that's what Remote connectors are for). Previously the Managed connectors would check if the ports were active and use the one found or start one. The problem with this is that even tho configured in your test, your might have another instance that just happens to be running at that time on the same ports but has a completely different configuration, e.g. a DataSource for a stage or production environment.

           

          So if the intent is to connect to a running container, you should use the Remote connectors. If your intent is to start one, then use the Managed connectors.

           

          The AS7 Managed connector is a 'special' case where you have the option to configure the Managed connector to allow to connect to a running instance, but it's a choice you have made.