Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8152721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:47:43+00:00 2026-06-06T15:47:43+00:00

This chart is displayed very nice but the log is not nice at all.

  • 0

This chart is displayed very nice but the log is not nice at all.

I cannot find the reason for the exception.
Any suggestions are appreciated!!
I believe in two scenarios, there is no instance because it’s not called or I get a null pointer in my bean.
But I have done the error handling in the bean so I believe there might be some other reason?

Error 1

    SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path     [/test threw exception [/home/barChart.xhtml @14,67 listener="#{chartBean}": Identity 'chartBean' does not reference a MethodExpression instance, returned type: ChartBean] with root cause
    javax.el.ELException: /home/barChart.xhtml @14,67 listener="#{chartBean}": Identity 'chartBean' does not reference a MethodExpression instance, returned type: ChartBean
        at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:111)

Error 2

    SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/test] threw exception [null] with root cause
    java.lang.NullPointerException
        at org.primefaces.component.chart.bar.BarChartRenderer.encodeOptions(BarChartRenderer.java:64)

Error 3

    SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
    java.lang.RuntimeException: java.lang.OutOfMemoryError: PermGen space
        at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292......

And the error are then adding up

The code:
barChart.xhtml

    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
            xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:p="http://primefaces.org/ui">
    <h:head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Insert title here</title>
    </h:head>
    <h:body>


            <h1 class="title ui-widget-header ui-corner-all">Login - Statistics</h1>
            <div class="entry">

                <p:barChart id="horizontal" value="#{chartBean.categoryModel}" legendPosition="ne"  breakOnNull="false" barMargin="3" barPadding="3"
                            title="Horizontal Bar Chart"  orientation="horizontal" min="0" max="#{chartBean.count}" style="height:#{chartBean.ssize}" />


            </div>
    </h:body>
    </html>

