Exception when calling findByPrimaryKey( )


EJB programming & troubleshooting: Exception when calling findByPrimaryKey( )

  1. Exception when calling findByPrimaryKey( ) (4 messages)

    I am getting the following exception when I am calling findByPrimaryKey() method on home interface in a bean managed entity bean on weblogic server.

    The exception is as follows:

    java.rmi.RemoteException: ; nested exception is:
            weblogic.rmi.ServerError: A RemoteException occurred in the server method
     - with nested exception:
    Start server side stack trace:
            at LoginBeanHomeImpl.findByPrimaryKey(LoginBeanHomeImpl.java:57)
            at LoginBeanHomeImpl_WLSkel.invoke(LoginBeanHomeImpl_WLSkel.java:88)
            at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerObjectAdapter.java:338
            at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicRequestHandler.java:69)
            at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:15)
            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    End server side stack trace

    Can anybody explain the reason for this.

  2. Hi,
    Did u Check that your database connection pool is configured correctly and that the EJB is accessing this connection pool perfectly.
    Did U uncomment these lines

    By the way did u uncommment these lines also weblogic.jdbc.TXDataSource.weblogic.jdbc.jts.demoPool=demoPool

    in your weblogic.properties file.
    Iam not sure..but this should help u..

  3. I created the connectionpool and registered the datasource.
    The bean is working fine when I call create() method and throw exception when I call findByPrimaryKey().
  4. Hi,

    There will be some problem in u'r primary key class
    If possible send the home interface, bean and primary key code..

  5. In your implementation the method name should be prefixed with ejb which probably you haven't done. So it is ejbFindByPrimaryKey....