L
lanbei
Unregistered / Unconfirmed
GUEST, unregistred user!
我刚开始学习JFREECHART的,所以在网上找了简单的实例,进行练习,可以运行出这样的错误,请大家帮帮忙.出现这样的错误是为什么呀?
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: org/jfree/chart/labels/CategoryItemLabelGenerator
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:244)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NoClassDefFoundError: org/jfree/chart/labels/CategoryItemLabelGenerator
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
java.lang.Class.getConstructor0(Class.java:1762)
java.lang.Class.newInstance0(Class.java:276)
java.lang.Class.newInstance(Class.java:259)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:307)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.30 logs.
为了方便大家看.我把自己的小程序贴出来.大家帮帮忙,告诉我为什么会有这样的提示呢?
我的原程序如下:是JSP的源代码.
<%@ page contentType="text/html;charset=GBK"%>
<%@ page import="org.jfree.data.DefaultPieDataset"%>
<%@ page import="org.jfree.chart.JFreeChart"%>
<%@ page import="org.jfree.chart.plot.PiePlot"%>
<%@ page import="org.jfree.chart.ChartRenderingInfo"%>
<%@ page import="org.jfree.chart.servlet.ServletUtilities"%>
<%@ page import="org.jfree.chart.urls.StandardPieURLGenerator"%>
<%@ page import="org.jfree.chart.entity.StandardEntityCollection"%>
<%
DefaultPieDataset data = new DefaultPieDataset();
data.setValue("六月",500);
data.setValue("七月",580);
data.setValue("八月",828);
PiePlot plot = new PiePlot(data);
JFreeChart chart = new JFreeChart("",JFreeChart.DEFAULT_TITLE_FONT,plot, true);
chart.setBackgroundPaint(java.awt.Color.white);//可选,设置图片背景色
chart.setTitle("www.SenTom.net 网站访问统计表"//可选,设置图片标题
ChartRenderingInfo info= new ChartRenderingInfo(new StandardEntityCollection());//500是图片长度,300是图片高度
String filename =ServletUtilities.saveChartAsPNG(chart, 500, 300, info, session);
String graphURL =request.getContextPath() +"/servlet/DisplayChart?filename="+ filename;
%>
<HTML>
<HEAD>
<TITLE>www.sentom.net</TITLE>
</HEAD>
<BODY>
<P ALIGN="CENTER">
<img src="<%= graphURL %>"
width=500 height=300 border=0 usemap="#<%= filename%>">
</P>
</BODY>
</HTML>
谢谢大家了.
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: org/jfree/chart/labels/CategoryItemLabelGenerator
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:244)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NoClassDefFoundError: org/jfree/chart/labels/CategoryItemLabelGenerator
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
java.lang.Class.getConstructor0(Class.java:1762)
java.lang.Class.newInstance0(Class.java:276)
java.lang.Class.newInstance(Class.java:259)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:307)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.30 logs.
为了方便大家看.我把自己的小程序贴出来.大家帮帮忙,告诉我为什么会有这样的提示呢?
我的原程序如下:是JSP的源代码.
<%@ page contentType="text/html;charset=GBK"%>
<%@ page import="org.jfree.data.DefaultPieDataset"%>
<%@ page import="org.jfree.chart.JFreeChart"%>
<%@ page import="org.jfree.chart.plot.PiePlot"%>
<%@ page import="org.jfree.chart.ChartRenderingInfo"%>
<%@ page import="org.jfree.chart.servlet.ServletUtilities"%>
<%@ page import="org.jfree.chart.urls.StandardPieURLGenerator"%>
<%@ page import="org.jfree.chart.entity.StandardEntityCollection"%>
<%
DefaultPieDataset data = new DefaultPieDataset();
data.setValue("六月",500);
data.setValue("七月",580);
data.setValue("八月",828);
PiePlot plot = new PiePlot(data);
JFreeChart chart = new JFreeChart("",JFreeChart.DEFAULT_TITLE_FONT,plot, true);
chart.setBackgroundPaint(java.awt.Color.white);//可选,设置图片背景色
chart.setTitle("www.SenTom.net 网站访问统计表"//可选,设置图片标题
ChartRenderingInfo info= new ChartRenderingInfo(new StandardEntityCollection());//500是图片长度,300是图片高度
String filename =ServletUtilities.saveChartAsPNG(chart, 500, 300, info, session);
String graphURL =request.getContextPath() +"/servlet/DisplayChart?filename="+ filename;
%>
<HTML>
<HEAD>
<TITLE>www.sentom.net</TITLE>
</HEAD>
<BODY>
<P ALIGN="CENTER">
<img src="<%= graphURL %>"
width=500 height=300 border=0 usemap="#<%= filename%>">
</P>
</BODY>
</HTML>
谢谢大家了.