Cannot display multiple charts in one jsp pag

Help
TomKat
2006-08-17
2013-01-13
  • TomKat

    TomKat - 2006-08-17

    Cannot display multiple charts in one jsp page

    When the jsp page displays two charts, the first chart is ok, but the second chart fails. Have any idea?

    The exception messages for the second chart is

    [14:34:46.427] de.laures.cewolf.CewolfRenderer: null
    [14:34:46.427] java.lang.NullPointerException
    [14:34:46.427]  at de.laures.cewolf.taglib.CewolfChartFactory.getChartTypeConstant(CewolfChartFactory.java:102)
    [14:34:46.427]  at de.laures.cewolf.taglib.CewolfChartFactory.getChartInstance(CewolfChartFactory.java:131)
    [14:34:46.427]  at de.laures.cewolf.taglib.SimpleChartDefinition.produceChart(SimpleChartDefinition.java:30)
    [14:34:46.427]  at de.laures.cewolf.taglib.AbstractChartDefinition.getChart(AbstractChartDefinition.java:121)
    [14:34:46.427]  at de.laures.cewolf.taglib.ChartImageDefinition.ensureRendered(ChartImageDefinition.java:137)
    [14:34:46.427]  at de.laures.cewolf.taglib.ChartImageDefinition.getSize(ChartImageDefinition.java:146)
    [14:34:46.427]  at de.laures.cewolf.CewolfRenderer.doGet(CewolfRenderer.java:153)
    [14:34:46.427]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:115)
    [14:34:46.427]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
    [14:34:46.427]  at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106)
    [14:34:46.427]  at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:173)
    [14:34:46.427]  at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
    [14:34:46.427]  at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:274)
    [14:34:46.427]  at com.caucho.server.port.TcpConnection.run(TcpConnection.java:511)
    [14:34:46.427]  at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:516)
    [14:34:46.427]  at com.caucho.util.ThreadPool.run(ThreadPool.java:442)
    [14:34:46.427]  at java.lang.Thread.run(Thread.java:595)
    [14:34:46.725] de.laures.cewolf.CewolfRenderer: null
    [14:34:46.725] java.lang.NullPointerException
    [14:34:46.725]  at de.laures.cewolf.taglib.CewolfChartFactory.getChartTypeConstant(CewolfChartFactory.java:102)
    [14:34:46.725]  at de.laures.cewolf.taglib.CewolfChartFactory.getChartInstance(CewolfChartFactory.java:131)
    [14:34:46.725]  at de.laures.cewolf.taglib.SimpleChartDefinition.produceChart(SimpleChartDefinition.java:30)
    [14:34:46.725]  at de.laures.cewolf.taglib.AbstractChartDefinition.getChart(AbstractChartDefinition.java:121)
    [14:34:46.725]  at de.laures.cewolf.taglib.ChartImageDefinition.ensureRendered(ChartImageDefinition.java:137)
    [14:34:46.725]  at de.laures.cewolf.taglib.ChartImageDefinition.getSize(ChartImageDefinition.java:146)
    [14:34:46.725]  at de.laures.cewolf.CewolfRenderer.doGet(CewolfRenderer.java:153)
    [14:34:46.725]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:115)
    [14:34:46.725]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
    [14:34:46.725]  at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106)
    [14:34:46.725]  at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:173)
    [14:34:46.725]  at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
    [14:34:46.725]  at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:274)
    [14:34:46.725]  at com.caucho.server.port.TcpConnection.run(TcpConnection.java:511)
    [14:34:46.725]  at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:516)
    [14:34:46.725]  at com.caucho.util.ThreadPool.run(ThreadPool.java:442)
    [14:34:46.725]  at java.lang.Thread.run(Thread.java:595)

    The jsp code:

                    <tr valign="top">
                <td width="100%">
                               
                <jsp:useBean id="chartAdViewsD" scope="request" class="chart.ChartViewData" />    
      
        <cewolf:chart
                id="viewDailyAdStatsAdViews"
                title="Daily Ad View Statistic Chart"
                type="verticalbar"
                xaxislabel="Date"
                yaxislabel="Views">
            <cewolf:data>
                <cewolf:producer id="chartAdViewsD" />
            </cewolf:data>
            <cewolf:chartpostprocessor id="labelRotation"> 
                <cewolf:param name="rotate_at" value="<%=new Integer(0) %>"></cewolf:param> 
            </cewolf:chartpostprocessor>
        </cewolf:chart>   
        <img src='<cewolf:imgurl chartid="viewDailyAdStatsAdViews" renderer="cewolf" width="640" height="480" />'
            alt="Daily Ad View Statistic Chart"
            />   
                            
                </td>
            </tr> 
                       
                    <tr valign="top">
                <td colspan="7" width="100%">
                               
                <jsp:useBean id="chartAdClicksD" scope="request" class="chart.ChartViewData" />    
      
        <cewolf:chart
                id="viewDailyAdStatsAdClicks"
                title="Daily Ad Click Statistic Chart"
                type="verticalbar"
                xaxislabel="Date"
                yaxislabel="Clicks">
            <cewolf:data>
                <cewolf:producer id="chartAdClicksD" />
            </cewolf:data>
            <!--
            <cewolf:chartpostprocessor id="labelRotation"> 
                <cewolf:param name="rotate_at" value="<%=new Integer(0) %>"></cewolf:param> 
            </cewolf:chartpostprocessor>
            -->
        </cewolf:chart>   
        <img src='<cewolf:imgurl chartid="viewDailyAdStatsAdClicks" renderer="cewolf" width="640" height="480" />'
            alt="Daily Ad Click Statistic Chart"
            />   
                            
                </td>
            </tr> 

     
    • Brian Fox

      Brian Fox - 2006-08-18

      You're using the same bean for each. You need a different bean id.

       
    • TomKat

      TomKat - 2006-08-18

      I did use the different bean ids,
      jsp:useBean id="chartAdViewsD"
      jsp:useBean id="chartAdClicksD"

      Is it another bean you told about? Thanks.

       

Log in to post a comment.

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

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks