论坛首页 Java企业应用论坛

请教:JAVA读取word流异常:Unable to read entire block

浏览 3336 次
该帖已经被评为隐藏帖
作者 正文
   发表时间:2008-05-30  
请问在JAVA 用POI 在读取Oracle数据库中的Blob word文件时报如下错误,该如何解决,有的读取时没有问题,有的就会报这样的错误.
异常如下:
java.io.IOException: Unable to read entire block; 2 bytes read; expected 512 bytes
at org.apache.poi.poifs.storage.RawDataBlock.<init>(RawDataBlock.java:68)
at org.apache.poi.poifs.storage.RawDataBlockList.<init>(RawDataBlockList.java:52)
at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:87)
at org.textmining.extraction.word.WordTextExtractor.initWordHeader(Unknown Source)
at org.textmining.extraction.word.Word97TextExtractor.<init>(Unknown Source)
at Timing.ReadWord.ReadWord(ReadWord.java:15)
at Timing.GetInfo.ReadWord(GetInfo.java:11)
at Timing.TimingMaster.RunGongGao(TimingMaster.java:783)
at Timing.TimingMaster.main(TimingMaster.java:49)

在网上看了下,说这个POI的一个BUG,也照所说的方法试了但也不行
http://www.blogjava.net/alex/archive/2006/08/10/62823.html

另外有的还会报这样的错误:
java.io.IOException: Invalid header signature; read 7311066695147732796, expected -2226271756974174256
at org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockReader.java:100)
at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:84)
at org.textmining.extraction.word.WordTextExtractor.initWordHeader(Unknown Source)
at org.textmining.extraction.word.Word97TextExtractor.<init>(Unknown Source)
at Timing.ReadWord.ReadWord(ReadWord.java:15)
at Timing.GetInfo.ReadWord(GetInfo.java:11)

哪位高手遇到过这样问题,有什么好的解决方案吗.
谢谢.

论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics