起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7588|回复: 2

[结贴] javapoi相同类型报转换错误

[复制链接]

20

主题

50

帖子

206

积分

中级会员

Rank: 3Rank: 3

积分
206
QQ
发表于 2021-9-17 14:18:14 | 显示全部楼层 |阅读模式
版本: 小版本号:
数据库: 服务器操作系统: 应用服务器:
客户端操作系统: 浏览器:
XSSFWorkbook workBook = (XSSFWorkbook ) ModelUtils.getRequestContext().getActionContext().getParameter("excel");这句api报错
2021-09-17 14:12:49 excute stream action, params:{"accept":"application/json","action":"importExcel","actionFlag":"__action_0__","activity":"mainActivity","contentType":"json","executeContext":"","executor":"","parameters":{"config":{"@type":"xml","xml":"<config use-default=\"true\" to=\"UI\" excel-file=\"E:\\WorkSpace\\BeX5_V3.8\\apache-tomcat\\temp\\cb622b95-1ba9-4a45-9095-2287e3521900.excel.tmp\" mapping-file=\"E:\\WorkSpace\\BeX5_V3.8\\apache-tomcat\\temp\\3bd56383-e7e7-42a7-b811-a12cfcca9bc7.excel.tmp\"><data><concept name=\"HR_BM_AwardTarget\"><relation name=\"FHSDX\" type=\"String\"/><relation name=\"FHSDXID\" type=\"String\"/><relation name=\"FHSDXTYPE\" type=\"String\"/><relation name=\"HR_BM_AwardTarget\" type=\"String\"/><relation name=\"amount\" type=\"Decimal\"/><relation name=\"awardCode\" type=\"String\"/><relation name=\"manager\" type=\"String\"/><relation name=\"profitUnit\" type=\"String\"/><relation name=\"version\" type=\"Integer\"/></concept></data></config>"},"createActionParam":{"action":"createHR_BM_AwardTargetAction","activity":"mainActivity","parameters":{"table":{"@type":"table","rows":[],"userdata":{"idColumnDefine":"HR_BM_AwardTarget","idColumnName":"HR_BM_AwardTarget","idColumnType":"String","model":"/HR/bonusMng/data","relationAlias":"FHSDX,FHSDXID,FHSDXTYPE,amount,awardCode,manager,profitUnit,version","relationTypes":"String,String,String,Decimal,String,String,String,Integer","relations":"HR_BM_AwardTarget.FHSDX,HR_BM_AwardTarget.FHSDXID,HR_BM_AwardTarget.FHSDXTYPE,HR_BM_AwardTarget.amount,HR_BM_AwardTarget.awardCode,HR_BM_AwardTarget.manager,HR_BM_AwardTarget.profitUnit,HR_BM_AwardTarget.version","updateMode":"whereVersion"}}},"process":"/HR/bonusMng/process/award/awardProcess"}},"process":"/HR/bonusMng/process/award/awardProcess"}
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.justep.system.action.Engine.invokeActions(Native Method)
        at com.justep.system.action.Engine.invokeActions(Unknown Source)
        at com.justep.business.server.BusinessServer.doAction(Unknown Source)
        at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.justep.micro.service.MicroServiceFilter.doFilter(Unknown Source)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.justep.system.action.Engine.invokeAction(Native Method)
        at com.justep.system.action.Engine.invokeAction(Unknown Source)
        at com.justep.model.impl.UtilImplementInstance.invokeAction(Unknown Source)
        at com.justep.system.action.ActionUtils.invokeAction(Unknown Source)
        at com.justep.excel.ImportGenerator.generate(ImportGenerator.java:140)
        at Excel.importExcel(Excel.java:90)
        ... 30 more
Caused by: java.lang.ClassCastException: org.apache.poi.xssf.usermodel.XSSFWorkbook cannot be cast to org.apache.poi.xssf.usermodel.XSSFWorkbook
        at AwardProcess.awardProcessAfterImportExcelAfterAction(AwardProcess.java:92)
        ... 40 more

1631859185(1).jpg

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36069
发表于 2021-9-18 18:13:18 | 显示全部楼层
确认构建路径中是不是有其他版本的poi相关的jar有冲突
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

20

主题

50

帖子

206

积分

中级会员

Rank: 3Rank: 3

积分
206
QQ
 楼主| 发表于 2021-9-22 08:35:36 | 显示全部楼层
已解决,请结帖
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-11-27 11:33 , Processed in 0.073876 second(s), 28 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表