ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Tanner <...@dantanner.com>
Subject Custom Task breaks in Ant 1.4
Date Mon, 17 Sep 2001 22:20:37 GMT
I'm getting the following exception when trying to run my custom task.
The actual error is a NullPointerException with a Project instance.
It works in Ant 1.3, so I suspect my task either isn't complient, or 
I've found a bug.  More info that may help is that I'm using a couple 
nested classes in my custom task, but only referring to their parent 
class in my <taskdef> entry.

Piece of build.xml in question:
---------------------------------------------------------
     <translationcheck logfile="build/TranslationCheck-AllFiles.log" 
reportfor="entireset">
       <keyset>
         <fileset dir="resources/translations"
 
includes="base.properties,lang1.properties,mtg1.properties" />
       </keyset>
       <searchset>
         <fileset dir="web/user" includes="**/*.jsp" />
         <fileset dir="source" includes="**/*.java" />
         <ignore key="revision.mtg" />
         <ignore key="revision.lang" />
         <ignore key="revision.base" />
         <ignore key="jsp.httperrorpage.errormsg.404" />
       </searchset>
     </translationcheck>
----------------------------------------------------------


Small piece of my custom task: (I think it's my code's point of entry 
into Ant)
------------------------------------------------------------------------
     FileSet fs = (FileSet)filesets.get(i);
     DirectoryScanner ds = fs.getDirectoryScanner(project);
----------------------------------------------------------



Part of Ant output with debug turned on:
------------------------------------------------------------------------
    +Task: translationcheck
Finding class com.katun.kolc.ant.TranslationCheck$SearchSet
Class com.katun.kolc.ant.TranslationCheck$SearchSet loaded from ant loader
Finding class com.katun.kolc.ant.TranslationCheck$KeySet
Class com.katun.kolc.ant.TranslationCheck$KeySet loaded from ant loader
Class java.lang.String loaded from parent loader
Class java.util.List loaded from parent loader
Class java.util.ArrayList loaded from parent loader
Class org.apache.tools.ant.types.FileSet loaded from parent loader

BUILD FAILED

java.lang.NullPointerException
         at 
org.apache.tools.ant.ProjectHelper.configure(ProjectHelper.java:651)
         at 
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig
urable.java:143)
         at org.apache.tools.ant.Task.maybeConfigure(Task.java:178)
         at 
org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.jav
a:139)
         at 
org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.jav
a:88)
         at org.apache.tools.ant.Task.perform(Task.java:216)
         at org.apache.tools.ant.Target.execute(Target.java:164)
         at org.apache.tools.ant.Target.performTasks(Target.java:182)
         at org.apache.tools.ant.Project.executeTarget(Project.java:601)
         at org.apache.tools.ant.Project.executeTargets(Project.java:560)
         at org.apache.tools.ant.Main.runBuild(Main.java:454)
         at org.apache.tools.ant.Main.start(Main.java:153)
         at org.apache.tools.ant.Main.main(Main.java:176)
--------------------------------------------------------

Thanks in advance for any help,
Dan
dan@dantanner.com


Mime
View raw message