6 Replies Latest reply on Oct 23, 2014 7:31 AM by abertschi

    ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata using wildfly-arquillian-container-domain-remote

    abertschi

      Using wildfly-arquillian-container-domain-remote in version 8.1.0.Final to deploy to a jboss-as-7.1.1.Final, I get

       

      ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.

         at org.jboss.arquillian.protocol.servlet.ServletUtil.determineBaseURI(ServletUtil.java:64)

          at org.jboss.arquillian.protocol.servlet.ServletURIHandler.locateTestServlet(ServletURIHandler.java:60)

          at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.invoke(ServletMethodExecutor.java:84)

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

          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)


      Although the deployment looks fine and the enriched artifact will be deployed successfully to the servers in the requested server-group,

      the test methods aren't triggered and arquillian fails showing the above exception.

       

      I use Servlet 3.0  but for any reason, arquillian can not determine the port and ip of the server to trigger the tests.

       

      The exception occurs here, where address and port are null:

       

      public static URI determineBaseURI(ServletProtocolConfiguration config, HTTPContext context, String servletName)

         {

            String address = config.getHost();

            Integer port = config.getPort();

            // TODO: can not set contextRoot in config, change to prefixContextRoot

            String contextRoot = null; //protocolConfiguration.getContextRoot();

            Servlet servlet = context.getServletByName(servletName);

            if(servlet != null)

            {

               // use the context where the Arquillian servlet is found

               if(address == null)

               {

                  address = context.getHost();

               }

               if(port == null)

               {

                  port = context.getPort();

               }

               contextRoot = servlet.getContextRoot();

            }

            else

            {

               throw new IllegalArgumentException(

                    servletName + " not found. " +

                    "Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.");

            }

            return URI.create("http://" + address + ":" + port + contextRoot);

         }

       

       

      I included all further configurations in a gist.

      See: ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata using wildfly-arquillian-contai…