我请问一下jfreeChart的问题

04-07-15 unicorn

我在windows下用jfreeChart显示没有问题,但是把jfreechart包放到linux上就报错了,所有类都找得到,显示如下,我得服务器是apache+resin

500 Servlet Exception

java.lang.NoClassDefFoundError

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:140)

at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)

at java.awt.Font.initializeFont(Font.java:309)

at java.awt.Font.<init>(Font.java:345)

at org.jfree.chart.plot.Plot.<init>(Plot.java:243)

at org.jfree.chart.plot.PolarPlot.<init>(PolarPlot.java:183)

at org.jfree.chart.plot.PolarPlot.<init>(PolarPlot.java:169)

at org.jfree.chart.ChartFactory.createPolarChart(ChartFactory.java:1009)

at untitled.CreatPriceChart.createChart(CreatPriceChart.java:76)

at untitled.CreatPriceChart.saveChart(CreatPriceChart.java:38)

at untitled.Untitled1.testCreatXYChart(Untitled1.java:17)

at _testline__jsp._jspService(/testline.jsp:12)

at com.caucho.jsp.JavaPage.service(JavaPage.java:75)

at com.caucho.jsp.Page.subservice(Page.java:506)

at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)

at com.caucho.server.http.Invocation.service(Invocation.java:315)

at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)

at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:344)

at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)

at com.caucho.server.TcpConnection.run(TcpConnection.java:139)

at java.lang.Thread.run(Thread.java:536)

好像是图形环境的问题??请问怎么解决?

stephen
2004-11-10 12:47

修改resin/bin/下面的wrapper.pl中的一行

$JAVA_ARGS="-Djava.awt.headless=true";