You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Chidananda Jayakeerti <aj...@gmail.com> on 2005/11/03 21:11:07 UTC

ANT todir= exception

Hello all,

I'm new to ANT. I'm trying to generate checksum using the following syntax,

<checksum algorithm="SHA" file="${build.lib}/app.jar" todir="${build.dest
}"/>

throws

/home/app/build.xml:110: java.lang.NullPointerException

If i remove todir="${build.dest}" parameter, everything compiles.

I'm using Ant 1.6.5 on Sun JDK 1.5.0_05.

Any suggestions?

Thanks,
Chida

Re: ANT todir= exception

Posted by Chidananda Jayakeerti <aj...@gmail.com>.
The build.xml and the trace is attached. If we confirm this as a bug, I will
file a bug report. Thanks

[app@miracle src]$ ant -v
Apache Ant version 1.6.5 compiled on June 2 2005
Buildfile: build.xml
Detected Java version: 1.5 in: /usr/local/java/jdk1.5.0_05/jre
Detected OS: Linux
parsing buildfile /home/app/src/build.xml with URI =
file:///home/app/src/build.xml
Project base dir set to: /home/app/src
Build sequence for target(s) `all' is [compile, checksum, all]
Complete build sequence is [compile, checksum, all, ]

compile:
[javac] helloworld.java added as helloworld.class doesn't exist.
[javac] Compiling 1 source file
[javac] Using modern compiler
[javac] Compilation arguments:
[javac] '-classpath'
[javac] '/usr/local/apache-ant-1.6.5/lib/ant-
launcher.jar:/usr/local/apache-ant-1.6.5/lib/ant-xalan1.jar:/usr/local/apache-ant-1.6.5/lib/ant-apache-resolver.jar:/usr/local/apache-ant-1.6.5/lib/xercesImpl.jar:/usr/local/apache-ant-1.6.5/lib/ant-junit.jar:/usr/local/apache-ant-1.6.5/lib/ant-icontract.jar:/usr/local/apache-ant-1.6.5/lib/ant-netrexx.jar:/usr/local/apache-ant-1.6.5/lib/ant-xslp.jar:/usr/local/apache-ant-1.6.5/lib/ant-commons-net.jar:/usr/local/apache-ant-1.6.5/lib/ant-nodeps.jar:/usr/local/apache-ant-1.6.5/lib/ant-jsch.jar:/usr/local/apache-ant-1.6.5/lib/ant-apache-log4j.jar:/usr/local/apache-ant-1.6.5/lib/xml-apis.jar:/usr/local/apache-ant-1.6.5/lib/ant-vaj.jar:/usr/local/apache-ant-1.6.5/lib/ant-weblogic.jar:/usr/local/apache-ant-1.6.5/lib/ant-starteam.jar:/usr/local/apache-ant-1.6.5/lib/ant-swing.jar:/usr/local/apache-ant-1.6.5/lib/ant-jdepend.jar:/usr/local/apache-ant-1.6.5/lib/ant.jar:/usr/local/apache-ant-1.6.5/lib/ant-commons-logging.jar:/usr/local/apache-ant-1.6.5/lib/ant-trax.jar:/usr/local/apache-ant-1.6.5/lib/ant-stylebook.jar:/usr/local/apache-ant-1.6.5/lib/ant-jai.jar:/usr/local/apache-ant-1.6.5/lib/ant-apache-bcel.jar:/usr/local/apache-ant-1.6.5/lib/ant-javamail.jar:/usr/local/apache-ant-1.6.5/lib/ant-apache-bsf.jar:/usr/local/apache-ant-1.6.5/lib/ant-apache-regexp.jar:/usr/local/apache-ant-1.6.5/lib/ant-apache-oro.jar:/usr/local/apache-ant-1.6.5/lib/ant-jmf.jar:/usr/local/apache-ant-1.6.5/lib/ant-antlr.jar:/usr/local/java/jdk1.5.0_05/lib/tools.jar
'
[javac] '-sourcepath'
[javac] '/home/app/src'
[javac] '-g'
[javac]
[javac] The ' characters around the executable and arguments are
[javac] not part of the command.
[javac] File to be compiled:
[javac] /home/app/src/helloworld.java

checksum:

BUILD FAILED
/home/app/src/build.xml:10: java.lang.NullPointerException
at org.apache.tools.ant.Task.perform(Task.java:373)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(
DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.lang.NullPointerException
at java.io.File.<init>(File.java:277)
at org.apache.tools.ant.taskdefs.Checksum.getChecksumFile(Checksum.java:406)
at org.apache.tools.ant.taskdefs.Checksum.addToIncludeFileMap(Checksum.java
:366)
at org.apache.tools.ant.taskdefs.Checksum.validateAndExecute(Checksum.java
:349)
at org.apache.tools.ant.taskdefs.Checksum.execute(Checksum.java:224)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
... 10 more
--- Nested Exception ---
java.lang.NullPointerException
at java.io.File.<init>(File.java:277)
at org.apache.tools.ant.taskdefs.Checksum.getChecksumFile(Checksum.java:406)
at org.apache.tools.ant.taskdefs.Checksum.addToIncludeFileMap(Checksum.java
:366)
at org.apache.tools.ant.taskdefs.Checksum.validateAndExecute(Checksum.java
:349)
at org.apache.tools.ant.taskdefs.Checksum.execute(Checksum.java:224)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(
DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

Total time: 2 seconds

***********************************************
<?xml version='1.0'?>
<project name="hello" default="all" basedir=".">
<description>Simple ANT build file</description>

<target name="compile">
<javac srcdir="." debug="true" includes="*.java"/>
</target>

<target name="checksum">
<checksum algorithm="SHA" file="helloworld.class" todir="."/>
</target>

<target name="all" depends="compile,checksum">
<echo message="All Done"/>
</target>

</project>

**************************************************
On 11/4/05, Steve Loughran <st...@apache.org> wrote:
>
> Chidananda Jayakeerti wrote:
> > Hello all,
> >
> > I'm new to ANT. I'm trying to generate checksum using the following
> syntax,
> >
> > <checksum algorithm="SHA" file="${build.lib}/app.jar" todir="${
> build.dest
> > }"/>
> >
> > throws
> >
> > /home/app/build.xml:110: java.lang.NullPointerException
> >
> > If i remove todir="${build.dest}" parameter, everything compiles.
> >
> > I'm using Ant 1.6.5 on Sun JDK 1.5.0_05.
> >
> > Any suggestions?
> >
> > Thanks,
> > Chida
> >
>
> this is probably a bug in ant. Can you do a -v run and file the trace as
> a bug report?
>
>

Re: ANT todir= exception

Posted by Steve Loughran <st...@apache.org>.
Chidananda Jayakeerti wrote:
> Hello all,
> 
> I'm new to ANT. I'm trying to generate checksum using the following syntax,
> 
> <checksum algorithm="SHA" file="${build.lib}/app.jar" todir="${build.dest
> }"/>
> 
> throws
> 
> /home/app/build.xml:110: java.lang.NullPointerException
> 
> If i remove todir="${build.dest}" parameter, everything compiles.
> 
> I'm using Ant 1.6.5 on Sun JDK 1.5.0_05.
> 
> Any suggestions?
> 
> Thanks,
> Chida
> 

this is probably a bug in ant. Can you do a -v run and file the trace as 
a bug report?

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