ClassNotFound error - ChartLineGraphGenerator

  • Meghan Pietila

    Meghan Pietila - 2008-06-25

    We've got this set up on 2 Windows Weblogic instances and it's working beautifully, but in our Unix environment we're getting a ClassNotFound on the ChartLineGraphGenerator.  Any ideas?  I'm using the most recent WAR file from SourceForge (with the exception of username changes since we don't have the weblogic user in our environments).

        at domainhealth.display.ChartLineGraphGenerator.writeGraphImage(
        at domainhealth.display.LineChartServlet.processs(
        at domainhealth.display.LineChartServlet.doGet(
        at javax.servlet.http.HttpServlet.service(
        at javax.servlet.http.HttpServlet.service(
        at weblogic.servlet.internal.StubSecurityHelper$
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(
        at weblogic.servlet.internal.ServletStubImpl.execute(
        at weblogic.servlet.internal.ServletStubImpl.execute(
        at weblogic.servlet.internal.WebAppServletContext$
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(
        at weblogic.servlet.internal.WebAppServletContext.execute(

    Wonderful tool, by the way, you have my heartfelt thanks for sharing this!!

    Granite Consulting, Inc.

    • Paul Done

      Paul Done - 2008-06-26

      Hi Meghan

      I've just checked the source code for method where the NoClassDef occurs and it is:

      public void writeGraphImage(OutputStream out) throws IOException {
          ValueAxis xAxis = new DateAxis(WebLogicMBeanProps.units(WebLogicMBeanProps.DATE_TIME));
          NumberAxis yAxis = new NumberAxis(yAxisUnits);
          XYPlot xyPlotLine = new XYPlot(xySeriesCollection, xAxis, yAxis, new StandardXYItemRenderer(StandardXYItemRenderer.LINES));       
          JFreeChart chart = new JFreeChart(chartTitle, JFreeChart.DEFAULT_TITLE_FONT, xyPlotLine, true);
          BufferedImage graphImage = chart.createBufferedImage(500, 300, new ChartRenderingInfo(new StandardEntityCollection()));       
          ChartUtilities.writeBufferedImageAsPNG(out, graphImage); // Could try extra two PNG related params: encodeAlpha and compression

      Line 95 is:

      JFreeChart chart = new JFreeChart(chartTitle, JFreeChart.DEFAULT_TITLE_FONT, xyPlotLine, true);

      So it looks like a problem with the class loader locating the class 'JFreeChart'. The import statement for this class is:

      import org.jfree.chart.JFreeChart;

      This class should be contained in the jar 'jfreechart-1.0.9.jar' which in turn should be contained in the path 'WEB-INF/lib' of the domain-health-07.war. Can you check that when you repackaged up war, that the jfreechart jar was included with the correct path and within the jfreechart jar, the JFreeChart class is listed with the relative path of 'org/jfree/chart'.

      What is strange is that the NoClassDef error does not occur earlier in the method for other jfreechart classes like: org.jfree.chart.axis.ValueAxis.

      I have successfully tested in both a Linux and a Solaris environment and I know of at least one client running it in production on Solaris. What exact OS are you running and what version, what JVM and version and what WLS version?

      Also can you tell me the full CLASSPATH that is printed out when you started WLS, in case there is some sort of PRE_CLASSPATH clash.



    • Meghan Pietila

      Meghan Pietila - 2008-07-16

      Thanks for getting back to me, Paul.  The project got busy and I wasn't able to get back the forums until today.

      I did double-check the WAR file that I am deploying on that server, and the jfreechart-1.0.9.jar file looks like it's in the right place and the correct internal setup, as you asked.

      The server is running "SunOS 5.9" (from the WLS console), WLS 9.2.3 with the Sun 1.5.0_11 JVM.

      Part of our problem is that even in QA, I don't have access to the machine so I can't see the startup script or startup classpath.  I'll poke around and see if I can get someone from the ops team who has that information and is willing to share it.  May take a few days.  There are not any modifications made to the out-of-the-box WLS classpath as far as I'm aware (at least, we never requested any and this is a new install).



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks