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 ha...@informatiefabriek.nl on 2004/01/27 12:05:56 UTC

problem running cactus from ant

Hi all,

I have the following targets in my Ant build file:

<target name="ear.cactify">

    <taskdef resource="cactus.tasks">
      <classpath>
        <fileset dir="${lib.dir}">
                <include name="*.jar"/>
        </fileset>
      </classpath>
    </taskdef>

    <cactifywar version="2.3" destfile="${dist.dir}/cactus.war"
        mergewebxml="${depl.desc.dir}/cactus/web.xml">
      <classes dir="${build.class.dir}">
        <include name="**/*Test.class"/>
      </classes>
    </cactifywar>
    <echo message="hiero"/> 

    <ear update="true" destfile="${dist.dir}/${ear.name}"
        appxml="${depl.desc.dir}/cactus/application.xml">
      <fileset dir="${dist.dir}">
        <include name="cactus.war"/>
      </fileset>
    </ear>
 
</target>

<target name="test" depends="ear.cactify">

    <cactus earfile="${dist.dir}/${ear.name}" fork="yes" 
        printsummary="yes" haltonerror="true" 
        haltonfailure="true">
      <containerset>
        <jboss3x dir="${jboss.dist.dir}" 
            output="jbossresult.txt"/>
      </containerset>
      <formatter type="brief" usefile="false"/>
      <test name=
"nl.informatiefabriek.mtb.persistence.mapping.MappingTest"/>
 
      <classpath>
        <pathelement location="${build.class.dir}"/>
      </classpath>
    </cactus>
</target>

When I run the 'test' target I get the following exception:

test:
   [cactus] 
-----------------------------------------------------------------
   [cactus] Running tests against JBoss 3.2.3
   [cactus] 
-----------------------------------------------------------------
   [cactus] Couldn't find tools.jar (needed for JSP compilation)
