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.
Problems with calling the jfree function
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
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
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


But why does it work if i run the file itself perfectly and doesnt work if i call it from other places?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.
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)
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
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
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Thanks for your fast replies.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.
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.