未捕获到 servlet OUTEXCEL 的其中一个服务方法中抛出的异常。抛出的异常:java.lang.NoClassDefFoundError: org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFileRecoveryPr

at java.lang.J9VMInternals.verifyImpl(Native Method)

at java.lang.J9VMInternals.verify(J9VMInternals.java:59)

at java.lang.J9VMInternals.initialize(J9VMInternals.java:120)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:521)

at org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createUnattachedNode(SchemaTypeImpl.java:1859)

at org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createTypeStoreUser(SchemaTypeImpl.java:1805)

at org.apache.xmlbeans.impl.store.Xobj.setStableType(Xobj.java:1390)

at org.apache.xmlbeans.impl.store.Cur.setType(Cur.java:2497)

at org.apache.xmlbeans.impl.store.Cur.setType(Cur.java:2482)

at org.apache.xmlbeans.impl.store.Locale.newInstance(Locale.java:630)

at org.apache.xmlbeans.impl.store.Locale.newInstance(Locale.java:606)

at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.newInstance(SchemaTypeLoaderBase.java:198)

经过确认,是由于poi使用的poi-ooxml-schemas是ooxml-schemas的精简版,所以在was服务器上导出Excel可能会报错,tomcat下面使用前者是没有问题的,此时需要统一jar包版本为ooxml-schemas.1.1.jar,这个ooxml-schemas有两个版本的jar包,一个是 POI 3.7,之前版本使用的ooxml-schemas-1.0.jar.另一个就是poi3.7以后版本使用的ooxml-schemas-1.1.jar,官网也说了这个问题:http://poi.apache.org/faq.html#faq-N10025,

here are two jar files available, as described in the components overview section. The full jar of all of the schemas is ooxml-schemas-1.1.jar, and it is currently around 15mb. The smaller poi-ooxml-schemas jar is only about 4mb. This latter jar file only contains the typically used parts though.

Note that for POI 3.5 and 3.6, the full ooxml schemas jar was named ooxml-schemas-1.0.jar. For POI 3.7, the filename was bumped to ooxml-schemas-1.1.jar when generics support was added. You can use ooxml-schemas-1.1.jar with POI 3.5 and 3.6 if you wish, but POI 3.7 won't wokr with ooxml-schemas-1.0.jar (it needs thew newer one).

意思很简单,把你的poi需要依赖的jar包给从

1.maven下解决方案如下:

<!--  适合Tomcat 的缩减版ooxml-schemas-3.9

<dependency>

<groupId>org.apache.poi</groupId>

<artifactId>poi-ooxml-schemas</artifactId>

<version>3.9</version>

</dependency>

-->

换成下面的

<dependency>

<groupId>org.apache.poi</groupId>

<artifactId>ooxml-schemas</artifactId>

<version>1.1</version>

</dependency>

重启服务,导出excel就ok了。

ps:poi3.9 一共需要如下几个jar包,才能正常工作。

1

转载于:https://www.cnblogs.com/ae6623/p/4416424.html