You must either set location or path on <pathelement>
at org.apache.tools.ant.types.Path.list(Path.java:309)
at org.apache.tools.ant.types.Path.list(Path.java:320)
at org.apache.tools.ant.types.Path.addExisting(Path.java:260)
at org.apache.tools.ant.types.Path.concatSystemClasspath(Path.java:551)
at 
org.apache.tools.ant.types.CommandlineJava.size(CommandlineJava.java:346)
at 
org.apache.tools.ant.types.CommandlineJava.getCommandline(CommandlineJava.java:248)
at 
org.apache.tools.ant.types.CommandlineJava.describeCommand(CommandlineJava.java:311)
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:138)
at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
at 
org.apache.cactus.integration.ant.container.jboss.JBoss3xContainer.startUp(JBoss3xContainer.java:232)
at 
org.apache.cactus.integration.ant.container.ContainerRunner$1.run(ContainerRunner.java:179)
at java.lang.Thread.run(Unknown Source)
BUILD FAILED: 
file:C:/eclipse/eclipse/workspace/mtb_persistence_framework/src/build/cactus/build.xml:56: 
Failed to start the container after more than [180000] ms. Trying to 
connect to the 
[http://localhost:8080/test/ServletRedirector?Cactus_Service=RUN_TEST] 
test URL yielded a [-1] error code. Please run in debug mode for more 
details about the error.
Total time: 3 minutes 4 seconds

I run ant from Eclipse (and tools.jar).

Can somebody please help me to get me going with Cactus?

Thanks,

Regards,

Harm de Laat
Informatiefabriek
The Netherlands

Re: problem running cactus from ant

Posted by PUTHENVILA P Johnson <PJ...@qtech.com.au>.
Hi ,

Please try this one,
Add tools.jar to Ant runtime.  Windows=> preference=>Ant=>Runtime add 
tools.jar  which one eclipse using, if the versions of JDK is different it 
will cause someoher problem.
if you want to use JUNIT form Ant script add JUnit.jar also to this 
runtime.
Hope this may help, best of  luck.



harm@informatiefabriek.nl 
27/01/2004 09:05 PM
Please respond to
"Cactus Users List" <ca...@jakarta.apache.org>


To
cactus-user@jakarta.apache.org
cc

Subject
problem running cactus from ant






Hi all,

I have the following targets in my Ant build file:

<target name="ear.cactify">

    <taskdef resource="cactus.tasks">
      <classpath>
        <fileset dir="${lib.dir}">
                <include name="*.jar"/>
        </fileset>
      </classpath>
    </taskdef>

    <cactifywar version="2.3" destfile="${dist.dir}/cactus.war"
        mergewebxml="${depl.desc.dir}/cactus/web.xml">
      <classes dir="${build.class.dir}">
        <include name="**/*Test.class"/>
      </classes>
    </cactifywar>
    <echo message="hiero"/> 

    <ear update="true" destfile="${dist.dir}/${ear.name}"
        appxml="${depl.desc.dir}/cactus/application.xml">
      <fileset dir="${dist.dir}">
        <include name="cactus.war"/>
      </fileset>
    </ear>
 
</target>

<target name="test" depends="ear.cactify">

    <cactus earfile="${dist.dir}/${ear.name}" fork="yes" 
        printsummary="yes" haltonerror="true" 
        haltonfailure="true">
      <containerset>
        <jboss3x dir="${jboss.dist.dir}" 
            output="jbossresult.txt"/>
      </containerset>
      <formatter type="brief" usefile="false"/>
      <test name=
"nl.informatiefabriek.mtb.persistence.mapping.MappingTest"/>
 
      <classpath>
        <pathelement location="${build.class.dir}"/>
      </classpath>
    </cactus>
</target>

When I run the 'test' target I get the following exception:

test:
   [cactus] 
-----------------------------------------------------------------
   [cactus] Running tests against JBoss 3.2.3
   [cactus] 
-----------------------------------------------------------------
   [cactus] Couldn't find tools.jar (needed for JSP compilation)
You must either set location or path on <pathelement>
at org.apache.tools.ant.types.Path.list(Path.java:309)
at org.apache.tools.ant.types.Path.list(Path.java:320)
at org.apache.tools.ant.types.Path.addExisting(Path.java:260)
at org.apache.tools.ant.types.Path.concatSystemClasspath(Path.java:551)
at 
org.apache.tools.ant.types.CommandlineJava.size(CommandlineJava.java:346)
at 
org.apache.tools.ant.types.CommandlineJava.getCommandline(CommandlineJava.java:248)
at 
org.apache.tools.ant.types.CommandlineJava.describeCommand(CommandlineJava.java:311)
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:138)
at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
at 
org.apache.cactus.integration.ant.container.jboss.JBoss3xContainer.startUp(JBoss3xContainer.java:232)
at 
org.apache.cactus.integration.ant.container.ContainerRunner$1.run(ContainerRunner.java:179)
at java.lang.Thread.run(Unknown Source)
BUILD FAILED: 
file:C:/eclipse/eclipse/workspace/mtb_persistence_framework/src/build/cactus/build.xml:56: 

