ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ultra Funkular <funku...@nettaxi.com>
Subject Using Ant api to call a task...
Date Tue, 18 Jun 2002 03:17:14 GMT

I am attempting to run the <antstructure> task using the Ant api directly.
However, there is a NullPointerException being thrown.


Stack Trace:

java.lang.NullPointerException
         at org.apache.tools.ant.Task.perform(Task.java:227)
         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 
funkular.util.AntTaskDefinitions.createDTDFile(AntTaskDefinitions.java:149)


Code:

                 Project project = new Project();
                 Target target = new Target();
                 AntStructure task = new AntStructure();
                 task.setOutput( file );
                 target.addTask( task );
                 final String TARGET_NAME = "CreateDTD";
                 target.setName(TARGET_NAME);
                 project.addTarget(TARGET_NAME, target);   // 
project.addTarget(target);
                 project.executeTarget(TARGET_NAME)


Is my code incorrect?  I gleaned the usage from the javadocs.

Comments and thoughts appreciated.


Platform:  ant 1.4 (with optional.jar), Debian Linux, IBM java SDK 1.3.1


Regards,


T Master

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message