Re: Upgrade to 5.0.0 resulted in IOException message

Nick Burch <[email protected]>
Newsgroups gmane.comp.jakarta.poi.user
Message-ID <[email protected]>
On Wed, 3 Feb 2021, Bryan Coleman wrote:
> java.io.IOException: Your InputStream was neither an OLE2 stream, nor an 
> OOXML stream or you haven't provide the poi-ooxml*.jar in the 
> classpath/modulepath - FileMagic: OLE2, having providers: 
> [org.apache.poi.xssf.usermodel.XSSFWorkbookFactory@40086342]

That's very odd - you have the main POI jar there (need it for 
WorkbookFactory), but somehow have lost the reference to the HSSF classes 
which also live there...

> Note: It works when running in my IDE; however, when it runs from a 
> (mega) jar (built by ant), we get the exception above.

Ah, I suspect something is clobbering some files when it merges stuff into 
a mega jar. My guess is it's the /META-INF/services files, and your mega 
jar is taking just one rather than merging as it needs to

Can you post details of how you're building the mega jar, and/or look up 
how to get the tool/task you're using to merge not overwrite ServiceLoader 
/ Java Service Provider Interface services files?

Nick
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.