ClassCastException - DefaultCategoryDataset

Help
Anonymous
2011-11-14
2013-01-13
  • Anonymous - 2011-11-14

    Hi,

    I'm under jboss 5.1 with jdk 1.5 on a windows platform.
    I encounter an error which didn't exist on jboss 4.0.5.

    2011-11-14 15:17:33,287 ERROR [STDERR] (http-0.0.0.0-8080-1) java.lang.ClassCastException: 
    org.jfree.data.category.DefaultCategoryDataset
    2011-11-14 15:17:33,288 ERROR [STDERR] (http-0.0.0.0-8080-1)    at de.laures.cewolf.taglib.DataContainer.getDataset(DataContainer.java:42)
    2011-11-14 15:17:33,289 ERROR [STDERR] (http-0.0.0.0-8080-1)    at de.laures.cewolf.taglib.SimpleChartDefinition.getDataset(SimpleChartDefinition.java:30)
    2011-11-14 15:17:33,289 ERROR [STDERR] (http-0.0.0.0-8080-1)    at de.laures.cewolf.taglib.util.PageUtils.getDataset(PageUtils.java:59)
    2011-11-14 15:17:33,289 ERROR [STDERR] (http-0.0.0.0-8080-1)    at de.laures.cewolf.taglib.tags.ChartMapTag.doStartTag(ChartMapTag.java:103)
    2011-11-14 15:17:33,508 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.jsp.WEB_002dINF.jsp.statistic_005fyearly_jsp._jspx_meth_cewolf_005fmap_005f0(statistic_005fyearly_jsp.java:294)
    2011-11-14 15:17:33,509 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.jsp.WEB_002dINF.jsp.statistic_005fyearly_jsp._jspx_meth_cewolf_005fimg_005f0(statistic_005fyearly_jsp.java:264)
    2011-11-14 15:17:33,509 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.jsp.WEB_002dINF.jsp.statistic_005fyearly_jsp._jspService(statistic_005fyearly_jsp.java:107)
    2011-11-14 15:17:33,509 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    2011-11-14 15:17:33,558 ERROR [STDERR] (http-0.0.0.0-8080-1)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    2011-11-14 15:17:33,558 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
    2011-11-14 15:17:33,558 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
    2011-11-14 15:17:33,558 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
    2011-11-14 15:17:33,558 ERROR [STDERR] (http-0.0.0.0-8080-1)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    2011-11-14 15:17:33,559 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    2011-11-14 15:17:33,609 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    2011-11-14 15:17:33,610 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)
    2011-11-14 15:17:33,610 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:543)
    2011-11-14 15:17:33,610 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:480)
    2011-11-14 15:17:33,610 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
    2011-11-14 15:17:33,661 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:611)
    2011-11-14 15:17:33,661 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:99)
    2011-11-14 15:17:33,661 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:135)
    2011-11-14 15:17:33,661 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:760)
    2011-11-14 15:17:33,661 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:892)
    2011-11-14 15:17:33,712 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
    2011-11-14 15:17:33,712 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.jsp.WEB_002dINF.jsp.layout_jsp._jspx_meth_tiles_005finsert_005f0(layout_jsp.java:409)
    2011-11-14 15:17:33,712 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.jsp.WEB_002dINF.jsp.layout_jsp._jspService(layout_jsp.java:259)
    2011-11-14 15:17:33,712 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    2011-11-14 15:17:33,712 ERROR [STDERR] (http-0.0.0.0-8080-1)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    2011-11-14 15:17:33,763 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
    2011-11-14 15:17:33,763 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
    2011-11-14 15:17:33,763 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
    2011-11-14 15:17:33,763 ERROR [STDERR] (http-0.0.0.0-8080-1)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    2011-11-14 15:17:33,763 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    2011-11-14 15:17:33,815 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    2011-11-14 15:17:33,815 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)
    2011-11-14 15:17:33,815 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444)
    2011-11-14 15:17:33,816 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
    2011-11-14 15:17:33,816 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310)
    2011-11-14 15:17:33,865 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
    2011-11-14 15:17:33,865 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
    2011-11-14 15:17:33,865 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239)
    2011-11-14 15:17:33,865 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:302)
    2011-11-14 15:17:33,865 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
    2011-11-14 15:17:33,916 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    2011-11-14 15:17:33,916 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
    2011-11-14 15:17:33,916 ERROR [STDERR] (http-0.0.0.0-8080-1)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    2011-11-14 15:17:33,916 ERROR [STDERR] (http-0.0.0.0-8080-1)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    2011-11-14 15:17:33,916 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    2011-11-14 15:17:33,968 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    2011-11-14 15:17:33,968 ERROR [STDERR] (http-0.0.0.0-8080-1)    at fr.cegetel.icc.framework.web.filter.PageViewFilter.doFilter(PageViewFilter.java:46)
    2011-11-14 15:17:33,968 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    2011-11-14 15:17:33,968 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    2011-11-14 15:17:33,969 ERROR [STDERR] (http-0.0.0.0-8080-1)    at fr.cegetel.icc.framework.web.filter.GZIPFilter.doFilter(GZIPFilter.java:40)
    2011-11-14 15:17:34,020 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    2011-11-14 15:17:34,020 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    2011-11-14 15:17:34,020 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    2011-11-14 15:17:34,020 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    2011-11-14 15:17:34,021 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    2011-11-14 15:17:34,071 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
    2011-11-14 15:17:34,071 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    2011-11-14 15:17:34,071 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
    2011-11-14 15:17:34,071 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
    2011-11-14 15:17:34,071 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
    2011-11-14 15:17:34,122 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
    2011-11-14 15:17:34,122 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
    2011-11-14 15:17:34,122 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    2011-11-14 15:17:34,122 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    2011-11-14 15:17:34,173 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
    2011-11-14 15:17:34,173 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)
    2011-11-14 15:17:34,173 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    2011-11-14 15:17:34,173 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
    2011-11-14 15:17:34,174 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
    2011-11-14 15:17:34,224 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
    2011-11-14 15:17:34,224 ERROR [STDERR] (http-0.0.0.0-8080-1)    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    2011-11-14 15:17:34,224 ERROR [STDERR] (http-0.0.0.0-8080-1)    at java.lang.Thread.run(Thread.java:595)
    

    My JSP code :

    <%
      try {
    %>
    <jsp:useBean id="PageViewYearlyData" class="xxx.admin.web.model.PageViewYearlyData" />
    <cewolf:chart id="line" type="line" xaxislabel="Date" yaxislabel="Pages vues">
      <cewolf:data>
        <cewolf:producer id="PageViewYearlyData"/>
      </cewolf:data>
    </cewolf:chart>
    <p></p>
    <cewolf:img chartid="line" renderer="/cewolf" width="600" height="400">
      <cewolf:map tooltipgeneratorid="PageViewYearlyData"/>
    </cewolf:img>
    <%  } catch (Exception e) {
        e.printStackTrace();
        out.println("<hr>" + e.getMessage() + "<br />" + e.getLocalizedMessage() + "<hr>");
      }
    %>
    <p></p>
    

    My class :

    public class PageViewYearlyData extends AbstractStatisticalData implements Serializable {
      /*
       * (non-Javadoc)
       * @see de.laures.cewolf.DatasetProducer#produceDataset(java.util.Map)
       */
      public Object produceDataset(Map arg0) throws DatasetProduceException {
        try {
          data = StatisticUtil.getLocalHome().create().pageViewsYearly();
        } catch (Exception e) {
          log.error("The data could not be generated : " + e.getMessage());
          e.printStackTrace();
          throw new DatasetProduceException("The data could not be generated : " + e.getMessage());
        }
        return data;
      }
      /**
       * Returns a unique ID for this DatasetProducer
       */
      public String getProducerId() {
        return "PageViewYearlyData";
      }
    

    The parent class :

    public abstract class AbstractStatisticalData implements DatasetProducer, CategoryToolTipGenerator, Serializable {
      protected org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(this.getClass().getName());
      protected DefaultCategoryDataset data = null;
      /**
       * This producer's data is invalidated after 10 seconds. By this method the
       * producer can influence Cewolf's caching behaviour the way it wants to.
       */
      public boolean hasExpired(Map params, Date since) {
        return (System.currentTimeMillis() - since.getTime()) > 10000;
      }
      /*
       * (non-Javadoc)
       * @see org.jfree.chart.tooltips.CategoryToolTipGenerator#generateToolTip(org.jfree.data.CategoryDataset, int, int)
       */
      public String generateToolTip(CategoryDataset arg0, int arg1, int arg2) {
        return (String) data.getRowKey(arg1);
      }
    }
    

    If someone can give me a clue it will be good :-)

     
  • Ulf Dittmer

    Ulf Dittmer - 2011-11-14

    My guess would be that one of the JFree libraries (JCommon or JFreeChart) is already somewhere else in the classpath, maybe as part of the server installation.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks