http://blog.csdn.net/llwan/article/details/8890190

——————————————————————————————————————————————————————————————————————————————————

public static Workbook create(InputStream in) throws
IOException,InvalidFormatException {
if (!in.markSupported()) {
in = new PushbackInputStream(in, 8);
}
if (POIFSFileSystem.hasPOIFSHeader(in)) {
return new HSSFWorkbook(in);
}
if (POIXMLDocument.hasOOXMLHeader(in)) {
return new XSSFWorkbook(OPCPackage.open(in));
}
throw new IllegalArgumentException("你的excel版本目前poi解析不了"); }
读写xls和xlsx格式时,HSSFWorkbook针对xls,XSSFWorkbook针对xlsx

解决异常:Package should contain a content type part [M1.13]的更多相关文章

  1. Java之POI读取Excel的Package should contain a content type part [M1.13]] with root cause异常问题解决

    Java之POI读取Excel的Package should contain a content type part [M1.13]] with root cause异常问题解决 引言: 在Java中 ...

  2. Content type 'application/json;charset=UTF-8' not supported异常的解决过程

    首先说一下当时的场景,其实就是一个很简单的添加操作,后台传递的值是json格式的,如下图 ,后台对应的实体类, @Data @EqualsAndHashCode(callSuper = false) ...

  3. jmeter报"msg":"Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported"的解决方法

    1.报"msg":"Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supporte ...

  4. org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'multipart/form-data;boundary=----WebKitFormBoundaryRAYPKeHKTYSNdzc1;charset=UTF-8' not supported

    原文:https://www.cnblogs.com/yueli/p/7552888.html 最近同事在做一个图片上传功能.在入参 body 中同时传入文件和其它基本信息结果出现如题异常.在此记录下 ...

  5. org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported或其他Content type不支持处理

    很久没从头到尾搭框架,今天搭的过程中,springmvc controller方法入参用@RequestBody自动绑定参数时一直提示各种 not supported 排查问题有两个解决路径: 1)使 ...

  6. Element 'dependencies' cannot have character[children],because the type's content type is elemen

    问题描述: Element 'xxxxxxx' cannot have character [children],because the type's content type is element- ...

  7. Jsoup问题---获取http协议请求失败 org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or application/xhtml+xml.

    Jsoup问题---获取http协议请求失败 1.问题:用Jsoup在获取一些网站的数据时,起初获取很顺利,但是在访问某浪的数据是Jsoup报错,应该是请求头里面的请求类型(ContextType)不 ...

  8. Jsoup获取部分页面数据失败 org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or application/xhtml+xml.

    用Jsoup在获取一些网站的数据时,起初获取很顺利,但是在访问某浪的数据是Jsoup报错,应该是请求头里面的请求类型(ContextType)不符合要求. 请求代码如下: private static ...

  9. Springs Element 'beans' cannot have character [children], because the type's content type is element-only

    Springs Element 'beans' cannot have character [children], because the type's content type is element ...

随机推荐

  1. ExtAspNet下通过文档路径实现文档的下载

    <ext:Button ID="Button1" runat="server" Text="Button" OnClick=" ...

  2. u32、u16、u8 数据类型

    #define U32 unsigned int #define U16 unsigned short #define S32 int #define S16 short int #define U8 ...

  3. 开发移动 APP 时,你应注意这 5 个细节

    智能手机的普及带动了大批移动应用的诞生,这些应用能够帮助人们解决日常生活所面临的种种问题.Smart Insights 发表的一份报告指出,移动应用占人们使用智能手机总时间的89%,因此,为了确保你所 ...

  4. mindmanager2018优化

      mindmanager2018优化 CreationTime--2018年6月6日09:35:02 Author:Marydon 1.点击“文件”-“选项”进入配置界面,在“常规”选项中,建议勾选 ...

  5. 35 、HashSet详解

    HashSet特点 1.不能保证元素的排列顺序 2.没有重复元素 3.HashSet不是同步的,多个线程同时访问一个HashSet,需要通过代码来保持同步 4.集合元素可以是null 当向HashSe ...

  6. ADexplorer - 用来查看AD的工具

    ADExplorer是一款可以帮助查看和编辑数据库的软件.该数据库查看编辑器使用方便,操作简单,用户可通过该软件进行浏览AD数据库.自定义快速入口.查看对象属性.编辑权限.精确搜索等操作,还可以保存数 ...

  7. 微信小程序项目实战之豆瓣天气

    概述 微信小程序项目实战之豆瓣天气 详细 代码下载:http://www.demodashi.com/demo/10943.html 一.准备工作 1.注册微信小程序 2.在小程序设置中设置reque ...

  8. CSS:给 input 中 type="text" 设置CSS样式

    input[type="text"], input[type="password"] {    border: 1px solid #ccc;    paddi ...

  9. webqq协议分析之~~~~登陆

    最近好几个新项目积一起了,比较忙,所以博客迟迟未更新,还请各位见谅!下面来继续分析webqq协议,本章将说明如何实现登陆 1:输入QQ号和密码登陆,检测HTTP请求url如下,这是第一次登陆 http ...

  10. c#中用DirectShow实现媒体播放器

    原文地址:https://www.cnblogs.com/aiqingqing/p/4338448.html 用.net做多媒体开发的似乎不多,所以网上资源也少,看的人更少.不过我的博客上居然还有几位 ...