ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <anto...@gmx.de>
Subject Re: How to resolve a NullPointerException
Date Mon, 16 Oct 2006 16:00:22 GMT
Hello,

how do you run this programatically ?

one common source of null pointer exceptions in Ant API use is to forget to set a project
reference on task objects or datatypes. The null pointer exception happens then as soon as
the task or the datatype tries to log something.

if you have a NPE when using command line Ant, run 

ant -verbose

(-verbose is a command line argument)

this will give you a stack trace.

Regards,

Antoine
-------- Original-Nachricht --------
Datum: Mon, 16 Oct 2006 17:41:07 +0300
Von: "tharanga wijethilake" <tharanga@ee.oulu.fi>
An: "Ant Users List" <user@ant.apache.org>
Betreff: How to resolve a NullPointerException

> Hi all,
> I am tring to run this Ant file using a java program. 
> When I run this using "Ant run" option provided in eclipse it runs with
> out any trouble. 
> <project name="bundleRunner" default="submit_a_bundle" basedir=".">
> 
> <property name="ant.classpath" location="lib"/>
> 
> <taskdef name="smfbd.submitJarBundle"
> classname="com.ibm.ive.eccomm.bde.ui.tooling.ant.SubmitJarBundle"> 
> 
> <classpath>
> 
> <fileset dir="lib">
> 
> <include name="${ant.classpath}/smfbdTasks.jar"/>
> 
> <include name="${ant.classpath}/bde.jar"/>
> 
> </fileset> 
> 
> </classpath>
> 
> </taskdef>
> 
> <target name="submit_a_bundle"> 
> 
> <smfbd.submitJarBundle bundlepath="/HelloWorld" replace="true">
> 
> <bundleserver host="localhost" user="Admin" password="Admin" port="8080"
> webapp="/smf"/>
> 
> </smfbd.submitJarBundle>
> 
> </target>
> 
> </project>
> 
> 
> but when I try to run prgrammtically it gives a null pointer. Please Could
> someone tell me how am i supose to find from where the exception throws.
> submit_a_bundle:
> 
> BUILD FAILED
> 
> C:\Documents and Settings\tharanga\My
> Documents\IBM\wssitedev51\workspace\AntRunner\build.xml:12: java.lang.NullPointerException
> 
> Total time: 2 seconds
> 
> 
>  It is line 12 but is it the "bundlepath" or is it because of the related
> class file for smfbd task is missing. Thank you very much.
> 
> 
> 

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


Mime
View raw message