Finder methods in CMP

Discussions

EJB programming & troubleshooting: Finder methods in CMP

  1. Finder methods in CMP (4 messages)

    I am getting the following error in a entity bean CMP (weblogic 5.1). Any ideas on how to resolve.
    javax.ejb.FinderException: Exception excuting finder: java.lang.NullPointerException

    Thanks,

    Threaded Messages (4)

  2. Finder methods in CMP[ Go to top ]

    Saad, it is extremely difficult to debug your problem with the limited information you have given. Maybe if you post the code of your finder?

    Floyd
  3. Finder methods in CMP[ Go to top ]

    Thank you for asking.
    The problem occurs as follow:
    1. In the JSP I am getting an int Integer.parseInt(strCoCode),
    2 Calling a method on a bean and passing the int(CoCode), 3. The bean find the home on a CMP and pass the parameter.
    The error occur javax.ejb.FinderException: Exception excuting finder: java.lang.NullPointerException:.
    I checked the table the value I am using to find by is found in the table.
    If I use a value does not exist I will not get an error.
    I only get an error when I find something on the table and try to populate the enumeration in the finder method.

    Please, give me some ideas.
  4. Finder methods in CMP[ Go to top ]

    Saad,

       Since you are using CMP, then you have not written the finder method (thats only for BMP). What is your table schema? Perhaps Weblogic generated SQL isn't working with your database or something. What database are you using? Perhaps you didn't specify your CMP bean properly.

      Since there is no exception when nothing is found, it sounds like the problem occurs when WL tries to retrieve attributes from the database resultset.

       I would recheck the way you specified your CMP bean.

    Floyd
  5. Finder methods in CMP[ Go to top ]

    Floyd:
    I copy/paste the following message from weblogic51 server, I hope that help.
    finding by cocode: 797
    ### You are in the ClaimSummaryFacade findByCoCode: 797
    javax.ejb.FinderException: Exception excuting finder: java.lang.NullPointerException:
            at weblogic.ejb.internal.LockManagerImpl.unlock(LockManagerImpl.java:160)
            at weblogic.ejb.internal.StatefulEJBCache.unbind(StatefulEJBCache.java:528)
            at weblogic.ejb.internal.StatefulEJBCache.releaseEJBContext(StatefulEJBCache.java:341)
            at com.tare.claim.ClaimSummaryPSWebLogic_CMP_RDBMS.finderEnumToEnum(ClaimSummaryPSWebLogic_CMP_RDBMS.java, Compiled Code)
            at com.tare.claim.ClaimSummaryPSWebLogic_CMP_RDBMS.findByCoCode(ClaimSummaryPSWebLogic_CMP_RDBMS.java:677)
            at com.tare.claim.ClaimSummaryBeanHomeImpl.findByCoCode(ClaimSummaryBeanHomeImpl.java:126)
            at com.tare.claim.ClaimSummaryBeanHomeImpl_ServiceStub.findByCoCode(ClaimSummaryBeanHomeImpl_ServiceStub.java, Compiled Co
    de)
            at com.tare.claim.ClaimSummaryFacade.findByCoCode(ClaimSummaryFacade.java:55)
            at jsp_servlet._tare._phoenix._summarylisting._jspService(_summarylisting.java, Compiled Code)
            at weblogic.servlet.jsp.JspBase.service(JspBase.java, Compiled Code)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java, Compiled Code)
            at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java, Compiled Code)
            at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java, Compiled Code)
            at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java, Compiled Code)
            at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java, Compiled Code)
            at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java, Compiled Code)
            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)

            at com.tare.claim.ClaimSummaryPSWebLogic_CMP_RDBMS.findByCoCode(ClaimSummaryPSWebLogic_CMP_RDBMS.java:683)
            at com.tare.claim.ClaimSummaryBeanHomeImpl.findByCoCode(ClaimSummaryBeanHomeImpl.java:126)
            at com.tare.claim.ClaimSummaryBeanHomeImpl_ServiceStub.findByCoCode(ClaimSummaryBeanHomeImpl_ServiceStub.java, Compiled Co
    de)
            at com.tare.claim.ClaimSummaryFacade.findByCoCode(ClaimSummaryFacade.java:55)
            at jsp_servlet._tare._phoenix._summarylisting._jspService(_summarylisting.java, Compiled Code)
            at weblogic.servlet.jsp.JspBase.service(JspBase.java, Compiled Code)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java, Compiled Code)
            at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java, Compiled Code)
            at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java, Compiled Code)
            at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java, Compiled Code)
            at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java, Compiled Code)
            at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java, Compiled Code)
            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
    ### You are in hasMoreSummaries.
    Tue Aug 15 12:45:57 EDT 2000:<E> <ServletContext-General> Servlet failed with Exception
    java.lang.NullPointerException
            at com.tare.claim.ClaimSummaryFacade.hasMoreSummaries(ClaimSummaryFacade.java, Compiled Code)
            at jsp_servlet._tare._phoenix._summarylisting._jspService(_summarylisting.java, Compiled Code)
            at weblogic.servlet.jsp.JspBase.service(JspBase.java, Compiled Code)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java, Compiled Code)
            at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java, Compiled Code)
            at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java, Compiled Code)
            at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java, Compiled Code)
            at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java, Compiled Code)
            at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java, Compiled Code)
            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)