And the Bean
ChartBean.java

    @ManagedBean(name="chartBean")
    @RequestScoped
    public class ChartBean implements Serializable {

        CDBPool cdb;
        ResultSet res = null;
        private int method = 0;
        private int  months = 12;
        private String  country = null;
        private int bitval = 1;
        private int type = 0;
        private CartesianChartModel categoryModel;

        private int size = 1;
        private String sSize = "10";           //Width of chart
        private String maxCount="100";          //size of x-axis 
        private int count = 0;
        private HttpServletRequest request;
        private HttpServletResponse response;

        public ChartBean()   {
        request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
        response = (HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse();
            createCategoryModel();
        }


    /**
    * To set the max of x-axis as integer
    * @return 
    */
        public int getCount() {
            return count;
        }


    /**
    * To set the max of x-axis
    * @return 
    */
        public String getMaxCount() {
            return maxCount;
        }

        public int getSize() {
            return size;
        }
    /**
    * To set the width of chart
    * @return 
    */
        public String getSsize() {
            return sSize;
        }

        public void itemSelect(ItemSelectEvent event) {
            FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Item selected",
                    "Item Index: " + event.getItemIndex() + ", Series Index:" + event.getSeriesIndex());

            FacesContext.getCurrentInstance().addMessage(null, msg);
        }

        public CartesianChartModel getCategoryModel() {
            return categoryModel;
        }

        public final void setChartProp(int method, int  months, String country, int  bitval, int  type){
            //TODO Replace thees values with request get...
            this.method = method;
            this.months = months;
            this.country = country;
            this.bitval = bitval;
            this.type = type;
            if (method == 0) {
                method = 0;
            }
            if (months == 12) {
                months = 12;
            }
            if (country == null) {
                country = "%";
            }
            if (bitval == 1) {
                bitval = 1;
            }
            if (type == 0) {
                type = 0;
            }
            //CALL "cdbdba"."CDBStatLoginDay"("@SUMMETHOD" = 0,"@MONTHSBACK" = 12,"@COUNTRY" = '%',"@BITVAL" = '1',"@TYPE" = 0)
    /*
            mint,diff,dh,sum
            20110616,366,0,84
            20110616,366,1,52
            20110616,366,2,6
            20110616,366,3,17
    */      

            String sqlString = "Exec CDBStatLoginDay " + method + "," + months + ",'" + country + "'," + bitval + "," + type;
            res = cdb.dbQuery(sqlString);
        }

        private void createCategoryModel()  {
            try {
                cdb = JSPCodeFunctions.getDBPool(request, response);
            } catch (Exception ex) {
                Logger.getLogger(ChartBean.class.getName().concat(" when calling JSPCodeFunctions ")).log(Level.SEVERE, null, ex);
            }
                setChartProp(method,  months,  country,  bitval,  type);    
            categoryModel = new CartesianChartModel();
            ChartSeries hits = new ChartSeries();

            if (res != null) {

                Date incrementDate = null;
                DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
                int days = 0;
                String day;
                String month;
                String year; 
                String serieDate = null;
                String startDate = null;

                count = 100;
                try {
                    while (res.next()) {
                        size = res.getInt(2);
                        try {
                            incrementDate = ChartDate.addDays((Date)formatter.parse( res.getString(1)), res.getInt(3));
                        } catch (ParseException ex) {
                            Logger.getLogger(ChartBean.class.getName().concat(" When retriving rows from res ")).log(Level.SEVERE, null, ex);
                        }
                        day = incrementDate.toString().split(" ")[2];
                        month = incrementDate.toString().split(" ")[1];
                        year = incrementDate.toString().split(" ")[5];
                        serieDate = day+""+month+""+year;
                        count = (res.getInt(4)>count)? res.getInt(4):count;
                        hits.set(serieDate, res.getInt(4));  //Sets date and count
                        days++;
                        try {
                            startDate = ChartDate.addDays((Date)formatter.parse( res.getString(1)), 0).toString().split(" ")[2]+"-"+ChartDate.addDays((Date)formatter.parse( res.getString(1)), 0).toString().split(" ")[1]+"-"+ChartDate.addDays((Date)formatter.parse( res.getString(1)), 0).toString().split(" ")[5];
                        } catch (ParseException ex) {
                            Logger.getLogger(ChartBean.class.getName().concat(" When retriving rows from res")).log(Level.SEVERE, null, ex);
                        }

                    }
                    maxCount = String.valueOf(count);
                    sSize= String.valueOf(size*15)+"px";                
                    hits.setLabel("Numer of login from: "+startDate+" to "+serieDate.toString());
                } catch (SQLException ex) {
                    Logger.getLogger(ChartBean.class.getName()).log(Level.SEVERE, null, ex);
                }

                try {
                    if (res!=null)res.close();res = null;
                } catch (SQLException ex) {
                    Logger.getLogger(ChartBean.class.getName()).log(Level.SEVERE, null, ex);
                }
                categoryModel.addSeries(hits);


            }else{
                //Lets add some default test data
                ChartSeries boys = new ChartSeries();
                boys.setLabel("Boys");
                boys.set("2004", 120);
                boys.set("2005", 100);
                ChartSeries girls = new ChartSeries();
                girls.setLabel("Girls");
                girls.set("2004", 52);
                girls.set("2005", 60);
                categoryModel.addSeries(boys);
                categoryModel.addSeries(girls);
                }
        }

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T15:47:44+00:00Added an answer on June 6, 2026 at 3:47 pm

    My solution:
    I made general cleanup, replaced deprecated tag library and removed truts xml files and added struts jar on the class path insted.
    I believe I had a conflict betsen struts server face and jsf.
    What caused the caching, I do not know, its gone now after my cleanup.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not a programmer, but I've done all the customizations for my web shop
Looking to see if this chart is possible with HighCharts before jumping aboard any
This chart has been linked a number of times on blogs that I follow
I'm trying to output the unicode latin cross character described in this chart :
For example we have this line chart at Google Code API there is a
I am plotting a financial candlestick chart using this MATLAB function: http://www.mathworks.com/help/toolbox/finance/candlefts.html How do
Currently I have a stacked bar chart like this ( jsfiddle demo ) I
Using series.add(180, 1); produces a perfectly valid chart like this (little red dot at
i need to create a chart similar to this: link text Do you have
I am getting this error in the expression editor for a chart control. Category

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.