Reputation: 16085
I'm attempting to create a test suite with Arquillian and Tomcat 7 embedded, but when I deploy my WAR file with a web.xml file, I get the following error.
ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.
How do I fix this?
Upvotes: 3
Views: 1696
Reputation: 407
If you have already included the fragment below in your web.xml, this is most probably about jar dependency.
<servlet>
<servlet-name>ArquillianServletRunner</servlet-name>
<servlet-class>org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ArquillianServletRunner</servlet-name>
<url-pattern>/ArquillianServletRunner</url-pattern>
</servlet-mapping>
First, you can check if ArquillianServlet running sending a GET request like below
http://localhost:8080/APP_CONTEXT_ROOT/ArquillianServletRunner?outputMode=serializedObject&className=com.stackoverflow.test.SampleTest&methodName=testSomething
Besides, you can also have a look inside server log and you can see NoClassDefFoundError. Fix your dependencies, then try again.
Upvotes: 1
Reputation: 16085
So I don't know the exact cause of this, but there is an easy workaround.
What is happening is that there is no servlet mapped to the name "ArquillianServletRunner". This appears to be handled by a web-fragment: http://grepcode.com/file/repository.jboss.org/nexus/content/repositories/releases/org.jboss.arquillian.protocol/arquillian-protocol-servlet/1.0.0.Beta1/org/jboss/arquillian/protocol/servlet/v_3/web-fragment.xml
My solution was to just copy the content of the web-fragment in the file above into the web.xml file I was including in the WebArchive being created through ShrinkWrap. That way the servlet "ArquillianServletRunner" was configured and available.
Upvotes: 2