jasperreport 6.0 导出 excel 异常
文章目录
做一个jasperreport6 导出excel的功能时,出现一个问题,在测试环境(centos7)正常,发到客户环境(centos7)后异常,最开始为:
Handler processing failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser
查看tomcat9中项目中的lib下有重复版本jar包,处理以后重启,报
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
java.lang.InternalError: Cant connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
最终解决办法为:
在tomcat启动脚本 start.sh 中加入:export CATALINA\_OPTS="-Djava.awt.headless=true" 
参见:
https://blog.csdn.net/xgjians...

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论