Bug 490542 - Ant does not load antlib definitions
Ant does not load antlib definitions
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: ant (Show other bugs)
11
All Linux
low Severity medium
: ---
: ---
Assigned To: Permaine Cheung
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-16 17:55 EDT by Danny Ciarniello
Modified: 2012-10-05 15:42 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-06-28 07:29:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Build script from chapter 1 of "Harnessing Hibernate" (1.43 KB, text/xml)
2009-03-16 17:57 EDT, Danny Ciarniello
no flags Details

  None (edit)
Description Danny Ciarniello 2009-03-16 17:55:23 EDT
Description of problem:
It seems that the version of Ant that comes with Fedora 10 is not able to load antlib definition files.  When running the build script from the first chapter of "Harnessing Hibernate" (see attachment), I get this error:

Problem: failed to create task or type antlib:org.apache.maven.artifact.ant:dependencies

The Ant build taken directly from the Apache Ant web site does not have this problem.

Version-Release number of selected component (if applicable):
ant-1.7.1-7.2.fc10.x86_64


How reproducible:
Always


Steps to Reproduce:
1. Download maven-ant-tasks-2.0.9.jar from the Maven download site, http://maven.apache.org/download.html
2. Place the jar file in ~/.ant/lib
3. Run ant against the attached build script
  
Actual results:
/home/danny/dev/hibernate/build.xml:7: Problem: failed to create task or type antlib:org.apache.maven.artifact.ant:dependencies
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
No types or tasks have been defined in this namespace yet

This appears to be an antlib declaration.
Action: Check that the implementing library exists in one of:
        -/usr/share/ant/lib
        -/home/danny/.ant/lib
        -a directory added on the command line with the -lib argument


Total time: 0 seconds


Expected results:
Maven ant task downloads requisite components from the Maven repository and the HSQLDB database manager is launched.


Additional info:

Output from ant -v:
===================
Apache Ant version 1.7.1 compiled on October 1 2008
Buildfile: build.xml
Detected Java version: 1.6 in: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
Detected OS: Linux
parsing buildfile /home/danny/dev/hibernate/build.xml with URI = file:/home/danny/dev/hibernate/build.xml
Project base dir set to: /home/danny/dev/hibernate
[antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found.
[antlib:org.apache.maven.artifact.ant] Could not load definitions from resource org/apache/maven/artifact/ant/antlib.xml. It could not be found.

BUILD FAILED
/home/danny/dev/hibernate/build.xml:7: Problem: failed to create task or type antlib:org.apache.maven.artifact.ant:dependencies
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
No types or tasks have been defined in this namespace yet

This appears to be an antlib declaration.
Action: Check that the implementing library exists in one of:
        -/usr/share/ant/lib
        -/home/danny/.ant/lib
        -a directory added on the command line with the -lib argument

        at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:484)
        at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:416)
        at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160)
        at org.apache.tools.ant.Task.perform(Task.java:347)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:142)
        at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:93)
        at org.apache.tools.ant.Main.runBuild(Main.java:743)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

Total time: 0 seconds



Output from ant -diagnostics
============================
------- Ant diagnostics report -------
Apache Ant version 1.7.1 compiled on October 1 2008

-------------------------------------------
 Implementation Version
-------------------------------------------
core tasks     : 1.7.1
optional tasks : not available

-------------------------------------------
 ANT PROPERTIES
-------------------------------------------
ant.version: Apache Ant version 1.7.1 compiled on October 1 2008
ant.java.version: 1.6
ant.core.lib: /usr/share/java/ant-1.7.1.jar
ant.home: /usr/share/ant

-------------------------------------------
 ANT_HOME/lib jar listing
-------------------------------------------
ant.home: /usr/share/ant

-------------------------------------------
 USER_HOME/.ant/lib jar listing
-------------------------------------------
user.home: /home/danny
maven-ant-tasks-2.0.9.jar (1018394 bytes)

-------------------------------------------
 Tasks availability
-------------------------------------------
image : Not Available (the implementation class is not present)
sshexec : Not Available (the implementation class is not present)
wlrun : Not Available (the implementation class is not present)
scp : Not Available (the implementation class is not present)
stlist : Not Available (the implementation class is not present)
netrexxc : Not Available (the implementation class is not present)
starteam : Not Available (the implementation class is not present)
stylebook : Not Available (the implementation class is not present)
stlabel : Not Available (the implementation class is not present)
stcheckin : Not Available (the implementation class is not present)
stcheckout : Not Available (the implementation class is not present)
ejbc : Not Available (the implementation class is not present)
wlstop : Not Available (the implementation class is not present)
sound : Not Available (the implementation class is not present)
ddcreator : Not Available (the implementation class is not present)
A task being missing/unavailable should only matter if you are trying to use it

