LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

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

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


Hi,

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:
Code:
  <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:
Code:
$ ant
Buildfile: build.xml

BUILD FAILED
/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:
Code:
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 http://xml.apache.org/commons/

-------------------------------------------
 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 : :
java.vm.name : GNU libgcj
java.vm.specification.name : Java(tm) Virtual Machine Specification
java.runtime.version : 1.4.2
java.home : /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
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 : org.apache.tools.ant.launch.Launcher
java.specification.version : 1.4
java.library.path : /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/i386
gnu.classpath.vm.shortname : libgcj
java.class.version : 46.0
java.specification.name : 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
os.name : Linux
user.name : 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
java.io.tmpdir : /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
java.vm.info : 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-1.4.2.0/jre/lib/ext
sun.boot.class.path : /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/rt.jar
java.vendor : Free Software Foundation, Inc.
java.vendor.url : http://gcc.gnu.org/java/
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...
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are 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


All times are GMT -5. The time now is 11:46 AM.

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