Servlet problem in browser

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Leo

Servlet problem in browser

Post by Leo » Wed Jun 19, 2002 6:48 am

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)

David Gilbert

Re: Servlet problem in browser

Post by David Gilbert » Wed Jun 19, 2002 8:35 am

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.

Carey Neely

Re: Servlet problem in browser

Post by Carey Neely » Wed Jun 19, 2002 10:14 pm

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)

David Gilbert

Re: Servlet problem in browser

Post by David Gilbert » Wed Jun 19, 2002 10:26 pm

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.

Leo

Re: Servlet problem in browser

Post by Leo » Thu Jun 20, 2002 3:59 am

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.

Ray Mercer

Re: Servlet problem in browser

Post by Ray Mercer » Thu Jun 20, 2002 6:02 am

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

Locked