1金币
本帖最后由 bds_Paul 于 2022-12-2 14:15 编辑
- void xlsxParse() throws FileNotFoundException {
- Workbook workbook = new Workbook();
- FileInputStream f = new FileInputStream("/Users/eleme/Downloads/tddp2_3yLgiXKwEDDmaKI4");
- workbook.open(f);
- }
复制代码
Exception in thread "main" java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: java.io.EOFException: Unexpected end of ZLIB input stream
at com.grapecity.documents.excel.o.c.I.a(Unknown Source)
at com.grapecity.documents.excel.Workbook.a(Unknown Source)
at com.grapecity.documents.excel.Workbook.open(Unknown Source)
at com.grapecity.documents.excel.Workbook.open(Unknown Source)
at Main.xlsxParse(Main.java:100)
at Main.main(Main.java:66)
Caused by: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: java.io.EOFException: Unexpected end of ZLIB input stream
at com.grapecity.documents.excel.o.c.I.a(Unknown Source)
... 6 more
Caused by: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: java.io.EOFException: Unexpected end of ZLIB input stream
at com.grapecity.documents.excel.o.c.aw.a(Unknown Source)
at com.grapecity.documents.excel.o.c.at.a(Unknown Source)
at com.grapecity.documents.excel.o.c.at.a(Unknown Source)
at com.grapecity.documents.excel.o.c.I.a(Unknown Source)
... 7 more
Caused by: java.lang.IllegalArgumentException: java.io.EOFException: Unexpected end of ZLIB input stream
at com.grapecity.documents.excel.o.c.ab.u(Unknown Source)
at com.grapecity.documents.excel.o.c.ab.g(Unknown Source)
at com.grapecity.documents.excel.o.c.aw.a(Unknown Source)
... 11 more
Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:432)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
... 14 more
Disconnected from the target VM, address: '127.0.0.1:57116', transport: 'socket'
Process finished with exit code 1
xlsx文件,wps可以正常打开,gcexcel解析报错: Unexpected end of ZLIB input stream。这是什么原因?
|
最佳答案
查看完整内容
你这个是一xlsx文件吧。
我修改添加了xlsx后缀用,excel打开也会报错的,即使点击修复后也无法正常显示
而WPS能显示应该是它对其中的一些数据错误直接忽略了
进一步分析具体的错误原因
你可以解压这个xlsx文件,其中的sheet.xml中,下图这里的结构是错误的,前后标签对不上,所以gexcel和excel都无法打开
这个文件是从哪里生成的呢?你可以从源头排查一下问题
|