- [ INFO ] 导入文件名称为:LBS2设备导入模板.xls2013-08-13 09:23:06 [ http-bio-8080-exec-7:52188 ] - [ INFO ] 导入文件大小为:13824 bytesjxl.read.biff.BiffException: Unable to recognize OLE stream2013-08-13 09:23:06 [ http-bio-8080-exec-7:52219 ] - [ INFO ] 导入文件--数据上传----------开始!!at jxl.read.biff.CompoundFile.程序异常产生代码:(CompoundFile.java:116)at jxl.read.biff.File. (File.java:127)at jxl.Workbook.getWorkbook(Workbook.java:268)at jxl.Workbook.getWorkbook(Workbook.java:253)at com.kvt.lbs.utils.ExportTableManager.readExcel2DeviceMember(ExportTableManager.java:437)at com.kvt.lbs.system.action.DeviceAction.importExcel(DeviceAction.java:496)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Workbook book = null;List2、POI方式导入ldm = new ArrayList ();DeviceMember dm = null;String result = null;Sheet sheet = null;try{ book = Workbook.getWorkbook(stream);//here is it //................}//.................
[ INFO ] 导入文件名称为:LBS2设备导入模板.xls 本地地址:192.168.20.482013-08-13 10:42:49 [ http-bio-8080-exec-2:46516 ] - [ INFO ] 导入文件大小为:13824 bytes2013-08-13 10:42:49 [ http-bio-8080-exec-2:46594 ] - [ ERROR ] Invalid header signature; read 0x005301AD65231462, expected 0xE11AB1A1E011CFD02013-08-13 10:42:49 [ http-bio-8080-exec-2:46594 ] - [ INFO ] 导入文件--数据上传----------开始!!程序异常产生代码:
DeviceMember deviceMember = null;HSSFWorkbook hssfWorkbook = null;List看到上面的异常了吧,很是令人郁闷 @_@ !! 后来找了很多网上大家的解决方案,最多的就是重新将Excel文件“另存为”一个新的Excel文件就解决了,但是我的不行,最后才想起公司的文档都是加了密的,一直没往这上面想,咨询同事才知道以前有人也遇到过,故此记录以知迷途。一家英文网站上的也是这么解决的。可以参考:list = new ArrayList ();try{ hssfWorkbook = new HSSFWorkbook(ins);//here is it //..................}//......................