Generate several charts

Help
Shiro Usa
2008-01-02
2013-01-13
  • Shiro Usa

    Shiro Usa - 2008-01-02

    Hi,
    In order to generate several pie charts depending on results of queries, we create a PieChart class which extends TagSupport and we call it in the jsp by:
                <logic:notEmpty name="reportForm" property="colPie">
                    <h:Pie name="reportForm" col="colPie" />
                </logic:notEmpty>

    We define public doStartTag and doEndTag methods where we browse our datas.
    For each line of data, we simulate the usual tags:
    <cewolf:chart ...>
       <cewolf:data>
         <cewolf:producer ...
    by calling SimpleChartTag, DataTag, ProducerTag and their respective doStartTag() and doEndTag().

    Then we want to simulate the tag <cewolf:img ...> by calling ChartImgTag.

    It seems to work well but the image is empty and an exception occurs:

    2008-01-02 11:01:07,218 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/project]] CewolfServlet: null
    java.lang.NullPointerException
        at de.laures.cewolf.taglib.ChartImageDefinition.ensureRendered(ChartImageDefinition.java:131)
        at de.laures.cewolf.taglib.ChartImageDefinition.getSize(ChartImageDefinition.java:138)
        at de.laures.cewolf.CewolfRenderer.doGet(CewolfRenderer.java:118)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
        at java.lang.Thread.run(Thread.java:595)

    Does anybody have an idea how to resolve this?
    Thanks!

     
    • Shiro Usa

      Shiro Usa - 2008-01-08

      Hi,
      just in case someone else meets this problem someday...

      And the solution was:

      cewolfSimpleChartTag.setId(x);
      cewolfImg.setChartid(x);

      x must be the same, because:

      <cewolf:chart id=x ...
      <cewolf:img chartid=x ...

      Thanks!

       

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

Sign up for the SourceForge newsletter:





No, thanks