Hi,

I don't think this is in the h2 jar file.

The exceptions message says there is a directory entry "META-INF/services",
which contains data. But directory entries in the jar file may not contain
data. I don't think the h2.jar file contains such an entry, because as you
already found out, the h2.jar file does not contain directory entries.
There is an entry for "META-INF/services/java.sql.Driver", but no entry for
"META-INF/services" in the h2 jar file

Regards,
Thomas



On Friday, December 5, 2014, Brian Craft <[email protected]> wrote:

> Exception in thread "main" java.lang.IllegalArgumentException: Non-empty
> directory: META-INF/services
>         at
> com.sun.java.util.jar.pack.PackerImpl$DoPack.readFile(PackerImpl.java:546)
>         at
> com.sun.java.util.jar.pack.PackerImpl$DoPack.run(PackerImpl.java:492)
>         at com.sun.java.util.jar.pack.PackerImpl.pack(PackerImpl.java:99)
>         at com.sun.java.util.jar.pack.Driver.main(Driver.java:313)
>
>
> It seems to be interacting with the 'services' directory in the fasterxml
> jar. The clojure build tool, lein, creates an uberjar via the
> java.util.zip.ZipOutputStream, and friends. Code here:
>
>
> https://github.com/technomancy/leiningen/blob/master/src/leiningen/uberjar.clj
>
> When both h2 and fasterxml are included, the resulting jar has a non-empty
> directory. The h2 jar looks unusual because it has no directory entries.
> The fasterxml jar looks unusual because the directories (listed with unzip
> -lv) are shown as Defl:N instead of Stored.
>
> I really think it's a lein problem, but I haven't been able to determine
> exactly what it doesn't like about the combination of these two jars. If I
> unzip/re-zip the uberjar, it eliminates the non-empty directory in the jar,
> and pack200 is happy with it. If I unzip and re-zip the h2 and fasterxml
> jars, it doesn't seem to have any effect. This is odd to me, because the
> re-zip makes both jars look normal: directory entries for all directories,
> shown as Stored, not Defl:N. Not sure why the combination still fails.
> Maybe the failure is unrelated to these issues.
>
>
>
> On Friday, December 5, 2014 2:06:45 AM UTC-8, Thomas Mueller wrote:
>>
>> Hi,
>>
>> The H2 jar files are built using the java.util.jar.JarOutputStream, and
>> so far I didn't know about any problems with this approach.
>>
>> I think I found the place where pack200 throws this exception:
>> http://www.docjar.com/html/api/com/sun/java/util/jar/
>> pack/PackerImpl.java.html
>>
>> Package.File file = pkg.new File(fname);
>>   544               file.readFrom(in);
>>   545               if (file.isDirectory() && file.getFileLength() != 0)
>>   546                   throw new IllegalArgumentException("Non-empty
>> directory: "+file.getFileName());
>>   547               return file;
>>
>> The problems seems to be that there are directories that are not empty.
>> But I don't think that's from H2. What is the complete exception message?
>>
>> Regards,
>> Thomas
>>
>> On Thu, Dec 4, 2014 at 6:10 PM, Brian Craft <[email protected]> wrote:
>>
>>> The h2 jar doesn't have entries for directories. This seems to be
>>> causing problems with down-stream build tools. Building an uber-jar, then
>>> passing through pack200, it throws a "non-empty directory" exception. I
>>> suspect it's the uber-jar build that is broken, but am also wondering why
>>> the h2 jars have no directory entries. Is this also due to pack200?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "H2 Database" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/h2-database.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]
> <javascript:_e(%7B%7D,'cvml','h2-database%[email protected]');>
> .
> To post to this group, send email to [email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>.
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to