I don't know if this is an Ant problem or an Eclipse problem, but I thought I'd start here. As background, a web app project got dumped into my lap when it was abruptly un-outsourced when the consultants walked off in a huff. They are emphatically not available for questions. The app was developed under using Eclipse and Java 5 to run under Tomcat. There are many, many problems but the one right now is getting the project set up under my copy of Eclipse. I followed their instructions up to the point where I attempt the Ant Build, and I get the following:
C:\Java\PGME\build\build.xml:208: taskdef class org.apache.catalina.ant.InstallTask cannot be found
Looking at build.xml in Eclipse I see that it will also fail to find ReloadTask, ListTask, StartTask, and StopTask. All of those classes are present in catalina-ant.jar, so the jar file must not be in the expected location. Here's a fragment of build.xml:
C:\Program Files\apache-ant-1.8.2 (I installed that this afternoon, previously trying 1.6.5)
I copied catalina-ant.jar to the lib folder of both 1.8.2 and 1.6.5.
C:\Program Files\Apache Software Foundation\jakarta-tomcat-5.0.28
.;C:\orion\orion.jar;C:\Program Files\Java\jdk1.5.0_12\lib\dt.jar;C:\Program Files\Java\jdk1.5.0_12\lib\tools.jar;C:\Program Files\glassfish-v2ur1\lib\javaee.jar;C:\Java;C:\Java\RanchCommon\jr.jar
I'm hoping that I'm merely making an ignorant mistake. A few months ago I was able to build the project on this computer . . . before the hard drive got blown away, taking with it the tweaks that got it "buildable" last time (and which I unfortunately didn't write down).
Eclipse, by default, uses its own ant package that's bundled as a plugin (..\eclipse\plugins\org.apache.ant_...), even if ANT_HOME environment variable is set to C:\Program Files\apache-ant-1.8.2
Check which Ant is being used from workspace Preferences > Ant > Runtime.
If you want to use the one in C:\Program Files\apache-ant-1.8.2, select that directory from "Ant home..." button. Since its \lib already contains catalina-ant.jar, it too will be included.
Alternatively, stick with eclipse's bundled ant, and add catalina-ant.jar
- either at workspace preferences level (if all ant build files in workspace require it), or add it to just the build file that requires it
- or at build file level, right click on build file > Ant build... configuration dialog > classpath.
Joined: Mar 11, 2010
Thank you very much! It's very confusing blundering around in a complex tool like Eclipse. I couldn't even find General/Preferences except by clicking on it in the help system, and I couldn't find it at the build level at all (or perhaps I failed to find the build level). The warnings remain in the display of build.xml, but in fact the build worked, the war file deployed, and the application will launch properly. Magic, perhaps?