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
[EMAIL PROTECTED]
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 12, 2000 5:01 PM
> To: [EMAIL PROTECTED]
> 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
>