ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 30710] New: - taskdef: com.sun.tools.ant.Task not found.
Date Tue, 17 Aug 2004 14:48:21 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30710>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30710

taskdef: com.sun.tools.ant.Task not found.

           Summary: taskdef: com.sun.tools.ant.Task not found.
           Product: Ant
           Version: 1.6.2
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: sejo@gentoo.org


When defining a taskdef i get an error about com.sun.tools.ant.Task not being
found, by the class that i define. (check xml below). 
This is with the sun-jdk 1.4.2.05, if i switch from jdk to the ibm-jdk-bin-1.4.2
the error is resolved. 
I find it weird that this problem exists...

listing 1: xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="art41" default="generate.sources" basedir=".">
    <path id="classpath.lib">
        <fileset dir="/opt/jars">
             <include name="hyperjaxb.jar"/>
             <include name="jaxb-xjc.jar"/>
             <include name="xsdlib.jar"/>
             <include name="xercesImpl.jar"/>
             <include name="sax.jar"/>
        </fileset>
    </path>
   <target name="generate.sources">
       <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask"
classpathref="classpath.lib"/>
        <mkdir dir="gen"/>
        <xjc schema="xml_schema_article41.xsd" target="gen"
classpathref="classpath">
            <arg line="-Xhibernate-xdoclets"/>
        </xjc>
     </target>
</project>


listing 2: ant output

SeJo@versake article41 $ ant -f test.xml -d -v
Apache Ant version 1.6.2 compiled on August 17 2004
Apache Ant version 1.6.2 compiled on August 17 2004
Buildfile: test.xml
Detected Java version: 1.4 in: /opt/sun-jdk-1.4.2.05/jre
Detected OS: Linux
parsing buildfile /home/SeJo/workspace/article41/test.xml with URI =
file:///home/SeJo/workspace/article41/test.xml
Project base dir set to: /home/SeJo/workspace/article41
Build sequence for target `generate.sources' is [generate.sources]
Complete build sequence is [generate.sources, ]

generate.sources:

BUILD FAILED
/home/SeJo/workspace/article41/test.xml:13: taskdef A class needed by class
com.sun.tools.xjc.XJCTask cannot be found: org/apache/tools/ant/Task
        at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:487)
        at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:183)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
        at org.apache.tools.ant.Main.runBuild(Main.java:673)
        at org.apache.tools.ant.Main.startAnt(Main.java:188)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
Caused by: java.lang.NoClassDefFoundError: org/apache/tools/ant/Task
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at
org.apache.tools.ant.AntClassLoader.findBaseClass(AntClassLoader.java:1180)
        at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:956)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:219)
        at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:457)
        ... 11 more
--- Nested Exception ---
java.lang.NoClassDefFoundError: org/apache/tools/ant/Task
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at
org.apache.tools.ant.AntClassLoader.findBaseClass(AntClassLoader.java:1180)
        at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:956)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:219)
        at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:457)
        at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:183)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
 at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
        at org.apache.tools.ant.Main.runBuild(Main.java:673)
        at org.apache.tools.ant.Main.startAnt(Main.java:188)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)

Total time: 8 seconds

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message