有关于jfreechart 的问题,请用过的朋友帮帮忙.很急的,在线等. ( 积分: 50 )

  • 主题发起人 主题发起人 lanbei
  • 开始时间 开始时间
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=&quot;text/html;charset=GBK&quot;%>
<%@ page import=&quot;org.jfree.data.DefaultPieDataset&quot;%>
<%@ page import=&quot;org.jfree.chart.JFreeChart&quot;%>
<%@ page import=&quot;org.jfree.chart.plot.PiePlot&quot;%>
<%@ page import=&quot;org.jfree.chart.ChartRenderingInfo&quot;%>
<%@ page import=&quot;org.jfree.chart.servlet.ServletUtilities&quot;%>
<%@ page import=&quot;org.jfree.chart.urls.StandardPieURLGenerator&quot;%>
<%@ page import=&quot;org.jfree.chart.entity.StandardEntityCollection&quot;%>
<%
DefaultPieDataset data = new DefaultPieDataset();
data.setValue(&quot;六月&quot;,500);
data.setValue(&quot;七月&quot;,580);
data.setValue(&quot;八月&quot;,828);
PiePlot plot = new PiePlot(data);
JFreeChart chart = new JFreeChart(&quot;&quot;,JFreeChart.DEFAULT_TITLE_FONT,plot, true);
chart.setBackgroundPaint(java.awt.Color.white);//可选,设置图片背景色
chart.setTitle(&quot;www.SenTom.net 网站访问统计表&quot;);//可选,设置图片标题
ChartRenderingInfo info= new ChartRenderingInfo(new StandardEntityCollection());//500是图片长度,300是图片高度
String filename =ServletUtilities.saveChartAsPNG(chart, 500, 300, info, session);
String graphURL =request.getContextPath() +&quot;/servlet/DisplayChart?filename=&quot;+ filename;
%>
<HTML>
<HEAD>
<TITLE>www.sentom.net</TITLE>
</HEAD>
<BODY>
<P ALIGN=&quot;CENTER&quot;>
<img src=&quot;<%= graphURL %>&quot;
width=500 height=300 border=0 usemap=&quot;#<%= filename%>&quot;>
</P>
</BODY>
</HTML>
谢谢大家了.
 
我刚开始学习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=&quot;text/html;charset=GBK&quot;%>
<%@ page import=&quot;org.jfree.data.DefaultPieDataset&quot;%>
<%@ page import=&quot;org.jfree.chart.JFreeChart&quot;%>
<%@ page import=&quot;org.jfree.chart.plot.PiePlot&quot;%>
<%@ page import=&quot;org.jfree.chart.ChartRenderingInfo&quot;%>
<%@ page import=&quot;org.jfree.chart.servlet.ServletUtilities&quot;%>
<%@ page import=&quot;org.jfree.chart.urls.StandardPieURLGenerator&quot;%>
<%@ page import=&quot;org.jfree.chart.entity.StandardEntityCollection&quot;%>
<%
DefaultPieDataset data = new DefaultPieDataset();
data.setValue(&quot;六月&quot;,500);
data.setValue(&quot;七月&quot;,580);
data.setValue(&quot;八月&quot;,828);
PiePlot plot = new PiePlot(data);
JFreeChart chart = new JFreeChart(&quot;&quot;,JFreeChart.DEFAULT_TITLE_FONT,plot, true);
chart.setBackgroundPaint(java.awt.Color.white);//可选,设置图片背景色
chart.setTitle(&quot;www.SenTom.net 网站访问统计表&quot;);//可选,设置图片标题
ChartRenderingInfo info= new ChartRenderingInfo(new StandardEntityCollection());//500是图片长度,300是图片高度
String filename =ServletUtilities.saveChartAsPNG(chart, 500, 300, info, session);
String graphURL =request.getContextPath() +&quot;/servlet/DisplayChart?filename=&quot;+ filename;
%>
<HTML>
<HEAD>
<TITLE>www.sentom.net</TITLE>
</HEAD>
<BODY>
<P ALIGN=&quot;CENTER&quot;>
<img src=&quot;<%= graphURL %>&quot;
width=500 height=300 border=0 usemap=&quot;#<%= filename%>&quot;>
</P>
</BODY>
</HTML>
谢谢大家了.
 
请大家帮帮忙.我只是初学,出现这样的错误,一点头绪都没有.大家给我提个醒儿,能是什么原因引起这样的提示错误信息呢?谢谢.
 
难道大家都没遇到过这样的提示吗?请大家帮帮我呀.
 
没有找到 org/jfree/chart/labels/CategoryItemLabelGenerator下面的类,意思就是说可能你的jfreechart下的这个包的位置放错了,仔细检查一下
 
十分感谢你的帮忙.我实在是太感谢了.可是不太明白,怎么放置那些需要的包,应该放在什么目录下呀?
 
放在lib下面。
或者classpath里设置
http://ideagrace.com/html/doc/2005/07/13/00174.html
http://ideagrace.com/html/doc/2005/08/02/00325.html
 
WEB-INF ->LIB下
 
我的程序是在网上找的例子.其中它指明了包的版本,
但是包里却缺少一些.我该怎么办呢?
 
多人接受答案了。
 
后退
顶部