re-emergence of the NoClassDefFoundError: JFreeChart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
agrishkan
Posts: 2
Joined: Tue Nov 04, 2014 8:16 pm
antibot: No, of course not.

re-emergence of the NoClassDefFoundError: JFreeChart

Post by agrishkan » Tue Nov 04, 2014 8:33 pm

This is the problem I've been struggling with for a while now.

Using jfreechart 1.0.19.
Using tomcat 7.0.37 and any version of java 1.7, the chart works.
Using tomcat 7.0.54+ and java version 1.7.0_25 or earlier, the chart works.

Using tomcat 7.0.54+ and any java version later than 1.7.0_25 results in an error. First time I go to the page which should have the chart I get:
java.lang.reflect.InvocationTargetException
Caused by: java.lang.ExceptionInInitializerError
at org.jfree.chart.ChartFactory.createXYLineChart(ChartFactory.java:2002)
Caused by: java.lang.NullPointerException
at javax.swing.SwingUtilities.appContextGet(SwingUtilities.java:1859)
All the following times the error is:
An error was propagated to the user level
javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could not initialize class org.jfree.chart.JFreeChart
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.jfree.chart.JFreeChart
at org.jfree.chart.ChartFactory.createXYLineChart(ChartFactory.java:2002)
I have not tested with tomcats between 7.0.37 and 7.0.54. My environment is Ubuntu 10.04 LTS / Linux 2.6.32-37-generic.

I do have the "java.awt.headless=true" configured in JAVA_OPTS - the tomcat process runs with the following attributes:
/other/java/latest/jre/bin/java
-Djava.util.logging.config.file=/other/tomcat/latest/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-server -Xmx4g -Xms1g -XX:-UseLoopPredicate
-Duser.timezone=UTC
-Djava.awt.headless=true
-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
-Djava.endorsed.dirs=/other/tomcat/latest/endorsed
-classpath /other/tomcat/latest/bin/bootstrap.jar:/other/tomcat/latest/bin/tomcat-juli.jar
-Dcatalina.base=/other/tomcat/latest
-Dcatalina.home=/other/tomcat/latest
-Djava.io.tmpdir=/other/tomcat/latest/temp
org.apache.catalina.startup.Bootstrap start
Does anyone have any idea what has changed in the combination of the later java and tomcat versions that results in the error for jfreecharts?

agrishkan
Posts: 2
Joined: Tue Nov 04, 2014 8:16 pm
antibot: No, of course not.

Re: re-emergence of the NoClassDefFoundError: JFreeChart

Post by agrishkan » Mon Dec 29, 2014 10:10 pm

Works for java 1.7.0_67 and 1.8.0_25, and tomcat 8.0.15.

Locked