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 14806] New: - Wrong errormessage when executing task "taskdef"
Date Sun, 24 Nov 2002 12:29:04 GMT
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:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message