Hi Simon,
Here's the code used by the <cactus> task to find the tools.jar file:
protected final File getToolsJar()
throws FileNotFoundException
{
String javaHome = System.getProperty("java.home");
// TODO: Fix this as it fails on Max OSX (which doesn't have a
// tools.jar file).
File toolsJar = new File(javaHome + "/../lib/tools.jar");
if (!toolsJar.isFile())
{
throw new FileNotFoundException(toolsJar.getAbsolutePath());
}
return toolsJar;
}
So it means it cannot find it in [javahome]/../lib/tools.jar
Do you know where it is for you (i.e. what directory)?
Thanks
-Vincent
> -----Original Message-----
> From: Simon Gibbs [mailto:[EMAIL PROTECTED]
> Sent: 28 November 2003 15:14
> To: '[EMAIL PROTECTED]'
> Subject: "You must either set location or path on <pathelement>"
Exception
> Message
>
> I am getting an inexplicable error message regarding tools.jar. I say
> inexplicable because I have checked PATH, CLASSPATH and Eclipse prefs
to
> ensure the SDK is being used and I have also checked the SDK to see
that
> there is a tools.jar present. There is a stack trace in the output
which I
> guess is the underlying cause, but that refers to a missing atribute,
> which
> is in fact present in all cases.
>
> Has anyone else encountered and resolved this problem, or have any
> insights?
>
> I'd also be interested to know how to activate the "debug mode"
mentioned.
>
> Here is my output:
>
> [snip: vanilla war build and clean targets]
>
> cactustests:
> [mkdir] Created dir: H:\Finance\Finance
> Projects\Development\Finance
> Reporting App\tomcatProject\build\testclasses
> [javac] Compiling 2 source files to H:\Finance\Finance
> Projects\Development\Finance Reporting
App\tomcatProject\build\testclasses
> [cactifywar] Analyzing war: H:\Finance\Finance
> Projects\Development\Finance Reporting
> App\tomcatProject\build\reportingapp-undeployed.war
> [cactifywar] Building war: H:\Finance\Finance
> Projects\Development\Finance
> Reporting App\tomcatProject\build\reportingapp.war
> [cactus]
> -----------------------------------------------------------------
> [cactus] Running tests against Tomcat 4.1.29
> [cactus]
> -----------------------------------------------------------------
> [cactus] Deleting 4 files from
> C:\DOCUME~1\SIMONG~1.TRO\LOCALS~1\Temp\cactus\tomcat4x
> [cactus] Deleted 2 directories from
> C:\DOCUME~1\SIMONG~1.TRO\LOCALS~1\Temp\cactus\tomcat4x
> [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.
> ja
> va:248)
> at
>
org.apache.tools.ant.types.CommandlineJava.describeCommand(CommandlineJa
va
> .j
> ava: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.tomcat.AbstractCatalinaConta
in
> er
> .invokeBootstrap(AbstractCatalinaContainer.java:214)
> at
>
org.apache.cactus.integration.ant.container.tomcat.Tomcat4xContainer.sta
rt
> Up
> (Tomcat4xContainer.java:98)
> at
>
org.apache.cactus.integration.ant.container.ContainerRunner$1.run(Contai
ne
> rR
> unner.java:179)
> at java.lang.Thread.run(Thread.java:536)
> [cactus] BUILD FAILED: file:H:/Finance/Finance
> Projects/Development/Finance Reporting
App/tomcatProject/build.xml:139:
> Failed to start the container after more than [60000] ms. Trying to
> connect
> to the
>
[http://localhost:8080/reportingapp/ServletRedirector?Cactus_Service=RUN
_T
> ES
> T] test URL yielded a [-1] error code. Please run in debug mode for
more
> details about the error.
> Total time: 1 minute 54 seconds
>
> One of our esteemed developers seems to have encountered this error
before
> but there was no resolution:
>
>
http://www.mail-archive.com/[EMAIL PROTECTED]/msg03123.html
>
>
> Here is my build file:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <project default="makeWar" name="reportingapp">
> <property
> name="tc.home"
> location="C:\Program Files\Apache Group\Tomcat 4.1"
> />
> <property
> name="tc.webapps"
> location="${tchome}/webapps"
> />
> <property
> name="app.classes"
> location="${basedir}/build/WEB-INF/classes"
> />
> <property
> name="app.classes.tests"
> location="${basedir}/build/testclasses"
> />
> <!-- Define server libraries -->
> <fileset dir="${basedir}/lib" id="app.libs">
> <include name="*.jar" />
> <include name="*.zip" />
> <exclude name="commons-httpclient-2.0-rc2.jar" />
> <exclude name="cactus-ant-1.5.jar" />
> <exclude name="nekohtml-0.7.4.jar" />
> </fileset>
> <!-- Define the Cactus tasks -->
> <taskdef resource="cactus.tasks">
> <classpath>
> <path id="cactus.classpath">
> <pathelement
location="${basedir}/lib/cactus-1.5.jar"/>
> <pathelement
> location="${basedir}/lib/cactus-ant-1.5.jar"/>
> <pathelement
> location="${basedir}/lib/commons-httpclient-2.0-rc2.jar"/>
> <pathelement
> location="${basedir}/lib/commons-logging-1.0.3.jar"/>
> <pathelement
> location="${basedir}/lib/aspectjrt-1.1.1.jar"/>
> </path>
> </classpath>
> </taskdef>
> <target name="clean">
> <delete dir="${basedir}/build" />
> <mkdir dir="${basedir}/build" />
> </target>
> <target name="makeWar" depends="clean">
> <copy toDir="${basedir}/build" includeemptydirs="yes" >
> <fileset dir="${basedir}/websrc">
> <include name="**/*" />
> </fileset>
> </copy>
> <parallel>
> <copy toDir="${basedir}/build/WEB-INF/lib" >
>
> <fileset refid="app.libs" />
> </copy>
> <javac
> fork="true"
> debug="on"
> srcdir="${basedir}/javasrc"
> destdir="${app.classes}" >
> <classpath >
> <fileset refid="app.libs" />
> <filelist
>
dir="${tc.home}/common/lib"
> files="servlet.jar"
> />
> </classpath>
> </javac>
> </parallel>
> <copy
>
> file="javasrc\com\virginmobile\reportingapp\helpers\taxoTemplate.html"
>
> tofile="${basedir}/build/WEB-
> INF/classes/com/virginmobile/reportingapp/helpe
> rs/taxoTemplate.html"
> />
> <war
> compress="no"
>
> destfile="${basedir}/build/reportingapp-undeployed.war"
> webxml="${basedir}/websrc/WEB-INF/web.xml" >
> <fileset dir="${basedir}/build">
> <include name="**/*" />
> <exclude name="**/web.xml" />
> </fileset>
> </war>
> </target>
>
> <target name="cactustests" depends="makeWar">
> <mkdir dir="${basedir}/build/testclasses" />
> <javac
> fork="true"
> debug="on"
> srcdir="${basedir}/testsrc"
> destdir="${basedir}/build/testclasses" >
> <classpath >
> <pathelement location="${app.classes}"/>
> <fileset refid="app.libs" />
> <filelist
> dir="${tc.home}/common/lib"
> files="servlet.jar"
> />
> </classpath>
> </javac>
> <cactifywar
>
> srcfile="${basedir}/build/reportingapp-undeployed.war"
> destfile="${basedir}/build/reportingapp.war" >
> <classes
> dir="${app.classes.tests}"
> includes="**/*.class"
> />
> </cactifywar>
> <cactus
> printsummary="yes"
> warfile="${basedir}/build/reportingapp.war"
> >
> <classpath>
> <path refid="cactus.classpath" />
> <fileset dir="${app.classes}" />
> </classpath>
> <containerset timeout="60000">
> <tomcat4x
> dir="${tc.home}"
> output="${basedir}/tomcat4x.out"
> todir="${basedir}/tomcat4x"
> serverxml="${basedir}/server.xml"
> />
> </containerset>
> <formatter type="xml" />
> <batchtest>
> <fileset dir="${basedir}/testsrc">
> <include name="**/*Tests.java" />
> </fileset>
> </batchtest>
> </cactus>
> </target>
> </project>
>
>
> Simon Gibbs
> Project Support
> * 07866 741 461 * x5849
> * [EMAIL PROTECTED]
> * http://www.simongibbs.co.uk/
>
>
> --
> IMPORTANT
> The contents of this email (and any attachment):
> (1) are confidential and may be legally privileged - if it is not
meant
> for
> you, please tell the sender, do not forward or copy the contents
> and delete it from your system immediately;
> (2) come from its author and may not necessarily reflect the opinions
> of Virgin Mobile.
> While emails and attachments are virus checked,
> we cannot accept any liability in respect of any viruses.
> We may monitor emails sent to Virgin Mobile.
>
> Want to know more about Virgin Mobile?
> Visit our website for the latest info, phones and special offers
> http://www.virgin.com/mobile
>
> Virgin Mobile Telecoms Ltd
>
> ---------------------------------------------------------------------
> 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]