David,

I do not use server.xml for my datasource connection: you can define it in a
context.xml file (ROOT.xml, p.e); so you do not need to change your
server.xml, or work with an ad-hoc server.xml, either.

The URL I use for see test results in my browser is something like:

http://localhost:8080/mycontext/ServletTestRunner?suite=com.myclassactiontes
t.

In case you may find it useful, this is my ant script:

<!-- ======================================================= -->
    <!-- TARGETS: RUN CACTUS TESTS                               -->
    <!-- ======================================================= -->
    <!-- ......... Cactus taskdef ............-->
    <taskdef name="runservertests"
classname="org.apache.cactus.integration.ant.RunServerTestsTask"
             classpathref="cactus.tasks.path"/>

    <target name="run_tests" depends="new_context">
        <runservertests
            testurl="${cactus.contextURL}"
            starttarget="start.tomcat5"
            stoptarget="stop.tomcat5"
            testtarget="testCactus"/>
    </target>

    <target name="testCactus" depends="clean_reports">
        <mkdir dir="${tests.reports.dir}"/>
        <junit printsummary="false" haltonerror="false"
haltonfailure="false"
               fork="${junit.fork}"
               errorproperty="test.failed"
               failureproperty="test.failed"
            >
            <formatter type="plain" usefile="false" />
            <formatter type="xml" />
            <classpath>
                <pathelement path="${web_comp.path}"/>
                <pathelement location="${junit.jar}"/>
                <pathelement location="${httpclient.jar}"/>
                <pathelement location="${cactus.jar}"/>
                <pathelement location="${cactus_ant.jar}"/>
                <pathelement location="${aspectjrt.jar}"/>
                <pathelement location="${httpunit.jar}"/>
                <pathelement location="${nekohtml.jar}"/>
                <pathelement location="${tidy.jar}"/>
            </classpath>
            <batchtest todir="${tests.reports.dir}" unless="testClass" >
               <fileset dir="${tests.class.dir}"  includes="**/*Test.class"
/>
            </batchtest>
        </junit>
        <junitreport todir="${tests.reports.dir}">
            <fileset dir="${tests.reports.dir}" includes="TEST-*.xml"/>
            <report todir="${tests.reports.dir}/html" format="frames"/>
        </junitreport>
        <fail if="test.failed">At least one test failed after making
report!</fail>
    </target>

    <target name="start.tomcat5">
        <java classname="org.apache.catalina.startup.Bootstrap"
            failonerror="yes" fork="true">
            <jvmarg value="-Dcatalina.home=${env.CATALINA_HOME}"/>
            <jvmarg value="-Dcatalina.base=${env.CATALINA_HOME}"/>
            <arg value="-config"/>
            <arg value="${env.CATALINA_HOME}/conf/server.xml"/>
            <arg value="start"/>
            <classpath>
              <pathelement path="${java_comp.path}"/>
              <fileset dir="${env.CATALINA_HOME}"
includes="bin/bootstrap.jar"/>
            </classpath>
        </java>
    </target>
    <target name="stop.tomcat5">
        <java classname="org.apache.catalina.startup.Bootstrap" fork="yes">
            <jvmarg value="-Dcatalina.home=${env.CATALINA_HOME}"/>
            <jvmarg value="-Dcatalina.base=${env.CATALINA_HOME}"/>
            <arg value="-config"/>
            <arg value="${env.CATALINA_HOME}/conf/server.xml"/>
            <arg value="stop"/>
            <classpath>
              <pathelement path="${java_comp.path}"/>
              <fileset dir="${env.CATALINA_HOME}">
                  <include name="bin/bootstrap.jar"/>
              </fileset>
            </classpath>
        </java>
    </target>

-----Mensaje original-----
De: David Turley [mailto:[EMAIL PROTECTED]
Enviado el: martes, 16 de agosto de 2005 16:33
Para: Cactus Users List
Asunto: Re: ServletRedirector context


Update:

In the cactus ant task, I was specifying a server.xml file instead of
using the default.  I did this because if I don't, I get the following
complaint:

   [cactus] java.lang.RuntimeException: Exception looking up data
source: Name jdbc is not bound in this Context

But then the test redirectors initialize correctly and everything.  It's
as if I have a choice between my jdbc connection and the test
redirectors working.  What do I need to do to get both to work?  By the
way, where is the "default" server.xml located?  The server.xml I
specify is in TOMCAT_HOME/conf/...  At first I thought that would be the
default, but apparently not.

Once again, any help on this would be appreciated.  The lack of help
thusfar has been discouraging, but I understand that you all have your
own lives and your own projects and don't give a rats behind about my
project ;-).

Thanks,
David


David Turley wrote:

> Correction:
> "I have tried to browse to that location and I get 404'd.  If I browse
> to
> http://localhost:8081/app/ServletRedirector?Cactus_Service=RUN_TEST,
> however, I get a blank page. "  I meant when I browse to
> http://localhost:8081/ServletRedirector?Cactus_Service=RUN_TEST, which
> lacks the /app, which is the context my application runs under.
>
> David Turley wrote:
>
>> More information about the problem:
>>
>> When trying to run the ant cactus task with ant debug mode on, after
>> the Tomcat starts up, I get the following repeatedly until it times out.
>>
>>   [cactus] Checking if server is up ...
>>   [cactus] Failed to connect to
>> [http://localhost:8081/app/ServletRedirector?Cactus_Service=RUN_TEST]
>> (Connection refused)
>>
>> Then I get the timeout message:
>> Failed to start the container after more than [180000] ms. Trying to
>> connect to the
>> [http://localhost:8081/app/ServletRedirector?Cactus_Service=RUN_TEST]
>> test URL yielded a [-1] error code. Please run in debug mode for more
>> details about the error.
>>
>> I have tried to browse to that location and I get 404'd.  If I browse
>> to
>> http://localhost:8081/app/ServletRedirector?Cactus_Service=RUN_TEST,
>> however, I get a blank page.
>>
>> I turned on cactus logging but didn't see anything new about the error.
>>
>> Anyone have any clues for me?  Do you need more information to help
>> me?  Let me know.
>>
>> Thanks,
>> David Turley
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to