I develop a web-based program in linux using jfreechart.
but "class not found" exception is always thrown in web-page
java.lang.NoClassDefFoundError: javax/servlet/ServletOutputStream
netmatrix.chart.ChartGenerator.generateBarChart2(ChartGenerator.java:168)
org.apache.jsp.jsp.home_jsp._jspService(home_jsp.java:166)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
my web-server is tomcat ,I have set the CATALINA_OPTS to "-Djava.awt.headless=true"
the situation is same when i deploy the sample.war file downloaded from jfreechart.org.
I have edit CLASSPATH to include jfreechart.jar and jcommon.jar,and also put these tow jar file into directory [catalina_base/common/lib], but it still not work.
and what confuse me more is that I deploy the sample.war file in windows2000, no exception is thrown , and chart display well.
please help me. thanks
jfreechart can not work in linux,but worked well in window2K
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
I'm not really sure what the problem is here. Are you using JDK 1.4? If not, the headless option won't work. Also, make sure you only have the JFreeChart and JCommon jar files in one place, otherwise you can get obscure class loading errors.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


my java version is 1.4.1. and only once i include the jfreechart.jar and jcommon.jar in classpath. I have check these two point.
questions:
1.can I unpack the jfreechart.jar to [web-virtual-directory]/web-inf/classes,
has it same effection of putting the jar file into lib directory.
2.does tomcat ignored the classpath .
questions:
1.can I unpack the jfreechart.jar to [web-virtual-directory]/web-inf/classes,
has it same effection of putting the jar file into lib directory.
2.does tomcat ignored the classpath .