-
-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bnd wrap creates an inconsistent jar file #4507
Comments
Can you please provide a small github repo which demonstrates the problem? Then we can investigate. Thanks. |
@bjhargrave I created a sample repo. I created a dummy jar, with that you can reproduce the error. I couldn't add the original wlthint3client-14.1.1.jar (Oracle WebLogic Thin T3 Client) because of licence reason. |
ZIP extra fields are structured binary data. See section 4.5 of the ZIP File Format Specification. Bnd had incorrectly assumed the ZIP extra field could be treated as a UTF-8 encoded string. However, the structured binary data of a ZIP extra field cannot be safely decoded as UTF-8 data into a String and then re-encoded into UTF-8 data when writing a ZIP file. This resulted in corrupting the ZIP extra fields when wrapping a jar. |
@sparsick Thanks for the bug report. The example repo really helped. The problem is now fixed in Bnd 5.3 which we hope to release by the end of Feb. See https://github.com/bndtools/bnd#using-the-latest-development-snapshot-build-of-bndbndtools if you want to test the fix with the snapshot builds. |
@bjhargrave Thank you for your fast fix. I tested it and it works like a charm |
I try to create an osgi-bundle from wlthint3client-14.1.1.jar (Oracle WebLogic Thin T3 Client) with the following command:
whereby
wlthint3client.bnd
has the following content:fixupmessages
is needed because bnd doesn't yet support multi release jar see also #2227.When I check the created jar by bnd with
zip -T
, I get the following error messsage:I unzipped this corrupted zip and what I note that every class file has a strange timestamp.
When I check the original jar with
zip -T
, everything is okay.Also, the timestamp of the class files looks correct.
I try it with Java 8 and Java 11. Both have the same result.
Any idea what is going wrong here?
The text was updated successfully, but these errors were encountered: