Problems with calling the jfree function

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
lebtho
Posts: 7
Joined: Fri Jul 21, 2006 2:36 pm

Problems with calling the jfree function

Post by lebtho » Fri Jul 21, 2006 2:48 pm

I want to show a line chart in a jsp. Everything went well. But i´m not able to call the function where i create the chart from my programmed servlet controller. If i run the funtion for itsself it works but every time when i call the function from my servlet controller an error ocured.

java.lang.NoClassDefFoundError: org/jfree/ui/Spacer

I dont understand why the function works alone but not in the case if i call it from another place.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Fri Jul 21, 2006 2:52 pm

The Spacer class is from an older (pre 1.0.0) version of JFreeChart. So my guess is that you have different versions of JFreeChart installed on your systems.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

lebtho
Posts: 7
Joined: Fri Jul 21, 2006 2:36 pm

Post by lebtho » Fri Jul 21, 2006 3:10 pm

david.gilbert wrote:The Spacer class is from an older (pre 1.0.0) version of JFreeChart. So my guess is that you have different versions of JFreeChart installed on your systems.
But why does it work if i run the file itself perfectly and doesnt work if i call it from other places?
The whole error is:
java.lang.NoClassDefFoundError: org/jfree/ui/Spacer
org.jfree.chart.plot.XYPlot.<init>(XYPlot.java:400)
org.jfree.chart.ChartFactory.createXYLineChart(ChartFactory.java:1340)
Plots.Lininendiagramm.generierenLiniendiagramm(Lininendiagramm.java:76)
servlet.Controller.chart(Controller.java:118)
servlet.Controller.processRequest(Controller.java:65)
servlet.Controller.doGet(Controller.java:217)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Fri Jul 21, 2006 3:15 pm

What do you mean by "other places"? Maybe in "other places" your classpath is different? In fact, it must be, otherwise you wouldn't get this error.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

lebtho
Posts: 7
Joined: Fri Jul 21, 2006 2:36 pm

Post by lebtho » Fri Jul 21, 2006 4:00 pm

david.gilbert wrote:What do you mean by "other places"? Maybe in "other places" your classpath is different? In fact, it must be, otherwise you wouldn't get this error.
Thanks for your fast replies.

I mean two different classes but the same projekt folder. The one class reflects the servlet controller an the other the chart generation. Al packages are imported. In the class servlet controller i called the function from the class diagramm generation which generates the chart and the the error occurs. If i run the class diagramm generation for itself it works otherwise not.

Locked