解决poi导出Excel异常org.openxmlformats.schemas.spreadshe相关推荐

  1. 解决C#导出excel异常来自 HRESULT:0x800A03EC的方法 .

    解决C#导出excel异常来自 HRESULT:0x800A03EC的方法 . 参考文章: (1)解决C#导出excel异常来自 HRESULT:0x800A03EC的方法 . (2)https:// ...

  2. 解决poi导出Excel文件打开警告(一)

    项目中需要导出Excel报表,使用poi导出Excel文件,添加依赖 <dependency><groupId>org.apache.poi</groupId>&l ...

  3. POI 导出excel带小数点的数字格式显示不对解决方法

    POI 导出excel带小数点的数字格式显示不对解决方法 参考文章: (1)POI 导出excel带小数点的数字格式显示不对解决方法 (2)https://www.cnblogs.com/firstd ...

  4. poi 导出excel(BigDecimal数据类型)左上角有绿色小三角解决

    在做poi导出excel肯定会有这么一段代码如下: public Cell addCell(Row row, int column, Object val, int align, Class<? ...

  5. POI导出Excel设置背景色踩坑,解决背景色全黑(无效)的问题及指定列添加背景色,自定义颜色

    POI导出Excel设置背景色踩坑,解决背景色全黑的问题及指定列添加背景色,自定义颜色 一.自定义颜色 二.背景色全黑(无效)的问题解决![在这里插入图片描述](https://img-blog.cs ...

  6. POI导出Excel遇到数据量大该如何解决

    最近在使用Java POI导出Excel,使用的是XSSFWorkbook ,遇到数据量超过10w的话程序会爆内存溢出的错误,将XSSFWorkbook 换成SXSSFWorkbook 即可 SXSS ...

  7. POI java.lang.NoSuchMethodError: org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont.addNewFa

    经过测试,跟本项目 报错一致 Java 用POI导出Excel失败,报错如下: java.lang.NoSuchMethodError: org.openxmlformats.schemas.spre ...

  8. Springboot整合Poi导出excel(简单版)

    一. 问题引入 博客专栏: Springboot整合Poi导出excel(简单版) Springboot整合Poi导出excel(注解版) 总所周知Springboot是一个功能强大的微服务框架,集成 ...

  9. POI导出Excel (满满的干货啊)

    已经实现的POI导出Excel 步骤一:导入依赖 <dependency><groupId>org.apache.poi</groupId><artifact ...

  10. java中poi导出Excel表格(前台流文件接收)

    java中poi导出Excel表格,前端以流的方式接收,而非直接生成文件再下载,解决多台服务器部署后,路径地址不统一导致的下载问题. 生成Excel示例图: 2.代码说明 ① 在上次的基础上增加了底部 ...

最新文章

  1. 我招了个“水货”程序员
  2. 运用Kubernetes进行分布式负载测试
  3. 代码重构阅读心得[转]
  4. 天翼云认证--大纲介绍
  5. windows下使用git管理github项目
  6. Union-Find 并查集算法详解
  7. java对象实例_深入理解Java对象实例生成的例子!(转)
  8. python 线程, GIL 和 ctypes
  9. python和java哪个好学-Python和Java对比,全面解读哪个语言最赚钱,前景最好?
  10. Hibernate_01_初体验
  11. html设置桌面背景win7,win7电脑桌面背景怎么设置_win7电脑桌面壁纸怎么设置-win7之家...
  12. 下载Googleearth地图作为底图显示曝光点
  13. 最近游戏更新 未整理 无图片
  14. Safari 浏览器扩展安装后未显示
  15. 公司财务系统html,什么是sap管理系统?
  16. vxworks下的脚本script创建和使用(相当于windows下的autoexec.bat)
  17. 空口协议probe req和probe rsp 、auth req和auth rsp 、assoc req和assoc rsp讲解
  18. mysql的tps和qps_关于MySQL的TPS和QPS
  19. Linux-Ubuntu终端命令
  20. 解决one-stage目标检测正负样本不均衡的另类方法--Gradient Harmonized

热门文章

  1. 让 Flutter 在鸿蒙系统上跑起来
  2. 转账功能怎么测试?以支付宝转账到银行卡为例
  3. 2021年最佳Selenium替代品
  4. 弯头lisp_(最全的)管道材料代号说明
  5. 集团税务共享化、数字化系统如何选型(一)
  6. php 上传微信客服头像,微信多客服上传头像
  7. Codeforces Round #512 (Div. 2, based on Technocup 2019 Elimination Round 1) E. Vasya and Good Sequen
  8. 用python画一个机器猫歌词_Python实现海贼王的歌词组成词云图
  9. mc服务器资源包在什么文件夹,教程/制作资源包 _ 《我的世界》中文Minecraft Wiki:最详细的官方我的世界百科...
  10. 解决XML转JSON串时报错:Exception in thread main java.lang.NoClassDefFoundError: nu/xom/Serializer