首先看看代码! 
import java.io.IOException; 
import java.util.*; 
import javax.portlet.*; 
import net.luculent.core.base.Charset; 
import net.luculent.core.base.FormatDate; 
import net.luculent.core.database.Database; 
import net.luculent.core.database.Rowset; 
import net.luculent.liems.l3p.portal.core.entity.PortletObject; 
import net.luculent.liems.l3p.portlet.core.L3PGenericPortlet; 
import net.luculent.liems.util.SessionInfo; 
import net.luculent.liems.util.Tools; 
import org.jfree.chart.ChartRenderingInfo; 
import org.jfree.chart.ChartUtilities; 
import org.jfree.chart.entity.*; 
import org.jfree.chart.servlet.ServletUtilities; 
/** 
* <p>Title: </p> 

* <p>Description: </p> 

* <p>Copyright: Copyright (c) 2008</p> 

* <p>Company: </p> 

* @author not attributable 
* @version 1.0 
*/ 
public class EleRate extends L3PGenericPortlet{ 
public EleRate() { 
} public void processAction(ActionRequest actionrequest, ActionResponse actionresponse) 
throws PortletException, IOException 


protected void doView(RenderRequest request, RenderResponse response) 
throws PortletException, IOException 

String portletName = super.getPortlet(request).getName(); 
request.setAttribute("portletName", portletName); 
PortletContext ctx = getPortletContext(); 
SessionInfo sessionInfo = Tools.getSessionInfo(super.getServletRequest(request)); 
String currUserId = sessionInfo.getUserId(); 
ServletUtilities.setTempFilePrefix("public"); 
PowerRateInfo tsf = new PowerRateInfo(currUserId, ""); //就是这里,在JBUILDER中调试的时候,就会飞走PowerRateInfo 中的代码见下面,注释掉部分就可以调试!
//org.jfree.chart.JFreeChart ss = tsf.createBar3DChart(sessionInfo); 
ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection()); 
//String myFilename = ServletUtilities.saveChartAsPNG(ss, 376, 260, info, null); 
Collection entities = info.getEntityCollection().getEntities(); 
if(entities != null) 

int count = entities.size(); 
for(int i = count - 1; i >= 0; i--) 

ChartEntity entity = (ChartEntity)entities.toArray(); 
if(entity.getToolTipText() != null || entity.getURLText() != null) 

String newURL = entity.getURLText(); 
// newURL = "#\" onclick=\"ImpGu_gotoProgram('" + newURL + "')"; 
entity.setURLText(newURL); 

} } 
// String map = ChartUtilities.getImageMap(myFilename, info); 
// String url = request.getContextPath() + "/servlet/DisplayChart?filename=" + myFilename; 
// request.setAttribute("url", url); 
// request.setAttribute("map", map); 
// request.setAttribute("myFilename", myFilename); 
// PortletRequestDispatcher dispatcher = ctx.getRequestDispatcher("/xslt/portal/portlets/" + portletName + "/" + portletName + "_normal.jsp"); 
// dispatcher.include(request, response); 

}

