dataframe icon indicating copy to clipboard operation
dataframe copied to clipboard

There was an issue with using gradle to package jar and parse Excel in xls format during packaging

Open langbiantianya opened this issue 2 years ago • 6 comments

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]

langbiantianya avatar Jul 12 '23 09:07 langbiantianya

The version used is 0.11.0

langbiantianya avatar Jul 12 '23 09:07 langbiantianya

Excuse me @langbiantianya , how to reproduce it?

zaleslaw avatar Jul 12 '23 13:07 zaleslaw

@langbiantianya please answer or provide an example of how to reproduce it?

zaleslaw avatar Sep 08 '23 13:09 zaleslaw

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.

langbiantianya avatar Sep 09 '23 10:09 langbiantianya

The same problem occurs in 0.11

langbiantianya avatar Sep 09 '23 10:09 langbiantianya

The problem only occurs after packing

langbiantianya avatar Sep 09 '23 10:09 langbiantianya

Do we have any workaround for this? I am facing same issue.

vishwanjalijadhav avatar Nov 12 '24 06:11 vishwanjalijadhav

@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.

Jolanrensen avatar Nov 12 '24 11:11 Jolanrensen