ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Huang" <judoscr...@hotmail.com>
Subject RE: Help: NPE from DefBase.java
Date Wed, 11 Aug 2004 21:35:29 GMT
I posted this last Saturday, and still haven't resolved it. Could someone 
help? Thanks in advance.

>From: "James Huang" <judoscript@hotmail.com>
>Reply-To: "Ant Users List" <user@ant.apache.org>
>To: user@ant.apache.org
>Subject: Help: NPE from DefBase.java
>Date: Sat, 07 Aug 2004 11:53:14 -0700
>
>This test program fails with Ant-1.6.2 but works with Ant-1.5.4:
>
>8< ------------------------------------------------------
>import org.apache.tools.ant.*;
>
>public class AntTest
>{
>  public static void main(String args[]) {
>    try {
>      Project proj = new Project();
>      proj.init();
>      proj.addBuildListener(new DefaultLogger());
>
>      Task task = proj.createTask("taskdef");
>      IntrospectionHelper helper = 
>IntrospectionHelper.getHelper(task.getClass());
>
>      helper.setAttribute(proj, task, "name", "judo");
>      helper.setAttribute(proj, task, "classname", 
>"com.judoscript.AntJudoScriptTask");
>
>      task.execute();
>
>    } catch(Exception e) {
>      e.printStackTrace();
>    }
>  }
>}
>------------------------------------------------------ >8
>
>java.lang.NullPointerException
>        at 
>org.apache.tools.ant.taskdefs.DefBase.createLoader(DefBase.java:132)
>        at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:169)
>        at AntTest.main(AntTest.java:17)
>
>In DefBase.java:
>    protected ClassLoader createLoader() {
>        if (getAntlibClassLoader() != null) {
>            return getAntlibClassLoader();
>        }
>        if (createdLoader == null) {
>            createdLoader = this.cpDelegate.getClassLoader(); <-- line 132
>
>However, the build.xml works with both Ant-1.6.2/1.5.4:
>
><project>
>  <taskdef name="judo" classname="com.judoscript.AntJudoScriptTask"/>
></project>
>
>I don't know if it's a bug or something extra I need to do in 1.6.2. Please 
>advise.
>
>Thanks,
>-James
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>



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


Mime
View raw message