Problem with JFreechart

一个基于Tomcat的程序里面用到了JFreeChart,偶尔用浏览器访问时,PC端安装的XManager的XServer会自动的打开,然后Tomcat就莫名其妙的挂掉。在没有安装XManager的PC上通常就不会出这种情况。查看一下log,如下:

Can’t connect to X11 window server using ‘:0.0′ as the value of the DISPLAY variable.

搜之,此乃awt的bug。加入以下参数启动即可:

-Djava.awt.handless=true

如果是Tomcat,把上面的参数加到环境变量:CATALINA_OTPS里即可。

[ad]

Switch to our mobile site