-------------------------------------------
 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/xerces-j2-2.7.1.jar
Namespace-aware parser : org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser
Namespace-aware parser Location: /usr/share/java/xerces-j2-2.7.1.jar

-------------------------------------------
 System properties
-------------------------------------------
java.runtime.name : IcedTea6 1.4 (fedora-9.b14.fc10-x86_64) Runtime Environment
sun.boot.library.path : /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64
java.vm.version : 14.0-b08
ant.library.dir : /usr/share/ant/lib
java.vm.vendor : Sun Microsystems Inc.
java.vendor.url : http://java.sun.com/
path.separator : :
java.vm.name : OpenJDK 64-Bit Server VM
file.encoding.pkg : sun.io
user.country : US
sun.java.launcher : SUN_STANDARD
sun.os.patch.level : unknown
java.vm.specification.name : Java Virtual Machine Specification
user.dir : /home/danny/dev/hibernate
java.runtime.version : 1.6.0_0-b14
java.awt.graphicsenv : sun.awt.X11GraphicsEnvironment
java.endorsed.dirs : /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/endorsed
os.arch : amd64
java.io.tmpdir : /tmp
line.separator : 

java.vm.specification.vendor : Sun Microsystems Inc.
os.name : Linux
ant.home : /usr/share/ant
sun.jnu.encoding : UTF-8
java.library.path : /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
java.specification.name : Java Platform API Specification
java.class.version : 50.0
sun.management.compiler : HotSpot 64-Bit Server Compiler
os.version : 2.6.27.19-170.2.35.fc10.x86_64
user.home : /home/danny
user.timezone : America/Vancouver
user.zoneinfo.dir : /usr/share/javazi
java.awt.printerjob : sun.print.PSPrinterJob
file.encoding : UTF-8
java.specification.version : 1.6
user.name : danny
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/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/checkstyle.jar:/usr/share/java/jakarta-commons-beanutils.jar:/usr/share/java/jakarta-commons-cli.jar:/usr/share/java/jakarta-commons-logging.jar:/usr/share/java/jakarta-commons-collections.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/ant/ant-commons-logging.jar:/usr/share/java/jakarta-commons-net.jar:/usr/share/java/ant/ant-commons-net.jar:/usr/share/java/javamail.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/jtidy.jar:/usr/share/java/xml-commons-apis.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/share/java/xalan-j2-serializer.jar:/usr/lib/jvm/java/lib/tools.jar:/home/danny/.ant/lib/maven-ant-tasks-2.0.9.jar
java.vm.specification.version : 1.0
sun.arch.data.model : 64
java.home : /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
java.specification.vendor : Sun Microsystems Inc.
user.language : en
java.vm.info : mixed mode
java.version : 1.6.0_0
java.ext.dirs : /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/ext:/usr/java/packages/lib/ext
sun.boot.class.path : /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/resources.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/rt.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/jsse.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/jce.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/charsets.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/rhino.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/classes
java.vendor : Sun Microsystems Inc.
file.separator : /
java.vendor.url.bug : http://java.sun.com/cgi-bin/bugreport.cgi
sun.cpu.endian : little
sun.io.unicode.encoding : UnicodeLittle
sun.cpu.isalist : 

-------------------------------------------
 Temp dir
-------------------------------------------
Temp dir is /tmp
Temp dir is writeable
Temp dir alignment with system clock is -376 ms

-------------------------------------------
 Locale information
-------------------------------------------
Timezone Pacific Standard Time offset=-25200000

-------------------------------------------
 Proxy information
-------------------------------------------
Java1.5+ proxy settings:
Direct connection
Comment 1 Danny Ciarniello 2009-03-16 17:57:25 EDT
Created attachment 335435 [details]
Build script from chapter 1 of "Harnessing Hibernate"
Comment 2 Bug Zapper 2009-11-18 06:31:55 EST
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 3 Danny Ciarniello 2009-11-18 23:54:09 EST
This bug still exists in Fedora 11 and 12.
Comment 4 Aaron Clark 2009-12-16 11:39:46 EST
I believe I'm experiencing the same thing.

Configuration: I'm running stock Fedora 12 with the ant that Fedora ships:
    * ant-1.7.1-12.fc12
    * java-1.6.0-openjdk-1.6.0.0-33.b16.fc12

I have svnant.jar and svnClientAdapter.jar in my $HOME/.ant/lib/

I'm using the following build.xml:

