NutzCN Logo
问答 使用nutz框架,导出excel文件的时候,出现异常,求助!
发布于 2637天前 作者 qq_6427b776 2456 次浏览 复制 上一个帖子 下一个帖子
标签:

1、这是方法体。
/**
* 导出资产组Excel
* @param request
* @param response
* @param ioc
* @param exportGroupId zTree的NodeID
* @param exportViewType 资产视图类型
*/
@At("/exportExcel")
@Ok("dl:${obj.name}")
@Log(isEnabled = false)
@Fail("error")
public synchronized File exportExcel(HttpServletRequest request,HttpServletResponse response, Ioc ioc
,@Param("type")String type,@Param("timeType")String timeType ) {
}

2、这个dataList的大小为34000多,来到这里就报异常跳出。
java.lang.IllegalArgumentException: Invalid row number (-32767) outside allowable range (0..65535),看到异常的时候为什么是-32767?
3、因为我最后是返回一个文件File类型excel,98版的xls,我断点捕捉到是null,所以报以下异常。
org.nutz.el.ElException: obj is NULL, can't call obj.name
at org.nutz.el.opt.object.AccessOpt.calculate(AccessOpt.java:30)
at org.nutz.el.arithmetic.RPN.calculate(RPN.java:55)
at org.nutz.el.arithmetic.RPN.calculate(RPN.java:38)
at org.nutz.el.El.eval(El.java:30)
at com.venustech.tsoc.cupid.commons.mvc.view.DownloadView.evalPath(SourceFile:119)
at com.venustech.tsoc.cupid.commons.mvc.view.DownloadView.render(SourceFile:98)
at org.nutz.mvc.impl.processor.ViewProcessor.process(ViewProcessor.java:38)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:24)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at com.venustech.tsoc.cupid.AccessControlProcessor.process(SourceFile:127)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at com.venustech.tsoc.cupid.logging.LoggingProcessor.process(SourceFile:71)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:40)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:85)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:64)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:101)
at com.venustech.tsoc.CupidNutFilter.doFilter(SourceFile:69)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:931)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

最后,这个问题该如何解决?

4 回复

贴IllegalArgumentException那个异常的报错信息

java.lang.IllegalArgumentException: Invalid row number (-32767) outside allowable range (0..65535)

完整报错信息,日志里面打印出来的?

原因就是代码里面有short强制转换

添加回复
请先登陆
回到顶部