Hi there,

I am trying to run Cactus framework with servlet 2.4. especification.

Since most of the problems with the new especification have to do with the
parsing and verification made in the warcactification and cactus tasks, I
have used the runservertests task.

I am using as well an unpacked web application referenced in a context.xml
file in conf/catalina/localhost.

I have written a very simple test, and it works if I run a junit task like
this:

<target name="testCactus" depends="clean_testCactus" >
        <mkdir dir="${testCactus.reports.dir}"/>
        <junit printsummary="false" haltonerror="false"
haltonfailure="false"
               fork="${junit.fork}"
               errorproperty="testCactus.failed"
               failureproperty="testCactus.failed"
            >
            <formatter type="plain" usefile="false" />
            <formatter type="xml" />
            <classpath>
                <pathelement path="${testCactus.path}"/>
                <pathelement location="${log4j.jar}" />
            </classpath>
            <assertions>
                <enable package="com.espivo.vivoen"/>
            </assertions>
            <batchtest todir="${testCactus.reports.dir}" unless="testClass"
>
               <fileset dir="${testCactus.build.class.dir}"
includes="**/*Test.class" />
            </batchtest>
        </junit>
        <fail if="testCactus.failed">At least one test failed after making
report!</fail>
    </target>

So no problem with client o server classpaths.

The problem is with the tasks to start and to stop Tomcat (5.0.28). If
Tomcat is started, I get a couple of exceptions related with jar
deployments, and then I enter in a loop getting once and again the index.jsp
of my cactified web application.

If Tomcat is not running, I get a NullPointerException:

Caused by: java.lang.NullPointerException
        at org.apache.catalina.startup.Catalina.await(Catalina.java:619)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:579)
        ... 6 more

My tasks for starting and stopping Tomcat are quite standard :

<target name="run_testCactus" depends="new_contextCactus"
            description="coordina la ejecucion de tests, y el arranque y
parada de Tomcat">
        <runservertests
            testurl="${cactus.contextURL}"
[http://localhost:${tomcat.cactus.port}/${tomcat.cactus.url]
            starttarget="start.tomcat5"
            stoptarget="stop.tomcat5"
            testtarget="testCactus"/>
    </target>

<target name="start.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="${tomcat.context.dir}/${tomcat.cactus.url}.xml"/>
[Context file in conf/Catalina/localhost]
            <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="${tomcat.context.dir}/${tomcat.cactus.url}.xml"/>
            <arg value="stop"/>
            <classpath>
              <pathelement path="${java_comp.path}"/>
              <fileset dir="${env.CATALINA_HOME}">
                  <include name="bin/bootstrap.jar"/>
              </fileset>
            </classpath>
        </java>


Any help is wellcome.
Regards,

Pedro Nevado



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

Reply via email to