解决方案 »

  1.   

    /********************************************************************/
    /*************将我现在注释掉的部分注释掉就可以单步调试了************/
    public class PowerRateInfo {
        private String currUserId;
        private String busiName;
        public PowerRateInfo() {
        }
        public PowerRateInfo(String currUserId, String busiName) {
           this.currUserId = currUserId;
           this.busiName = busiName;
       }
     public JFreeChart RateChart(SessionInfo sessionInfo) {
          JFreeChart jfreechart = null;
         DefaultValueDataset dataset = new DefaultValueDataset();
         dataset = new DefaultValueDataset(20D);
           //实例化DialPlot
           DialPlot dialplot = new DialPlot();
           dialplot.setView(0.0D, 0.0D, 1.0D, 1.0D);
           dialplot.setDataset(dataset);
           //开始设置显示框架结构
           SimpleDialFrame simpledialframe = new SimpleDialFrame();
           simpledialframe.setBackgroundPaint(Color.lightGray);
           simpledialframe.setForegroundPaint(Color.darkGray);
    //       dialplot.setDialFrame(simpledialframe);
           //结束设置显示框架结构
           GradientPaint gradientpaint = new GradientPaint(new Point(),
                   new Color(255, 255, 255), new Point(), new Color(170, 170, 220));
           DialBackground dialbackground = new DialBackground(gradientpaint);
           dialbackground.setGradientPaintTransformer(new
                   StandardGradientPaintTransformer(GradientPaintTransformType.
                                                    VERTICAL));
    //       dialplot.setBackground(dialbackground);
           //设置显示在表盘中央位置的信息
           DialTextAnnotation dialtextannotation = new DialTextAnnotation("综合厂用电率");
           dialtextannotation.setFont(new Font("Dialog", 1, 14));
           dialtextannotation.setRadius(0.69999999999999996D);
    //       dialplot.addLayer(dialtextannotation);
           DialValueIndicator dialvalueindicator = new DialValueIndicator(0, "c");
    //       dialplot.addLayer(dialvalueindicator);
           //根据表盘的直径大小(0.88),设置总刻度范围
           StandardDialScale standarddialscale = new StandardDialScale(4D, 7D, 2D,
                   8D);
           standarddialscale.setTickRadius(0.38D); //设置直径大小
           standarddialscale.setTickLabelOffset(0.14999999999999999D);
           standarddialscale.setTickLabelFont(new Font("Dialog", 0, 14));
           //主意是 dialplot.addScale()不是dialplot.addLayer()
    //       dialplot.addScale(0, standarddialscale);
           //设置刻度范围(红色)
           StandardDialRange standarddialrange = new StandardDialRange(4D, 5D,
                   Color.red);
           standarddialrange.setInnerRadius(0.52000000000000002D);
           standarddialrange.setOuterRadius(0.55000000000000004D);
    //       dialplot.addLayer(standarddialrange);
           //设置刻度范围(橘黄色)
           StandardDialRange standarddialrange1 = new StandardDialRange(5D, 6D,
                   Color.orange);
           standarddialrange1.setInnerRadius(0.52000000000000002D);
           standarddialrange1.setOuterRadius(0.55000000000000004D);
    //       dialplot.addLayer(standarddialrange1);
           //设置刻度范围(绿色)
           StandardDialRange standarddialrange2 = new StandardDialRange(6D, 7D,
                   Color.green);
           standarddialrange2.setInnerRadius(0.52000000000000002D);
           standarddialrange2.setOuterRadius(0.55000000000000004D);
    //       dialplot.addLayer(standarddialrange2);
           //设置指针
           org.jfree.experimental.chart.plot.dial.DialPointer.Pointer pointer = new
                   org.jfree.experimental.chart.plot.dial.DialPointer.Pointer();
    //       dialplot.addLayer(pointer);
           //实例化DialCap
    //       DialCap dialcap = new DialCap();
    //       dialcap.setRadius(0.10000000000000001D);
    //       dialplot.setCap(dialcap);
           //生成chart对象
           jfreechart = new JFreeChart(dialplot);
           return jfreechart;
       }}
    /***********飞走后就到了这里*************/// JBuilder API Decompiler stub source generated from class file
    // 2008-10-28
    // -- implementation of methods is not available
    package net.luculent.liems.l3p.portal;
    // Imports
    import java.io.IOException;
    import java.util.List;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import net.luculent.liems.l3p.portal.core.entity.Portal;
    import net.luculent.liems.l3p.portal.core.entity.PortalTab;
    import net.luculent.liems.l3p.portal.core.entity.PortletObject;
    import net.luculent.liems.l3p.portal.core.service.PortalService;
    public class Servlet extends HttpServlet {
      // Constructors
      public Servlet() { }
      // Methods
      public void init(ServletConfig config) throws ServletException { }
      public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { }
      public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { }
      private void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { }
      protected Portal getPortal(HttpServletRequest request) { return null;}
      protected PortalTab getPortalTab(HttpServletRequest request) { return null;}
      protected List getPortletsByTab(HttpServletRequest request, int id) { return null;}
      protected PortletObject getPortlet(HttpServletRequest request) { return null;}
      protected PortalService getPortalService(ServletContext context) { return null;}
      private Object getService(ServletContext context, String serviceName) { return null;}
    }
    /*************后台报的错是这样的*************************/
    java.lang.NoClassDefFoundError: org/jfree/experimental/chart/plot/dial/DialPlot希望各位高手可以帮忙解决,急!!!
    3Q
      

  2.   

    java.lang.NoClassDefFoundError: org/jfree/experimental/chart/plot/dial/DialPlot 
    太长了,看问题的最后一句话就很明朗,你没有引入jar文件啊
      

  3.   

    你用了最新版的类吗,这个类我手头的版本上都没有experimental这个包啊
      

  4.   

    jfreechart-1.0.6-experimental.jar
    no this jar
      

  5.   

    我也没在官网上找到这个包
    http://download.csdn.net/source/609446
    在这下吧,我说了,其实我不专业的,呵呵.
      

  6.   

    http://www.jfree.org/jfreechart/faq.html#FAQ13看FAQ里面有没有吧,我要睡了.
      

  7.   

    还是谢谢你了!我也去休息了!
    要是又人感兴趣的话,可以加我的QQ
    QQ:514593926
    请注明jfreechart
    如果解决了小弟再加分,真的等的急了!
    再不做好客户要发飙了!
      

  8.   

    就是少包明天你在http://download.csdn.net/source/609446 
    下就行了,只是不了解jf还有这么一堆包.
      

  9.   

    version is not correct.