You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Anmol Khanna <an...@jabcreative.com> on 2002/05/13 01:31:46 UTC

problem loading Torque.properties from ant

hi,

I want to run my java program (that loads torque properties file) using ant. I have got following lines in build.xml file


<target name="run" description="run ">
       <java classname="${main.file}" classpathref="class.path" >
         <arg value="-h"/> 
         <classpath>
             <pathelement location="${build.dir}/bin/${project}.jar"/>
          </classpath>
     </java>
</target>

When I don't initialise Torque.properties in my source code, ant doesn't complain and the program works fine.
I get following exception when I run the same program, with an additional line that initialises the torque properties file :

java.lang.NullPointerException
        at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:13
2)
        at org.apache.tools.ant.taskdefs.Java.run(Java.java:305)
        at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:127)
        at org.apache.tools.ant.taskdefs.Java.execute(Java.java:88)
        at org.apache.tools.ant.Task.perform(Task.java:217)
        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)
--- Nested Exception ---
java.lang.NullPointerException
        at org.apache.torque.Torque.initialize(Torque.java:227)
        at org.apache.torque.Torque.init(Torque.java:294)
        at org.apache.torque.Torque.init(Torque.java:274)
        at au.com.umarketing.umail.send.SendInvoice.<init>(Unknown Source)
        at au.com.umarketing.umail.send.SendInvoice.main(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:12
4)
        at org.apache.tools.ant.taskdefs.Java.run(Java.java:305)
        at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:127)
        at org.apache.tools.ant.taskdefs.Java.execute(Java.java:88)
        at org.apache.tools.ant.Task.perform(Task.java:217)
        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)


PS: TurbineProperties file gets loaded as the log is created and other turbine properties are read. 
Any ideas?

Thanks
Anmol