Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 05-24-2006, 04:31 AM   #1
Registered: Aug 2004
Location: The Netherlands
Distribution: RedHat 2, 3, 4, 5, Fedora, SuSE, Gentoo
Posts: 372

Rep: Reputation: 42
ant for tomcat5 on FC5, problems with classpath/jar files


I have a clean FC5 install, with tomcat5 and ant installed, just to get to know it...

I have a clean build.xml which includes these statements:
  <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"/>
When I run ant, it fails with this message:
$ ant
Buildfile: build.xml

/home/anteater/swdevel/myform/build.xml:146: taskdef class org.apache.catalina.ant.DeployTask cannot be found

Total time: 0 seconds
I have copied /usr/share/java/catalina-ant5.jar to /usr/share/ant/lib/catalina-ant.jar, as described on sites which tell about build.xml.

when running ant -diagnostics, I get, the following:
Apache Ant version 1.6.5 compiled on March 6 2006

 Implementation Version (JDK1.2+ only)
core tasks     : 1.6.5
optional tasks : 1.6.5

 ANT_HOME/lib jar listing
ant.home: /usr/share/ant
catalina-ant.jar (26592 bytes)                <-- so it finds the jar alright

 Tasks availability
image : Not Available
wlrun : Not Available
ddcreator : Not Available
vajload : Not Available
rexec : Not Available
wlstop : Not Available
ftp : Not Available
netrexxc : Not Available
starteam : Not Available
stcheckin : Not Available
stylebook : Not Available
splash : Not Available
stlabel : Not Available
vajexport : Not Available
stcheckout : Not Available
ejbc : Not Available
telnet : Not Available
vajimport : Not Available
stlist : Not Available
sound : Not Available
icontract : Not Available

 org.apache.env.Which diagnostics
Not available.
Download it at

 XML Parser information
XML Parser : org.apache.xerces.jaxp.SAXParserImpl
XML Parser Location: /usr/share/java/jaxp_parser_impl.jar

 System properties
ant.library.dir : /usr/share/ant/lib
path.separator : : : GNU libgcj : Java(tm) Virtual Machine Specification
java.runtime.version : 1.4.2
java.home : /usr/lib/jvm/java-1.4.2-gcj-
java.vm.specification.version : 1.0
line.separator :

java.vm.specification.vendor : Sun Microsystems Inc.
gnu.classpath.home.url : file:///usr/lib
gnu.classpath.version : 0.20-pre
gnu.gcj.progname :
java.specification.version : 1.4
java.library.path : /usr/lib/jvm/java-1.4.2-gcj-
gnu.classpath.vm.shortname : libgcj
java.class.version : 46.0 : Java(tm) Platform API Specification
os.version : 2.6.16-1.2111_FC5
gnu.classpath.home : /usr
user.home : /home/anteater
file.encoding : UTF-8
ant.home : /usr/share/ant : Linux : anteater
java.class.path : /usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:/usr/share/java/antlr.jar:/usr/share/java/ant/ant-antlr.jar:/usr/share/java/bcel.jar:/usr/share/java/ant/ant-apache-bcel.jar:/usr/share/java/bsf.jar:/usr/share/java/ant/ant-apache-bsf.jar:/usr/share/java/log4j.jar:/usr/share/java/ant/ant-apache-log4j.jar:/usr/share/java/oro.jar:/usr/share/java/ant/ant-apache-oro.jar:/usr/share/java/regexp.jar:/usr/share/java/ant/ant-apache-regexp.jar:/usr/share/java/xml-commons-resolver.jar:/usr/share/java/ant/ant-apache-resolver.jar:/usr/share/java/jakarta-commons-logging.jar:/usr/share/java/ant/ant-commons-logging.jar:/usr/share/java/javamail/mailapi-1.3.1.jar:/usr/share/java/javamail/providers-1.3.1.jar:/usr/share/java/jaf.jar:/usr/share/java/ant/ant-javamail.jar:/usr/share/java/jdepend.jar:/usr/share/java/ant/ant-jdepend.jar:/usr/share/java/jsch.jar:/usr/share/java/ant/ant-jsch.jar:/usr/share/java/junit.jar:/usr/share/java/ant/ant-junit.jar:/usr/share/java/ant/ant-nodeps.jar:/usr/share/java/ant/ant-swing.jar:/usr/share/java/jaxp_transform_impl.jar:/usr/share/java/ant/ant-trax.jar:/usr/lib/jvm/java/lib/tools.jar:/usr/share/ant/lib/catalina-ant.jar : /tmp
os.arch : i386
java.fullversion : GNU libgcj 4.1.0 20060304 (Red Hat 4.1.0-3)
user.language : en
java.specification.vendor : Sun Microsystems Inc.
user.dir : /home/anteater/swdevel/myform : GNU libgcj 4.1.0 20060304 (Red Hat 4.1.0-3)
java.version : 1.4.2
java.ext.dirs : /usr/lib/jvm/java-1.4.2-gcj-
sun.boot.class.path : /usr/lib/jvm/java-1.4.2-gcj-
java.vendor : Free Software Foundation, Inc.
java.vendor.url :
java.vm.vendor : Free Software Foundation, Inc.
file.separator : /
java.vm.version : 4.1.0 20060304 (Red Hat 4.1.0-3)
http.agent : gnu-classpath/0.20-pre (libgcj/4.1.0 20060304 (Red Hat 4.1.0-3))
gnu.cpu.endian : little
gnu.gcj.precompiled.db.path : /usr/lib/gcj-4.1.0/classmap.db
user.region : US
gnu.gcj.runtime.endorsed.dirs : /usr/share/java/gcj-endorsed
At the last position is the catalina-ant.jar, which tells me it is in the classpath. yet ant doesn't seem to be able to find it.

unzipping the jar in /usr/share/ant/lib doesn't fix it either.
THOUGH, unzipping the jar file AND putting the 'classpath="/usr/share/ant/lib"' property in the build.xml at the taskdefs make ant DO find the classes...

This would tell me that either ant doesn't, or isn't ABLE to descend into jar files, AND it doesn't, by default, find the correct path to the jar file.

so in short,
unzipping catalina-ant.jar in /usr/share/ant/lib, as well as adding the property 'classpath="/usr/share/ant/lib"' to the taskdef definitions makes ant do find the classes required.

Why is ant showing this behaviour is my question.... ???

If anyone can help out on this, I'd be very grateful..
Do I have to set an additional classpath in my environment?
Do I have to enable an option for ant to descend into jar files??

Thanks in advance...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
jar files Knowledgements Slackware 12 07-22-2005 03:36 AM
Fedora Core 1 Associating .jar files with java -jar command pymehta Fedora 0 01-13-2005 05:26 AM
What do i do with .jar files joeman3429 Fedora 11 07-26-2004 11:00 AM
How to make executetable jar file? if not setting the classpath? antony_csf General 1 07-01-2004 03:11 AM
jar files mlynch147 Programming 2 10-24-2001 07:11 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:43 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration