You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Nicole Luneburg <Ni...@lisasoft.com> on 2008/12/22 05:53:39 UTC

Missing service name parameter [Cactus_Service] in HTTP request

Hi all!

I've trawled the net and this mailing list but nothing has fixed my problem :(
(worst part is I've done this before and tried to replicate everything, but still getting this error!!!)

I downloaded the latest stable cactus version (1.8.0), wrote my tests and tried to run it via my browser with the following URL:
http://localhost:8080/myapp/ServletTestRunner?suite=com.mylocation.myapp.testsuite.MyTestSuite

Before I go to that URL, I deploy my application .ear file to JBoss 4.2.2.GA.
Then I cactify my war and deploy that.

But getting the following errors:

2008-12-22 15:10:36,991 DEBUG [httpclient.wire.header] >> "GET /myapp/ServletRedirectorSecure?Cactus_TestMethod=testGetUserString&Cactus_TestClass=com.mylocation.myapp.ejb.service.MyServiceTest&Cactus_AutomaticSession=true&Cactus_Service=CALL_TEST HTTP/1.1[\r][\n]"
2008-12-22 15:10:36,991 DEBUG [httpclient.wire.header] >> "Content-type: application/x-www-form-urlencoded[\r][\n]"
2008-12-22 15:10:36,991 DEBUG [httpclient.wire.header] >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
2008-12-22 15:10:36,991 DEBUG [httpclient.wire.header] >> "Host: localhost:8080[\r][\n]"
2008-12-22 15:10:36,991 DEBUG [httpclient.wire.header] >> "Cookie: $Version=0; JSESSIONID=E0EAA9222721451CC15074F331AA0616[\r][\n]"
2008-12-22 15:10:36,991 DEBUG [httpclient.wire.header] >> "[\r][\n]"
2008-12-22 15:10:37,007 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/myapp].[ServletRedirectorSecure]] Servlet.service() for servlet ServletRedirectorSecure threw exception
javax.servlet.ServletException: Missing service name parameter [Cactus_Service] in HTTP request. Received query string is [null].
                at org.apache.cactus.internal.server.AbstractWebTestController.getServiceName(AbstractWebTestController.java:172)
                at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody0(AbstractWebTestController.java:82)
                at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody1$advice(AbstractWebTestController.java:225)
                at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java:1)
                at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody2(ServletTestRedirector.java:102)
                at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody3$advice(ServletTestRedirector.java:225)
                at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java:1)
                at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:73)
                at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:225)

and straight after ...

2008-12-22 15:10:37,022 ERROR [org.apache.cactus.internal.server.AbstractWebTestCaller] Error getting test result. This could happen for example if you're using a load-balancer. Please disable it before running Cactus tests.
2008-12-22 15:10:37,022 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/myapp].[ServletRedirectorSecure]] Servlet.service() for servlet ServletRedirectorSecure threw exception
javax.servlet.ServletException: Error getting test result. This could happen for example if you're using a load-balancer. Please disable it before running Cactus tests.
                at org.apache.cactus.internal.server.AbstractWebTestCaller.doGetResults(AbstractWebTestCaller.java:177)
                at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody0(AbstractWebTestController.java:99)
                at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody1$advice(AbstractWebTestController.java:225)
                at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java:1)
                at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody2(ServletTestRedirector.java:102)
                at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody3$advice(ServletTestRedirector.java:225)
                at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java:1)
                at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:73)
                at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:225)
                at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java:1)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)

Which ends up in a 500 Internal Server Error ...

To create my test war file, I do the following ant tasks ...

      <target name="test.prepare" depends="war,compile ">
        <!-- Cactify the web-app archive -->
        <cactifywar srcfile="${project.build.dir}/${project.war}" destfile="${project.build.dir}/test.war">
          <servletredirector/>
          <servletredirector name="ServletRedirectorSecure" mapping="/ServletRedirectorSecure" roles="myrole"/>
          <classes dir="${project.build.dir}/test/"/>
        </cactifywar>
      </target>

      <target name="test" depends="test.prepare"
          description="Run the tests on the defined containers">

        <!-- Run the tests -->
        <cactus warfile="${project.build.dir}/test.war" fork="yes"
            failureproperty="tests.failed">
          <classpath>
            <path refid="project.classpath"/>
            <pathelement location="${httpunit.jar}"/>
            <pathelement location="${nekohtml.jar}"/>
            <pathelement location="${target.classes.java.dir}"/>
            <pathelement location="${target.classes.cactus.dir}"/>
          </classpath>
          <containerset timeout="180000"/>
          <formatter type="brief" usefile="false"/>
          <formatter type="xml"/>
          <batchtest>
            <fileset dir="${src.cactus.dir}">
              <include name="**/Test*.java"/>
            </fileset>
          </batchtest>
        </cactus>
      </target>

Anyone any ideas?

Cheers!

________________________________
The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.