mjul / docjure

Read and write Office documents from Clojure
MIT License
619 stars 129 forks source link

Migration to POI 4.0.1 #81

Closed manuelherzog closed 4 years ago

manuelherzog commented 5 years ago

Hey,

right now i'm doing the migration, as i need the newer version for other POI tasks and libs.

I'm getting to multiple problems before i could start, lein test did not run because the Classloader was not found. I updated pomegranate and then get the error that there is no writeable Classloader anymore. Then i removed that one test that was failing because it can't add the test-data to the classpath.

I upgraded to POI 4.0.1 and it works quite easily.

But, now i get the exception "Truncated ZIP file" on one test only. Rolled back and noticed that the stream that was written to was not closed properly.

Sending you the pull request with 3 commits, if you want to fix the two problems not directly attached to the migration in another way

Best Manuel

manuelherzog commented 5 years ago

resolving #78

raymond-w-ko commented 5 years ago

I was looking for something like this. Thanks.

I quickly reviewed it and it seems to be just a case of fixing references to enums due to the underlying library refactoring things. Seems simple enough.

I did some research and the .close is now necessary due to a decision they made to not auto close the stream on workbook write so you can write multiple workbooks. Details in the link below:

https://bz.apache.org/bugzilla/show_bug.cgi?id=60713

I will test this in my company project and hopefully get back to see how 4.1.0 POI fares.

miikka commented 4 years ago

Just tried this patch out with POI 4.1.0 and still seems good. (https://github.com/miikka/docjure/commit/2e0ade913381094fde4ffc14b729de29a2da3582)

mjul commented 4 years ago

Thank you for your valuable contribution. I have added you to the contributor list.

rutchkiwi commented 3 years ago

Thank you so much for this @manuelherzog and everyone involved, you are amazing! The --illegal-access=warn warning has been annoying me for months and now my tests run sparkly clean. :D