ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Goodnough" <Andrew.Goodno...@wicourts.gov>
Subject Re: JAR annoyance from 12/12/2000
Date Tue, 11 Feb 2003 14:50:28 GMT
I'm having a problem jar'ing a large directory of classes (2,079 files).
 The same code jars a smaller number of classes.  It reports an
exception on close but due to this post I found from 2000, I believe it
might be pointing to the fact that the jars aren't being added in the
first place.  The following is my task, then a snippet of the error, and
then the post from 2000 which this seems related to.  Thanks in advance
for any help.

Andy

<!-- Put everything in ${build} into CCAP-Queries-20030210-1359.jar
file -->
<jar jarfile="${dist}/lib/${app.name}-${DSTAMP}-${TSTAMP}.jar"
	basedir="${build}"
	excludes="**/*Test.class"
/>


*******last part of debug output (Note: XMLDTDsSQ.class is correctly
the last file in the folder)************
      [jar] adding entry
us/wi/state/courts/jade/query/select/WarrantIssuedSQ.class
      [jar] adding entry
us/wi/state/courts/jade/query/select/WarrantSQ.class
      [jar] adding entry
us/wi/state/courts/jade/query/select/WarrantTxtAndAmtRSQ.class
      [jar] adding entry
us/wi/state/courts/jade/query/select/WarrantTypeSQ.class
      [jar] adding entry
us/wi/state/courts/jade/query/select/WccaGetIssAgencyList.class
      [jar] adding entry
us/wi/state/courts/jade/query/select/WcisClsCodeDescrSQ.class
      [jar] adding entry
us/wi/state/courts/jade/query/select/WcisClsCodeSQ.class
      [jar] adding entry
us/wi/state/courts/jade/query/select/WcisCondCodeSQ.class
      [jar] adding entry
us/wi/state/courts/jade/query/select/WitnessSQ.class
      [jar] adding entry
us/wi/state/courts/jade/query/select/WorkstationSQ.class
      [jar] adding entry
us/wi/state/courts/jade/query/select/XMLDTDsSQ.class

BUILD FAILED
java.lang.NullPointerException
        at
org.apache.tools.zip.ZipOutputStream.finish(ZipOutputStream.java(Compiled
Code))
        at
java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:139)
        at org.apache.tools.ant.taskdefs.Zip.execute(Zip.java:402)
        at org.apache.tools.ant.Task.perform(Task.java:319)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at
org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at
org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:610)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)

Total time: 16 seconds
java.lang.NullPointerException
        at
org.apache.tools.zip.ZipOutputStream.finish(ZipOutputStream.java(Compiled
Code))
        at
java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:139)
        at org.apache.tools.ant.taskdefs.Zip.execute(Zip.java:402)
        at org.apache.tools.ant.Task.perform(Task.java:319)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at
org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at
org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:610)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)






From: Rosen, Alex <arosen@silverstream.com>
Subject: JAR annoyance
Date: Tue, 12 Dec 2000 20:15:14 -0500
Content-Type: text/plain;
	charset="us-ascii"


I think the patch I submitted, that Pete checked in on the 9th, should
fix
this. The error you're seeing may not be the real error. An exception
is
probably being thrown earlier, and a finally clause in Zip.java is
trying to
close the ZipOutputStream, but because of the exception there were no
files
added to the Zip, so close() throws the "ZIP file must have at least
one entry"
exception. The first exception (the real cause of the problem) gets
masked. If
you get the latest Zip.java, you should be able to see the real error
message.

Hope this helps,
Alex Rosen
alex@silverstream.com

> -----Original Message-----
> From: David.Bailey@lawson.com [mailto:David.Bailey@lawson.com]
> Sent: Tuesday, December 12, 2000 5:01 PM
> To: ant-user@jakarta.apache.org
> Subject: JAR annoyance
>
>
>
>
>
> Ant is now refusing to jar things for me.  The following task:
>
>           <jar jarfile="${JARDIR}/lawsonrt.jar"
>                whenempty="fail">
>                <fileset dir="${CLASSDIR}" >
>                     <include name="com/**/*.class" />
>                </fileset>
>           </jar>
>
> fails with the error:
>
> "Problem creating jar: ZIP file must have at least one entry."
>
> and a stack trace.  The thing is, the fileset points to a
> whopping big number of
> files, as I proved to myself by using the same fileset
> construction to copy all
> of those class files to a temp directory.
>
> So why can't the jar task interpret the fileset and pick up
> the ~1200 files I'm
> pointing it to?  I originally tried using only attributes of
> the jar task
> ("basedir," "includes", etc.), and that seemed to be working
> for a while.  But
> I've done a lot of mucking since then and I don't understand
> why it's broken.
>
> Thanks,
>
>
> --dave
>




Mime
View raw message