ITPub博客

首页 > > > 在controller接受xlsx文件,

在controller接受xlsx文件,

作者:founderwzh 时间:2019-08-28 14:17:37 0 删除 编辑

在controller接受xlsx文件,后台将其转换成stream流后用WorkbookFactor



步骤:

html提交xlsx文件

controller层能接受MultipartFile文件,并转换成inputstream流扔给business(service)层处理

business(service)层

Workbook wb = WorkbookFactory.create(is);

这一句报错,如下

这是在断点情况下报错提示:

[img=https://img-bbs.csdn.net/upload/201902/13/1550067977_839231.png][/img]

[img=https://img-bbs.csdn.net/upload/201902/13/1550068039_316973.png][/img]

再点击下一步会进入这个抛出的异常

[img=https://img-bbs.csdn.net/upload/201902/13/1550068930_659047.png][/img]

这个是完整运行后的报错提示

严重: Servlet.service() for servlet [app-servlet] in context with path [] threw exception [Handler processing failed; nested exception is java.lang.NoClassDefFoundError: org/openxmlformats/schemas/spreadsheetml/x2006/main/CTSheet] with root cause

java.lang.ClassNotFoundException: org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheet

....

严重: Servlet.service() for servlet app-servlet threw exception

org.apache.shiro.UnavailableSecurityManagerException: No SecurityManager accessible to the calling code, either bound to the org.apache.shiro.util.ThreadContext or as a vm static singleton. This is an invalid application configuration.

at org.apache.shiro.SecurityUtils.getSecurityManager(SecurityUtils.java:123)

....

头很大,不知道问题出在哪,求教!

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4605/viewspace-3135618/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-07-10

  • 博文量
    159
  • 访问量
    738