You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2002/11/24 13:29:04 UTC

DO NOT REPLY [Bug 14806] New: - Wrong errormessage when executing task "taskdef"

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14806>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14806

Wrong errormessage when executing task "taskdef"

           Summary: Wrong errormessage when executing task "taskdef"
           Product: Ant
           Version: 1.5.1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: keeskuip@technologist.com


When the classpath of the taskdef task is not correct a wrong errormessage
is displayed.

I have made an user-defined task "VBSFGenerator".
The task itself is in the jarfile "antVBSF.jar"
VBSFGenerator uses classes from the jarfiles "schema.jar" and "maptool2.jar".

I have in my build.xml :

  <path id="vbsf.ant.tasks">
    <pathelement location="${tools}/lib/ant/antVBSF.jar"/>
  </path>

  <target name="generate">

   <!-- Declare the Task before it can be used -->
    <taskdef name="VBSFGenerator"
             className="org.gti.ant.taskdefs.VBSFGenerator">
      <classpath refid="vbsf.ant.tasks"/>
    </taskdef>
 
  </target>

Note : I forgot to add "schema.jar" and "maptool2.jar" in the refid !
The errormessage when I run this is :

  taskdef class org.gti.ant.taskdefs.VBSFGenerator cannot be found

This errormessage is wrong,
because it was able to load VBSFGenerator but it was not able to 
load a different class ! namely :   
     com/objectmatter/bsf/mapping/schema/InvalidMappingException

If print out the stacktrace (obtained through use of the -debug flat)
I see :
BUILD FAILED
/usr/local/project/projecten/DutchCocoa/klant/build.xml:83: taskdef class org.gt
i.ant.taskdefs.VBSFGenerator cannot be found
        at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:204)
        at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:130)
        at org.apache.tools.ant.Task.perform(Task.java:313)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1216)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1160)
        at org.apache.tools.ant.Main.runBuild(Main.java:605)
        at org.apache.tools.ant.Main.start(Main.java:195)
        at org.apache.tools.ant.Main.main(Main.java:234)
--- Nested Exception ---
java.lang.NoClassDefFoundError: com/objectmatter/bsf/mapping/schema/InvalidMappi
ngException
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
        at java.lang.Class.getDeclaredConstructors(Class.java:1152)
        at org.apache.tools.ant.AntClassLoader.initializeClass(AntClassLoader.ja
va:478)
        at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:195)
        at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:130)
        at org.apache.tools.ant.Task.perform(Task.java:313)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1216)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1160)
        at org.apache.tools.ant.Main.runBuild(Main.java:605)
        at org.apache.tools.ant.Main.start(Main.java:195)
        at org.apache.tools.ant.Main.main(Main.java:234)


I think the errormessage should mention all messages from all 
Nested Exceptions !

So the correct (i think) should be :

/usr/local/project/projecten/DutchCocoa/klant/build.xml:83: taskdef class
org.gti.ant.taskdefs.VBSFGenerator cannot be found
--- Nested Exception ---
java.lang.NoClassDefFoundError: com/objectmatter/bsf/mapping/schema/InvalidMappi
ngException


Kees.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>