When i generate the JfreeChart in servlet, then the browser generate the follow error! what does it mean! How to solve it? Thankx
Error: 500
Location: /~leo/webit/servlet/com.AreaChart
Internal Servlet Error:
java.lang.NoClassDefFoundError
at com.jrefinery.chart.HorizontalNumberAxis.(Unknown Source)
at com.jrefinery.chart.ChartFactory.createAreaXYChart(Unknown Source)
at com.AreaChart.doGet(AreaChart.java:61)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:806)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:752)
at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
Servlet problem in browser
Re: Servlet problem in browser
Well, it is having trouble finding some class while it is creating a HorizontalNumberAxis. My initial thought is that you don't have the JCommon jar file on your classpath, but then I wonder if you would have got past the createAreaXYChart method in that case.
What version are you using? Are they the standard jar files, or have you rebuilt them yourself?
Regards,
DG.
What version are you using? Are they the standard jar files, or have you rebuilt them yourself?
Regards,
DG.
Re: Servlet problem in browser
It looks like I am running into the same sort of problem. What platform are you running on?
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName0(Compiled Code)
at java.lang.Class.forName(Compiled Code)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:63)
at java.awt.Font.initializeFont(Font.java:262)
at java.awt.Font.(Font.java:292)
at
at com.jrefinery.chart.HorizontalDateAxis.(Unknown Source)
at com.jrefinery.chart.ChartFactory.createTimeSeriesChart(Unknown Source)
at ChartFactory.getChart(Compiled Code)
at ChartFactory.doPost(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(Compiled Code)
at com.iplanet.server.http.servlet.WebApplication.service(Compiled Code)
at com.iplanet.server.http.servlet.NSServletRunner.ServiceWebApp(Compiled Code)
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName0(Compiled Code)
at java.lang.Class.forName(Compiled Code)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:63)
at java.awt.Font.initializeFont(Font.java:262)
at java.awt.Font.(Font.java:292)
at
at com.jrefinery.chart.HorizontalDateAxis.(Unknown Source)
at com.jrefinery.chart.ChartFactory.createTimeSeriesChart(Unknown Source)
at ChartFactory.getChart(Compiled Code)
at ChartFactory.doPost(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(Compiled Code)
at com.iplanet.server.http.servlet.WebApplication.service(Compiled Code)
at com.iplanet.server.http.servlet.NSServletRunner.ServiceWebApp(Compiled Code)
Re: Servlet problem in browser
That sounds like you don't have X11 running...a requirement for using Java2D in JDK 1.3 and earlier (JDK1.4 I believe has a "headless" mode that gets around this). Search for "X11" in this forum for other information.
Regards,
DG.
Regards,
DG.
Re: Servlet problem in browser
I`m running in linux! I had solved this problem. Maybe you had to restart the tomcat engine and it is better to use jdk1.3 or later version. Maybe you can look out the class and import the X11GraphicsEnvironment.
Re: Servlet problem in browser
Carey,
I'm running JFreeChart on a Linux server with no X11 by using JDK 1.4 and adding the folling line to my main method:
System.setProperty("java.awt.headless","true");
If you are using servlets, you can use also set headless=true at the command line:
-Djava.awt.headless=true
Hope this helps someone!
-Ray
I'm running JFreeChart on a Linux server with no X11 by using JDK 1.4 and adding the folling line to my main method:
System.setProperty("java.awt.headless","true");
If you are using servlets, you can use also set headless=true at the command line:
-Djava.awt.headless=true
Hope this helps someone!
-Ray