开发者社区> 问答> 正文

Grails 中导入Excel报错?报错



ERROR errors.GrailsExceptionResolver NoClassDefFoundError occurred when processing request: [POST] /abroadOnBusiness/employee/importer - parameters:
importing: true
_action_importer: 导入
Could not initialize class org.openxmlformats.schemas.drawingml.x2006.main.ThemeDocument. Stacktrace follows:
org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executing action [importer] of controller [org.bjzgh.system.EmployeeController]  caused exception: Runtime error executing action
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:200)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Runtime error executing action
... 5 more
Caused by: java.lang.reflect.InvocationTargetException
... 5 more
Caused by: org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:61)
at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:277)
at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:186)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:182)
at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:63)
at org.grails.plugins.excelimport.AbstractExcelImporter$$E0.read(AbstractExcelImporter.groovy:47)
at org.grails.plugins.excelimport.AbstractExcelImporter$$E0.read(AbstractExcelImporter.groovy:40)
at org.grails.plugins.excelimport.AbstractExcelImporter.<init>(AbstractExcelImporter.groovy:25)
at org.bjzgh.system.EmployeeExcelImporter.<init>(EmployeeExcelImporter.groovy:62)
at org.bjzgh.system.EmployeeController$$EOleKUlO.importer(EmployeeController.groovy:167)
... 5 more
Caused by: java.lang.reflect.InvocationTargetException
at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:59)
... 14 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.openxmlformats.schemas.drawingml.x2006.main.ThemeDocument
at org.apache.poi.xssf.model.ThemesTable.<init>(ThemesTable.java:39)
... 15 more

展开
收起
爱吃鱼的程序员 2020-06-15 19:32:04 2274 0
2 条回答
写回答
取消 提交回答
  • github.com/xuri

    推荐一个功能丰富、兼容性好、高性能的 Excel 文档基础库 Excelize: https://github.com/xuri/excelize

    2021-01-21 13:25:57
    赞同 1 展开评论 打赏
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    有回答的吗?

    2020-06-15 19:32:19
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载