Question

Does anyone have a working configuration for Aquillian using a managed Tomcat 7? Arquillian fails always after starting Tomcat with the following lines

Apr 15, 2014 12:04:39 PM org.apache.catalina.startup.Catalina start
Information: Server startup in 1165 ms
Tests run: 4, Failures: 1, Errors: 0, Skipped: 3, Time elapsed: 3.453 sec <<< FAILURE!
arquillianBeforeSuite(net.sweblog.jerseyplayground.simple.HelloResourceIT)  Time elapsed: 3.328 sec  <<< FAILURE!
org.jboss.arquillian.container.spi.client.container.LifecycleException: Could not start container
Was it helpful?

Solution

To use a managed Tomcat 7 together with Arquillian you need to replace the original tomcat-users.xml with a custom one, like this one here:

<tomcat-users>
    <role rolename="manager-gui"/>
    <role rolename="manager-jmx"/>
    <role rolename="manager-script"/>
    <user username="tomcat" password="tomcat" 
          roles="manager-script, manager-jmx, manager-gui"/>
    <user username="masterofdesaster" password="letmein" 
          roles="manager-script"/>
</tomcat-users>

Important for the setup is the second to last line there I defined the user masterofdesaster with his own password.

Furthermore you must configure Arquillian via arquillian.xml. My one looks like this and uses the user masterofdesaster to perform the deployment during my tests:

<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="tomcat7" default="true">
        <configuration>
            <property name="catalinaHome">/path/to/tomcat7</property>

            <property name="jmxPort">8089</property>
            <property name="bindHttpPort">8080</property>

            <property name="user">masterofdesaster</property>
            <property name="pass">letmein</property>
            <property name="serverConfig">server.xml</property>
        </configuration>
    </container>
</arquillian>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top