4 Replies Latest reply on Aug 8, 2017 8:16 PM by Richard Kennard

    Arquillian deploy to remote wildfly domain failing.

    Joe Rombs Newbie

      Hi,

      I have used the discussionArquillian deploy to remote domain EAP 6.1 fails - How to specify server? as a resource but I am still having problems. My server group name is primary-clustered. I have attached my pom.xml, arquillian.xml, and test class. I am receiving the following error:

       

      java.lang.IllegalArgumentException: No org.jboss.arquillian.container.spi.client.protocol.metadata.HTTPContext found in org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaData. Servlet protocol can not be used

          at org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:64)

          at org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:35)

          at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.getContainerMethodExecutor(RemoteTestExecuter.java:118)

          at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.execute(RemoteTestExecuter.java:108)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:606)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

      ...

       

      I have tried changing the default protocol to jmx with the following tag

        <protocol type=“jmx-wildfly”>  <!-- jmx-wildfly was just a guess -->

          <property name=“executionType”>REMOTE</property>

        </protocol>

      as a subelement of container along with substituting arquillian-protocol-jmx for arquillian-protocol-servlet in pom.xml. However, I don't know the correct type to specify for jmx for wildfly. But anyway, it seems like I should be using servlet 3.0.

       

      Any help would be greatly appreciated.

       

      Thanks,

      Joe

        • 1. Re: Arquillian deploy to remote wildfly domain failing.
          Joe Rombs Newbie

          Update: I brought up the default domain delivered with a wildfly installation using domain.sh. I was able to deploy my test successfull to both server groups (main and other). The only significant difference that I can find between my cluster and the one created by domain.sh is that I have haproxy running on localhost:8080 and the domain controller which also runs on localhost does not host a server as well and thus doesn't use 8080. When I look at the logs of the servers within the domain the war is being deployed and undeployed to all of the servers. However, I am still receiving

          Time elapsed: 0.028 sec  <<< ERROR!

          java.lang.IllegalArgumentException: No org.jboss.arquillian.container.spi.client.protocol.metadata.HTTPContext found in org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaData. Servlet protocol can not be used

              at org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:64)

              at org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:35)

              at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.getContainerMethodExecutor(RemoteTestExecuter.java:118)

              at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.execute(RemoteTestExecuter.java:108)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              at java.lang.reflect.Method.invoke(Method.java:606)

              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

           

          on running the test. Any ideas on why 8080 might make a difference?

           

          Thanks,

          Joe

          • 2. Re: Arquillian deploy to remote wildfly domain failing.
            Richard Yang Apprentice

            I have the same problem with wildfly 8.1.0.Final.

            I could not get servlet protocol works for arquillian, so I am trying jmx protocol. But I could not find the protocol name anywhere. I tried protocol type=“jmx-wildfly” but it did not work. This is ridiculous.

            Do you know the protocol type now?

             

            Thanks.

            • 3. Re: Arquillian deploy to remote wildfly domain failing.
              Bartosz Majsak Master

              Hi Richard,

               

              sorry to hear your frustration, so let me help you right away.

               

              For the JMX protocol you don't need to specify anything special, as this is the default one shipped with both JBoss A7 (or EAP for that matter) and Wildfly. This protocol however has several well known shortcomings, so you want be able to use all the features Arquillian has to offer.

               

              Setting up Servlet protocol on the other hand is rather easy. You need two things.

               

              1. Pull additional dependency implementing it. Here's example with Maven

              https://github.com/bartoszmajsak/arquillian-extension-persistence/blob/master/pom.xml#L816

              2. Define that you want to use it. Globally you can do it in arquillian.xml

              https://github.com/bartoszmajsak/arquillian-extension-persistence/blob/master/int-tests/src/test/resources-wildfly-8.1.0/arquillian.xml#L29

               

              Other option is to specify the protocol particular test class is expected to use by defining the @OverProtocol annotation on your @Deployment method.

               

              Hope that helps.

               

              Cheers,

              Bartosz

              • 4. Re: Arquillian deploy to remote wildfly domain failing.
                Richard Kennard Novice

                Came across the same problem just now. According to here...

                 

                http://www.javatips.net/api/wildfly-arquillian-master/protocol-jmx/src/main/java/org/jboss/as/arquillian/protocol/jmx/Ex…

                 

                ...the protocol name is 'jmx-as7' (yes, even on WildFly). So:

                 

                <defaultProtocol type="jmx-as7" />

                 

                ...seems to work.