Discussions

EJB design: Can't run BMP Entity Bean using WebLogic 8.1

  1. Can't run BMP Entity Bean using WebLogic 8.1 (1 messages)

    Hi there

    I am trying to run the client using weblogic 8.1. The deployment of the application is successful but everytimeI try to run the client it gives me the following error:
    ----------------------------------------------------------------------------------------------------------------------
    D:\Training courses\EJB\examples\BMP>java -Djava.naming.factory.initial=weblogic
    .jndi.WLInitialContextFactory -Djava.naming.provider.url=t3://localhost:7001 cli
    ent.SavingsAccountClient
    Caught an exception.
    java.rmi.RemoteException: Exception in ejbLoad:; nested exception is:
            javax.ejb.EJBException: ejbLoad: The transaction is no longer active - s
    tatus: 'Committed'. No further JDBC access is allowed within this transaction.
            at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.j
    ava:108)
            at weblogic.rmi.internal.activation.ActivatableRemoteRef.invoke(Activata
    bleRemoteRef.java:83)
            at weblogic.rmi.cluster.ClusterActivatableRemoteRef.invoke(ClusterActiva
    tableRemoteRef.java:65)
            at beans.SavingsAccountBean_v5pho8_EOImpl_813_WLStub.credit(Unknown Sour
    ce)
            at client.SavingsAccountClient.main(SavingsAccountClient.java:24)
    Caused by: javax.ejb.EJBException: ejbLoad: The transaction is no longer active
    - status: 'Committed'. No further JDBC access is allowed within this transaction
    .
            at beans.SavingsAccountBean.ejbLoad(SavingsAccountBean.java:191)
            at beans.SavingsAccountBean_v5pho8_Impl.ejbLoad(SavingsAccountBean_v5pho
    8_Impl.java:136)
            at weblogic.ejb20.manager.DBManager.loadBean(DBManager.java:480)
            at weblogic.ejb20.manager.DBManager.enrollInTransaction(DBManager.java:3
    68)
            at weblogic.ejb20.cache.EntityCache$KeyData.get(EntityCache.java:619)
            at weblogic.ejb20.cache.EntityCache.get(EntityCache.java:122)
            at weblogic.ejb20.cache.EntityCache.get(EntityCache.java:110)
            at weblogic.ejb20.manager.DBManager.getReadyBean(DBManager.java:270)
            at weblogic.ejb20.manager.DBManager.preInvoke(DBManager.java:249)
            at weblogic.ejb20.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:13
    7)
            at weblogic.ejb20.internal.EntityEJBObject.preInvoke(EntityEJBObject.jav
    a:89)
            at beans.SavingsAccountBean_v5pho8_EOImpl.credit(SavingsAccountBean_v5ph
    o8_EOImpl.java:184)
            at beans.SavingsAccountBean_v5pho8_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(Activata
    bleServerRef.java:90)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    144)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
    a:415)
            at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
    .java:30)
            at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

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

    Any idea why it's happening? Do I have to set any transaction related attributes in WebLogic 8.1?

    Your early help in this is really apprecited

    Thanks in advance
    Aj
  2. How are u managing transactions in the EJB - more specifically, are u giving commit and rollback on the individual JDBC connections? This is not the way to do it.
    U have to get the UserTransaction object from the entity context and use begin on that and the JDBC connection that is obtained from the pool will participate in a JTA transaction.
    Hope it helps.