Failed to start the container after more than [180000] ms. Trying to 
connect to the 
[http://localhost:8080/test/ServletRedirector?Cactus_Service=RUN_TEST] 
test URL yielded a [-1] error code. Please run in debug mode for more 
details about the error.
Total time: 3 minutes 4 seconds

I run ant from Eclipse (and tools.jar).

Can somebody please help me to get me going with Cactus?

Thanks,

Regards,

Harm de Laat
Informatiefabriek
The Netherlands


RE: problem running cactus from ant

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Harm,

Yes, this is a known problem (there's even a bug report against it:
http://issues.apache.org/bugzilla/show_bug.cgi?id=25072).

The problem is in the way we look for tools.jar to add to the classpath.
Here's the code:

    protected final File getToolsJar() throws FileNotFoundException
    {
        String javaHome = System.getProperty("java.home"); 
        File toolsJar = new File(javaHome, "../lib/tools.jar");
        if (!toolsJar.isFile())
        {
            throw new FileNotFoundException(toolsJar.getAbsolutePath());
        }
        return toolsJar;
    }   

Thus if tools.jar is not in java.home/lib/tools.jar you get the error.

Do you know where it is located when using Eclipse? Could you find out?

Thanks
-Vincent


> -----Original Message-----
> From: harm@informatiefabriek.nl [mailto:harm@informatiefabriek.nl]
> Sent: 27 January 2004 12:06
> To: cactus-user@jakarta.apache.org
> Subject: problem running cactus from ant
> 
> Hi all,
> 
> I have the following targets in my Ant build file:
> 
> <target name="ear.cactify">
> 
>     <taskdef resource="cactus.tasks">
>       <classpath>
>         <fileset dir="${lib.dir}">
>                 <include name="*.jar"/>
>         </fileset>
>       </classpath>
>     </taskdef>
> 
>     <cactifywar version="2.3" destfile="${dist.dir}/cactus.war"
>         mergewebxml="${depl.desc.dir}/cactus/web.xml">
>       <classes dir="${build.class.dir}">
>         <include name="**/*Test.class"/>
>       </classes>
>     </cactifywar>
>     <echo message="hiero"/>
> 
>     <ear update="true" destfile="${dist.dir}/${ear.name}"
>         appxml="${depl.desc.dir}/cactus/application.xml">
>       <fileset dir="${dist.dir}">
>         <include name="cactus.war"/>
>       </fileset>
>     </ear>
> 
> </target>
> 
> <target name="test" depends="ear.cactify">
> 
>     <cactus earfile="${dist.dir}/${ear.name}" fork="yes"
>         printsummary="yes" haltonerror="true"
>         haltonfailure="true">
>       <containerset>
>         <jboss3x dir="${jboss.dist.dir}"
>             output="jbossresult.txt"/>
>       </containerset>
>       <formatter type="brief" usefile="false"/>
>       <test name=
> "nl.informatiefabriek.mtb.persistence.mapping.MappingTest"/>
> 
>       <classpath>
>         <pathelement location="${build.class.dir}"/>
>       </classpath>
>     </cactus>
> </target>
> 
> When I run the 'test' target I get the following exception:
> 
> test:
>    [cactus]
> -----------------------------------------------------------------
>    [cactus] Running tests against JBoss 3.2.3
>    [cactus]
> -----------------------------------------------------------------
>    [cactus] Couldn't find tools.jar (needed for JSP compilation)
> You must either set location or path on <pathelement>
> at org.apache.tools.ant.types.Path.list(Path.java:309)
> at org.apache.tools.ant.types.Path.list(Path.java:320)
> at org.apache.tools.ant.types.Path.addExisting(Path.java:260)
> at
org.apache.tools.ant.types.Path.concatSystemClasspath(Path.java:551)
> at
>
org.apache.tools.ant.types.CommandlineJava.size(CommandlineJava.java:346
)
> at
>
org.apache.tools.ant.types.CommandlineJava.getCommandline(CommandlineJav
a.
> java:248)
> at
>
org.apache.tools.ant.types.CommandlineJava.describeCommand(CommandlineJa
va
> .java:311)
> at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:138)
> at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
> at
>
org.apache.cactus.integration.ant.container.jboss.JBoss3xContainer.start
Up
> (JBoss3xContainer.java:232)
> at
>
org.apache.cactus.integration.ant.container.ContainerRunner$1.run(Contai
ne
> rRunner.java:179)
> at java.lang.Thread.run(Unknown Source)
> BUILD FAILED:
>
file:C:/eclipse/eclipse/workspace/mtb_persistence_framework/src/build/ca
ct
> us/build.xml:56:
> Failed to start the container after more than [180000] ms. Trying to
> connect to the
> [http://localhost:8080/test/ServletRedirector?Cactus_Service=RUN_TEST]
> test URL yielded a [-1] error code. Please run in debug mode for more
> details about the error.
> Total time: 3 minutes 4 seconds
> 
> I run ant from Eclipse (and tools.jar).
> 
> Can somebody please help me to get me going with Cactus?
> 
> Thanks,
> 
> Regards,
> 
> Harm de Laat
> Informatiefabriek
> The Netherlands