Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Arquillian and Tomcat6 issue

I have two questions regarding Arquillian and Tomcat:

-My arquillian tests fail with the following error message:

org.jboss.jsfunit.example.hellojsf.HelloJSFTest Time elapsed: 0 sec <<< ERROR! org.jboss.arquillian.container.spi.ConfigurationException: Unable to connect to Tomcat manager. The server command (/deploy?path=%2Ftest) failed with responseCode (401) and responseMessage (Non-Autorisé). Please make sure that you provided correct credentials to an user which is able to access Tomcat manager application. These credentials can be specified in the Arquillian container configuration as "user" and "pass" properties. The user must have appripriate role specified in tomcat-users.xml file.

FYI my arquillian.xml file is as follows:

<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">
      <engine>
        <property name="deploymentExportPath">target/</property>
         <property name="jmxPort">8099</property>
        <property name="user">admin</property>
        <property name="pass">admin75</property>
    </engine>

    <defaultProtocol type="Servlet 2.5" />
     <container qualifier="tomcat-remote">
        <configuration>
            <property name="jmxPort">8099</property>
            <property name="user">admin</property>
            <property name="pass">admin75</property>
        </configuration>
    </container>
</arquillian>

I am trying to adapt the sample app for tomcat 6. Can anyone please help?

-When will Arquillian support tomcat 7?

Regards,

J.

tomcat-users.xml:

<tomcat-users>
  <role rolename="manager"/>
  <role rolename="tomcat"/>
  <role rolename="admin"/>
  <role rolename="role1"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="admin" password="admin75" roles="manager,admin"/>

</tomcat-users>
like image 689
balteo Avatar asked Nov 05 '22 11:11

balteo


1 Answers

This message

Unable to connect to Tomcat manager. The server command (/deploy?path=%2Ftest) failed with responseCode (401) and responseMessage (Non-Autorisé).

indicates that one of the following is true:

  • the tomcat-users.xml file used by your Tomcat installation does not have the admin user (that you've specified in arquillian.xml),
  • or the admin user is not mapped to the manager role in Tomcat 6, or the manager-script role in Tomcat 7.

When will Arquillian support tomcat 7?

Arquillian supports Tomcat 7, as an emebedded or a managed container. The documentation is not up to date (as of now), but the configuration parameters are more or less the same as the embedded and managed equivalents in Tomcat 6. The artifact Id to use for

  • a managed Tomcat 7 instance is org.jboss.arquillian.container:arquillian-tomcat-managed-7.
  • an embedded Tomcat 7 instance is org.jboss.arquillian.container:arquillian-tomcat-embedded-7.

As of today, 1.0.0.CR2 is the latest stable release. You can use 1.0.0.Final-SNAPSHOT, if you want to work against the development build.


Also, you can omit several redundant properties from your arquillian.xml file. A cleaner configuration would look like:

<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">
      <engine>
        <property name="deploymentExportPath">target/</property>
    </engine>

    <container qualifier="tomcat-remote">
        <configuration>
            <property name="jmxPort">8099</property>
            <property name="user">admin</property>
            <property name="pass">admin75</property>
        </configuration>
    </container>
</arquillian>
like image 159
Vineet Reynolds Avatar answered Nov 11 '22 14:11

Vineet Reynolds