Invalid header signature; read 0x6D78206C6D74683C, expected 0xE11AB1A1E011CFD0 (2012-07-19 17:01:21)

分析:POI读取Excel文件时报错。

通常的原因:是读取的文件头信息不对,

http://blog.sina.com.cn/robertlizhiqiang

经常出现在:

         FileInputStream in = null;

                   HSSFWorkbook workbook = null;

                   in = new FileInputStream(map.get("path"));

                   POIFSFileSystem fs = new POIFSFileSystem(in);

                   workbook = new HSSFWorkbook(fs);

的这一行:POIFSFileSystem fs = new POIFSFileSystem(in);后面

http://blog.sina.com.cn/robertlizhiqiang

检查原因是:

可能是类似于将txt文件 或者HTML等其它文件的后缀名直接改成xls

或者由其他软件导出成的Excel(那导出的软件本身写的不好),

解决办法:从文件下手(羊毛出在羊身上),需要用Excel打开(如果能打的开的话)然后另存为一下,就可以读取了

http://blog.sina.com.cn/robertlizhiqiang

其它类似报错信息:

java.io.IOException: Invalid header signature; read 4503608217567241, expected -2226271756974174256

invalid LOC header (bad signature) 求解决

12-17

严重: Unable to process Jar entry [com/google/common/collect/Iterators$6.class] from Jar [jar:file:/C:/Users/Administrator/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Demo1/WEB-INF/lib/guava-15.0.jar!/] for annotationsnjava.util.zip.ZipException: invalid LOC header (bad signature)n at java.util.zip.ZipFile.read(Native Method)n at java.util.zip.ZipFile.access$1400(ZipFile.java:60)n at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:717)n at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:419)n at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)n at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)n at java.io.BufferedInputStream.read(BufferedInputStream.java:265)n at java.io.DataInputStream.readInt(DataInputStream.java:387)n at org.apache.tomcat.util.bcel.classfile.ClassParser.readID(ClassParser.java:201)n at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:80)n at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2089)n at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1965)n at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1931)n at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1916)n at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1330)n at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:889)n at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:386)n at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)n at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)n at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5405)n at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)n at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)n at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)n at java.util.concurrent.FutureTask.run(FutureTask.java:266)n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)n at java.lang.Thread.run(Thread.java:745)n

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试