Could not initialize class org.jfree.chart.JFreeChart

On linux servers:Could not initialize class org.jfree.chart.JFreeChart

On linux servers, some people have reported a problem after a successful install, once their server is in use. They report that Web-CAT produces unexpected exceptions when you visit any pages that contain charts, such as those graphing student results. The Web-CAT exception page cites the following Java exception:

Error: java.lang.NoClassDefFoundError
Reason: Could not initialize class org.jfree.chart.JFreeChart

Or possibly:

Error: java.lang.NoClassDefFoundError
Reason: Could not initialize class sun.awt.X11GraphicsEnvironment

If this occurs, check the environment variables for the pseudo-user under which Tomcat is running. Check for any definition for the DISPLAY environment variable that is visible to Tomcat, an remove any such definitions.

This problem appears to be caused internally in Sun's AWT implementation, where Java is trying to connect to the X11 display identified by the DISPLAY environment variable, but the user id under which Tomcat is running does not have permission to connect (or there is no active DISPLAY). Removing the environment variable setting for the Tomcat user will fix this problem. You may also need to add -Djava.awt.headless=true to Tomcat's startup arguments as well.

 

eq:

 I did a ps -ef | grep headless command to look at how tomcat was started and I found that this was passed in instead (with an extra ? on the end):

-Djava.awt.headless=true?

if don't have it,we should:

export  CATALINA_OPTS="-Djava.awt.headless=true" 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值