2 Replies Latest reply on Nov 8, 2011 1:01 PM by balteo

    Tomcat + Arquillian issue

    balteo

      Hello,

       

      I have two questions regarding Arquillian and Tomcat:

       

      1. 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?

       

      2. When will Arquillian support tomcat 7?

       

      Regards,

       

      J.

       

      As far as tomcat is concerned, I use the 6.0.33 version.

        • 1. Re: Tomcat + Arquillian issue
          vineet.reynolds

          I see a different error when running the uploaded example against a Tomcat 6.0.33 instance (using mvn clean test -Ptomcat-remote). Arquillian is able to connect to Tomcat and deploy the test archive, without encountering any issue during authentication.

           

          I'd like to know if you're running the test using Maven Surefire or from your IDE, as the IDE need not set the file.encoding property to ISO-8859-1 for the JVM running the test.

           

          For the record, enrichment of tests using the JSFUnit test enricher was failing in my environment:

           

          -------------------------------------------------------------------------------

          Test set: org.jboss.jsfunit.example.hellojsf.HelloJSFTest

          -------------------------------------------------------------------------------

          Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 21.606 sec <<< FAILURE!

          testInitialPage(org.jboss.jsfunit.example.hellojsf.HelloJSFTest)  Time elapsed: 0.733 sec  <<< ERROR!

          java.lang.RuntimeException: Could not inject method parameters

              at org.jboss.jsfunit.arquillian.container.JSFUnitTestEnricher.resolve(JSFUnitTestEnricher.java:89)

              at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.enrichArguments(LocalTestExecuter.java:94)

              at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:60)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

              at java.lang.reflect.Method.invoke(Method.java:597)

              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

              at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)

              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)

              at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

              at org.jboss.arquillian.container.test.impl.execution.ContainerTestExecuter.execute(ContainerTestExecuter.java:38)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

              at java.lang.reflect.Method.invoke(Method.java:597)

              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

              at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

              at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:82)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

              at java.lang.reflect.Method.invoke(Method.java:597)

              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

              at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:68)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

              at java.lang.reflect.Method.invoke(Method.java:597)

              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

              at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:54)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

              at java.lang.reflect.Method.invoke(Method.java:597)

              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)

              at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111)

              at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:239)

              at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:202)

              at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:290)

              at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:45)

              at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:216)

              at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)

              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)

              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)

              at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

              at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

              at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

              at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

              at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

              at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:161)

              at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:290)

              at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:45)

              at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:175)

              at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

              at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:123)

              at org.junit.runner.JUnitCore.run(JUnitCore.java:157)

              at org.junit.runner.JUnitCore.run(JUnitCore.java:136)

              at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:65)

              at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:160)

              at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:126)

              at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:90)

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)

              at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877)

              at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594)

              at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)

              at java.lang.Thread.run(Thread.java:662)

          Caused by: java.lang.NullPointerException

              at org.jboss.jsfunit.arquillian.container.JSFUnitSessionFactory.findJSFSession(JSFUnitSessionFactory.java:85)

              at org.jboss.jsfunit.arquillian.container.JSFUnitSessionFactory.getJSFServerSession(JSFUnitSessionFactory.java:70)

              at org.jboss.jsfunit.arquillian.container.JSFUnitTestEnricher.resolve(JSFUnitTestEnricher.java:84)

              ... 82 more

          • 2. Re: Tomcat + Arquillian issue
            balteo

            Hello Vineet,

             

            Yes I do run the tests using the mvn command from a terminal. I get this:

            ************************

            Tests in error:

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

            ************************

             

            All test using ISO-8859-1 encoding.

             

            It is odd we don't get the same error...

             

            Julien.