Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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>
share|improve this question

1 Answer 1

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>
share|improve this answer
    
Thanks a lot for your reply. I have checked the security configuration and as you can see for yourself (see my xml above), the config is ok. Where else do I have to look to? Regards, Julien. –  balteo Nov 7 '11 at 18:18
    
@balteo, can you access the manager application using the same credentials? Arquillian deploys the test by uploading the archive to the /manager/deploy URL (like http://localhost:8080/manager/deploy). If you fail to access this URL, could you post the message that you receive? –  Vineet Reynolds Nov 7 '11 at 18:55
    
it seems I can access the url. Here what I get: (ECHEC - Un chemin de contexte invalide null a été spécifié) the pages does load and I don't get a security exception. –  balteo Nov 7 '11 at 19:35
    
Ok, I think the problem is related to ARQ-630 and SHRINKDESC-97 but I can't say for sure. Can you verify whether specifying the workaround specified in SHRINKDESC-97 of specifying project.build.sourceEncoding or argLine (with file.encoding) will change the behavior? You'll need to change the encoding of arquillian.xml to the same encoding that you specify in your project POM, which should be ISO-8859-1 (since the fix for ARQ-630 is not available in the Nexus repo). –  Vineet Reynolds Nov 7 '11 at 19:56
    
No luck with this workaround. Any other idea? –  balteo Nov 7 '11 at 20:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.