1 Reply Latest reply on Jul 27, 2006 8:48 PM by Gavin King

    ejb3trail persistence error

    Akin Ola Newbie

      whenever i try running jsp files that use session beans to access and retrieve persistent (o/r) entities, i get exceptions usu with root cause: NullPointerException on the line where the an entity should have been initialized from a method call to a session bean.

      HTTP Status 500 -
      
      type Exception report
      
      message
      
      description The server encountered an internal error () that prevented it from fulfilling this request.
      
      exception
      
      org.apache.jasper.JasperException: Exception in JSP: /persistence/entitymanager/addfund.jsp:45
      
      42:
      43: <%
      44: // Collection <Fund> funds = cal.getFunds();
      45: Collection funds = cal.getFunds();
      46: %>
      47:
      48: There are <b><%=funds.size()%></b> funds in the database.<br/>
      
      
      Stacktrace:
       org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
       org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
       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:810)
       org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      
      root cause
      
      java.lang.NullPointerException
       org.apache.jsp.persistence.entitymanager.addfund_jsp._jspService(addfund_jsp.java:89)
       org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       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:810)
       org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      
      

      I dont see anything wrong with
      45: Collection funds = cal.getFunds();
      

      in and of itself.... but what do i know.... :)
      Does anyone have any idea why? I'm kinda like a total j2ee newbie