`
kavy
  • 浏览: 868154 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Could not initialize class org.jfree.chart.JFreeChart

    博客分类:
  • web
 
阅读更多

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" 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics