ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sekar Varatharajan" <svar...@rnm.ca>
Subject antcall doesn't work inside Java Script - Help
Date Fri, 27 Jul 2001 20:29:21 GMT

Hi,
I am trying to create an antcall inside script and when i try executing it i
get Null PointerException.
Anybody can help me???

Here is the code below :


<project name="project" default="main" basedir=".">

<target name="checkout">
<script language="javascript"> <![CDATA[
antcall=project.createTask("antcall");
antcall.init();
antcall.setTarget("myecho");
antcallParam=antcall.createParam();
antcallParam.setName("myparam");
antcallParam.setValue("It Works");
antcall.execute();
]]>

</script>

</target>



<target name="myecho" >
				<echo message="Project Value : ${myparam}"/>


</target>



	<target name="main" depends="checkout" />

</project>


Buildfile: build.xml

checkout:

BUILD FAILED

/export/home/svarath/build/Preparation/MasterBuild/wrapper/build.xml:3:
java.lang.NullPointerException
--- Nested Exception ---
java.lang.NullPointerException
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:206)
        at
org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:103)
        at java.lang.reflect.Method.invoke(Native Method)
        at
org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java(Compiled
Code))
        at
org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1216)
        at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1679)
        at
org.mozilla.javascript.InterpretedScript.call(InterpretedScript.java:63)
        at
org.mozilla.javascript.InterpretedScript.exec(InterpretedScript.java:54)
        at org.mozilla.javascript.Context.evaluateReader(Context.java:741)
        at org.mozilla.javascript.Context.evaluateString(Context.java:705)
        at
com.ibm.bsf.engines.javascript.JavaScriptEngine.eval(JavaScriptEngine.java:8
3)
        at com.ibm.bsf.util.BSFEngineImpl.exec(BSFEngineImpl.java:106)
        at com.ibm.bsf.BSFManager.exec(BSFManager.java:479)
        at
org.apache.tools.ant.taskdefs.optional.Script.execute(Script.java:109)
        at org.apache.tools.ant.Target.execute(Target.java(Compiled Code))
        at org.apache.tools.ant.Project.runTarget(Project.java:898)
        at org.apache.tools.ant.Project.executeTarget(Project.java:536)
        at org.apache.tools.ant.Project.executeTargets(Project.java:510)
        at org.apache.tools.ant.Main.runBuild(Main.java:421)
        at org.apache.tools.ant.Main.main(Main.java:149)
***********************
Sekar Varatharajan
Application Developer
ROGERS iMEDIA
***********************



Mime
View raw message