Hi Robert -
I'm not sure why having the the catalina-ant.jar in your ant libs folder didn't work, but here's an extract from my build.xml, which works for me. (obviously you need to set $tomcat.home somewhere - I tend to do it in a properties file which I DON'T commit to my SCM repos, as it tends to change from development machine to development machine)
<path id="tomcat.classpath"> <fileset dir="${tomcat.home}/server/lib" includes="catalina-ant.jar" /> </path> <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"> <classpath refid="tomcat.classpath" /> </taskdef>
best
Tim
Robert Sinner wrote:
I am sending this message as it was bounced back to me I apologize if for some reason you receive it twice.
I am trying to install tomcat on red hat enterprise server 8 with ant and apache. However when trying to run ant (to compile a simple servlet I get the following error).
Using the simple build file I get the following error trying to run the ant. I have searched everything I could find on google, and almost certain it’s a classpath issue, however I have tried to alter the classpath in several ways to make what I think are the appropriate jars visible and I am at a loss.
The error is …/build.xml:146: taskdef class org.apache.catalina.ant.DeployTask cannot be found
I have installed the following
Apache/2.0.46 – already in place
Jdk1.5.0-03 tar
Tomcat 5.5.9 tar
mod_jk 1.2.10 – built so and placed under apache shared objects
Also installed ant version 1.6.3
CATALINA_HOME=/usr/local/jakarta-tomcat ANT_HOME=/usr/local/apache-ant-1.6.3 JAVA_HOME=/usr/java/jdk1.5.0_03"
I have already copied the catalina-ant jar from $CATALINA_HOME/server/lib to $ANT_HOME/lib, I also tried copying the catalina-deployer.jar from the tomcat deployer into the same location.
If I comment out the taskdefs in the build.xml I can get ant to build.
Here are the lines that are causing failure in to build.xml
<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"/> <taskdef name="list" classname="org.apache.catalina.ant.ListTask"/> <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"/> <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"/>
…
If I comment them out then I can run ant. However in order to allow them to be there I have tried several things, like copying catalina-ant.jar to $ANT_HOME/lib and placing it in the classpath environment variable also I tried adding classpath element to each of these tasks, like
<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"> <classpath> <pathelement location="/usr/local/apache-ant-1.6.3/lib/catalina-ant.jar"/> <pathelement location="/usr/local/apache-ant-1.6.3/lib/catalina-deployer.jar"/> </classpath> </taskdef>
However the error persists, as I mentioned I googled this and found that I should just copy the Catalina-ant.jar and Catalina-deployer.jar to apache lib directory however this is not solving my problem.
Thanks in advance for any help, RS
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]