<project name="antlibtest" default="doEcho">
    <taskdef resource="svntask.properties"/>

    <target name="doEcho">
        <echo message="Hello World!"/>
        <echo message="ANT_HOME=${ant.home}"/>
        <echo message="classpath=${java.class.path}"/>
    </target>
</project>

When the build file is executed, I get the following error: [taskdef] Could not load definitions from resource svntask.properties. It could not be found.

If I set ANT_HOME to /usr/share/ant/ it works flawlessly.  Note the trailing '/', all of the ANT_HOME comparisons are against '/usr/share/ant' so one of those sub-bits appears to be causing the issue.

In both cases, the jars from my home directory are clearly in the output of the classpath.  However, the two generated classpaths are quite different, which may lead to some insight

Here are the classpath outputs:
__Without ANT_HOME Set___
     [echo] classpath=/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/ant/ant-contrib.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/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/checkstyle.jar:/usr/share/java/jakarta-commons-beanutils.jar:/usr/share/java/jakarta-commons-cli.jar:/usr/share/java/jakarta-commons-logging.jar:/usr/share/java/jakarta-commons-collections.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/ant/ant-commons-logging.jar:/usr/share/java/javamail.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/jtidy.jar:/usr/share/java/xml-commons-apis.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/share/java/xalan-j2-serializer.jar:/usr/lib/jvm/java/lib/tools.jar:/home/aclark/.ant/lib/svnant.jar:/home/aclark/.ant/lib/svnClientAdapter.jar:/home/aclark/.ant/lib/aspectjtools.jar:/usr/share/ant/lib/ant-nodeps.jar:/usr/share/ant/lib/ant-apache-log4j.jar:/usr/share/ant/lib/ant-commons-logging.jar:/usr/share/ant/lib/ant-bootstrap.jar:/usr/share/ant/lib/ant-swing.jar:/usr/share/ant/lib/ant-apache-resolver.jar:/usr/share/ant/lib/ant-apache-regexp.jar:/usr/share/ant/lib/ant-trax.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-javamail.jar:/usr/share/ant/lib/ant-jdepend.jar:/usr/share/ant/lib/ant-launcher.jar:/usr/share/ant/lib/ant-apache-bcel.jar:/usr/share/ant/lib/ant-apache-oro.jar:/usr/share/ant/lib/ant-junit.jar:/usr/share/ant/lib/ant-antlr.jar

__With ANT_HOME Set to /usr/share/ant/__
     [echo] classpath=/usr/share/ant//lib/ant-launcher.jar:/home/aclark/.ant/lib/svnant.jar:/home/aclark/.ant/lib/svnClientAdapter.jar:/home/aclark/.ant/lib/aspectjtools.jar:/usr/share/ant/lib/ant-nodeps.jar:/usr/share/ant/lib/ant-apache-log4j.jar:/usr/share/ant/lib/ant-commons-logging.jar:/usr/share/ant/lib/ant-bootstrap.jar:/usr/share/ant/lib/ant-swing.jar:/usr/share/ant/lib/ant-apache-resolver.jar:/usr/share/ant/lib/ant-apache-regexp.jar:/usr/share/ant/lib/ant-trax.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-javamail.jar:/usr/share/ant/lib/ant-jdepend.jar:/usr/share/ant/lib/ant-launcher.jar:/usr/share/ant/lib/ant-apache-bcel.jar:/usr/share/ant/lib/ant-apache-oro.jar:/usr/share/ant/lib/ant-junit.jar:/usr/share/ant/lib/ant-antlr.jar:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/lib/tools.jar
Comment 5 Bug Zapper 2010-04-27 09:12:54 EDT
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 6 Danny Ciarniello 2010-05-01 13:59:37 EDT
Is there any point in even bothering with this any more?  I reported the problem in Fedora 10 but the problem still exists as of Fedora 12 and as far as I can tell, it has never received any attention.
Comment 7 Bug Zapper 2010-06-28 07:29:12 EDT
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 8 clschalkwyk 2010-12-28 16:05:50 EST
Hi guys,

I had the same problem, but I found something that worked.

http://www.jarfinder.com/index.php/jars/jarClasses/12692

I used the maven-ant tasks jar from this site, version 2.0.8 and it seemed to compile.

Good luck!
Comment 9 Travis 2012-10-05 15:42:04 EDT
This is still an issue on Fedora release 17 (Beefy Miracle).
The suggested jarfinder download didn't help, but setting ANT_HOME to /usr/share/ant/ did.
Why is the issue closed?

Note You need to log in before you can comment on or make changes to this bug.