Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ExceptionInInitializerError  RSS feed

 
Quan Nugent
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got ExceptionInInitializerError error when I loaded my jsf using Hibernate to query the MySQL table and displayed a result table in the JSF. I have an Event as a wrapper class as suggested by Hibernate.org sample and EventBean is a bean with eventList as a list of events. I can query and print out the table contain when i create a main method for the bean. It means a session is created and db connection is established and create-query returns my event list at this level. Thing does not work at the JSF level. It seems to me that the list was null when i do the binding in the jsp page. Here is a code for the session and query.

-------------------------------------
Session session = HibernateUtil.getSessionFactory().getCurrentSession();

session.beginTransaction();

eventList = session.createQuery("from Event").list();

session.getTransaction().commit();

-------------------------------------------------------

Below is the exception:


javax.faces.el.EvaluationException: javax.faces.el.EvaluationException: Error getting property 'eventList' from bean of type mypackage.EventBean: java.lang.ExceptionInInitializerError
com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:206)
com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:154)
javax.faces.component.UIData.getValue(UIData.java:527)
javax.faces.component.UIData.getDataModel(UIData.java:856)
javax.faces.component.UIData.setRowIndex(UIData.java:379)
com.sun.faces.renderkit.html_basic.TableRenderer.encodeBegin(TableRenderer.java:65)
javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:683)
javax.faces.component.UIData.encodeBegin(UIData.java:681)
javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:591)
javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:543)
com.sun.faces.taglib.html_basic.DataTableTag.doEndTag(DataTableTag.java:491)
org.apache.jsp.pages.view_jsp._jspx_meth_h_dataTable_0(view_jsp.java:328)
org.apache.jsp.pages.view_jsp._jspx_meth_h_form_0(view_jsp.java:224)
org.apache.jsp.pages.view_jsp._jspx_meth_f_view_0(view_jsp.java:163)
org.apache.jsp.pages.view_jsp._jspService(view_jsp.java:105)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:703)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:670)
org.apache.jsp.index_jsp._jspService(index_jsp.java:46)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


-----------------------------------------

any help will be appreciated.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!