There was an issue with using gradle to package jar and parse Excel in xls format during packaging
2023-07-12 14:52:06 14:52:06.262 [DefaultDispatcher-worker-6] ERROR c.c.g.app.router.rest.UploadRouter - 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@234c7887] 2023-07-12 14:52:06 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@234c7887]
The version used is 0.11.0
Excuse me @langbiantianya , how to reproduce it?
@langbiantianya please answer or provide an example of how to reproduce it?
Generated a ktor 2.3.2 using IDEA, Gradle version is 7.4 Introduced dataframe version 0.10.1 in it, used workbook to parse it, the rest is the same as in the docs, the same way it can parse xlsx but can't parse xls. to solve the problem I had to use a poi to get around it.
The same problem occurs in 0.11
The problem only occurs after packing
Do we have any workaround for this? I am facing same issue.
@vishwanjalijadhav so the problem is that it complains about not having access to "poi-ooxml" after packaging dataframe-excel in a library of yours?
Could you try manually adding the dependencies:
api("org.apache.poi:poi-ooxml:5.3.0")
(and potentially)
api("org.apache.poi:poi:5.3.0")
DataFrame already shares poi as api() dependency, but poi-ooxml is added as implementation for the moment. If this workaround works for you, we can probably fix it on our side.