[MGNLEE-471] UnsupportedFileFormatException while working with excel sheet using POI Created: 10/Nov/16  Updated: 11/Nov/16  Resolved: 11/Nov/16

Status: Closed
Project: Magnolia DX Core
Component/s: None
Affects Version/s: 5.4.9
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: Giovanni Regola Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Java jdk1.7.0_51
Windows 7 Enterprise
Magnolia EE 5.4.9 local installation (repository on Derby DB)


Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

I've just implemented a simple Magnolia job, that reads an Excel file (xls or xlsx doesn't matter) and print some Excel cell values on stdout (at this time, the next step consists of storing these values on a database table).
I'm using the apache POI API poi-3.9.jar available on /magnoliaAuthor/WEB-INF/lib folder.
After running my job, I get the following exception:
{{
ERROR org.quartz.core.ErrorLogger 10.11.2016 12:37:00 – Job (magnolia.splittingXLSDealUserJob threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NoClassDefFoundError: org/apache/poi/UnsupportedFileFormatException]
at org.quartz.core.JobRunShell.run(JobRunShell.java:234)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: java.lang.NoClassDefFoundError: org/apache/poi/UnsupportedFileFormatException}}

The official Apache POI API FAQ (http://poi.apache.org/faq.html#faq-N10204) explains that " A combination such as poi-3.11.jar and poi-ooxml-3.9.jar is not supported, and will fail to work in unpredictable ways"

I've noticed that Magnolia 5.4.9 EE bundle comes with these Apache POI libs:

  • poi-3.9.jar
  • poi-ooxml-schemas-3.11-beta2.jar
  • poi-ooxml-3.11-beta2.jar
  • poi-scratchpad-3.11-beta2.jar

So it seems that my issue is related to a compatibility problem between the "master" POI lib (3.9) and the others "slave" POI libs (3.11).
For testing purposing I've tried to run the same job on another Magnolia 5.4.9 EE instance, where I've changed "3.11" slave POI libs with "3.9" libs (downloaded from https://archive.apache.org/dist/poi/release/bin/poi-bin-3.9-20121203.zip): it works fine.

At this time I need to know which of the following options do you suggest in order to solve my issue:
1) downgrade 3.11 "slave" POI libs to 3.9 (as I've just succesfully tested on my environment)
2) upgrade all (master + slave) POI lib to the latest stable version (3.15)

With the default "Magnolia 5.4.9 POI" config it seems to be blocked any "read & write" Apache POI action on any Excel file.

Best regards,
Giovanni



 Comments   
Comment by Giovanni Regola [ 11/Nov/16 ]

This issue has been cloned with the following https://jira.magnolia-cms.com/browse/MGNLEE-472 for customer support

Generated at Mon Feb 12 05:30:18 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.