Passivation of Connection Object in Stateful Session Bean

Hi all,
I am developing a Stateful session bean that has a Connection object as its instance variable. And this bean starts transaction that spans across multiple method calls and finally either commit or rollback.
BeanClass
UserTransaction utx;
Connection conn;
ejbCreate()
allocateconnection();
ejbRemove()
closeconnection();
ejbActivate()
allocateconnection();
ejbpassivate()
closeconnection();
StartTransaction()
utx = getusertransaction();
utx.begin();
Method1()
do something with database
Method2()
do something with database
CommitTransaction()
utx.commit();
For example, the typical usage of this bean would be:
bean.StartTransaction();
bean.Method1();
bean.Method2();
bean.CommitTransaction();
Here are my two questions:
1. General Question: In order for a Connection object to join a Transaction, Do I have to create the connection after the transaction has started?
2. If the answer to the above question is yes, then: I understand that when this bean get passivated, the UserTransaction instance object would be passivated. And since the connection object can't not be passivated, I have to recreate the connection object in ejbactivate() method, would newly created connection participate in the same Transaction that was being passivated and now activated?

>
Hi all,
I am developing a Stateful session bean that has a
Connection object as its instance variable. And this
bean starts transaction that spans across multiple
method calls and finally either commit or rollback.
BeanClass
UserTransaction utx;
Connection conn;
ejbCreate()
allocateconnection();
ejbRemove()
closeconnection();
ejbActivate()
allocateconnection();
ejbpassivate()
closeconnection();
StartTransaction()
utx = getusertransaction();
utx.begin();
Method1()
do something with database
Method2()
do something with database
CommitTransaction()
utx.commit();
For example, the typical usage of this bean would be:
bean.StartTransaction();
bean.Method1();
bean.Method2();
bean.CommitTransaction();
Here are my two questions:
1. General Question: In order for a Connection object
to join a Transaction, Do I have to create the
connection after the transaction has started?Strictly NO. In fact, the connection is obtained first and then can a transaction begin.
2. If the answer to the above question is yes, then: I
understand that when this bean get passivated, the
UserTransaction instance object would be passivated.
And since the connection object can't not be
passivated, I have to recreate the connection object
in ejbactivate() method, would newly created
connection participate in the same Transaction that
was being passivated and now activated?
The answer to first question being NO, your argument for question 2 does not hold true. According to the EJB specification, a stateful session bean can only be passivated between the transaction and not within a transaction. Your implementation for the stateful EJB is good to work.

Similar Messages

  • Timout error when ADF Swing+BC deployed as Stateful Session Bean

    i deploy the AM as stateful session bean onto OC4J 10.1.3,and the Client access them by Java Web Start.
    the error message is
    Exception in thread "AWT-EventQueue-0" oracle.jbo.JboException: JBO-29000: Error resuming transaction; nested exception is:
         javax.transaction.InvalidTransactionException: Cannot resume transaction that has been rolledback, rollback cause=Timed out
         at oracle.jbo.client.remote.ejb.RootApplicationModuleImpl.processRemoteJboException(RootApplicationModuleImpl.java:435)
         at oracle.jbo.client.remote.ejb.RootApplicationModuleImpl.doMessage(RootApplicationModuleImpl.java:333)
         at oracle.jbo.client.remote.ejb.EJBApplicationModuleImpl.doMessage(EJBApplicationModuleImpl.java:194)
         at oracle.jbo.client.remote.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:6887)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendServiceMessage(ApplicationModuleImpl.java:1122)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendServiceMessage(ApplicationModuleImpl.java:1150)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendRequest2(ApplicationModuleImpl.java:1219)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendRequest(ApplicationModuleImpl.java:1187)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendRequestReceiveResponse(ApplicationModuleImpl.java:1234)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendRequestReceiveValues(ApplicationModuleImpl.java:1250)
         at oracle.jbo.client.remote.ApplicationModuleImpl.isRangeAt(ApplicationModuleImpl.java:3856)
         at oracle.jbo.client.remote.RowSetIteratorImpl.isRangeAtTop(RowSetIteratorImpl.java:1109)
         at oracle.jbo.client.remote.RowSetImpl.isRangeAtTop(RowSetImpl.java:861)
         at oracle.jbo.client.remote.ViewUsageImpl.isRangeAtTop(ViewUsageImpl.java:968)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.isOperationEnabled(JUCtrlActionBinding.java:409)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.isActionEnabled(JUCtrlActionBinding.java:247)
         at com.kunteng.fabric.jclientview.MyJUNavigationBar._isEnabled(MyJUNavigationBar.java:1558)
         at com.kunteng.fabric.jclientview.MyJUNavigationBar._updateButtonStates(MyJUNavigationBar.java:1506)
         at com.kunteng.fabric.jclientview.MyJUNavigationBar$1.run(MyJUNavigationBar.java:1419)
         at java.awt.event.InvocationEvent.dispatch(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    ## Detail 0 ##
    oracle.oc4j.rmi.OracleRemoteException: Error resuming transaction
         at com.evermind.server.ejb.EJBTransactionManager.resumeRemote(EJBTransactionManager.java:202)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_transactionPostSuspend(StatefulSessionEJBObject.java:784)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteBaseManageAppModule_StatefulSessionBeanWrapper4.doMessage(RemoteBaseManageAppModule_StatefulSessionBeanWrapper4.java:491)
         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    at connection to /192.168.1.254
         at com.evermind.server.rmi.RMICall.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMICall.java:110)
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:128)
         at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
         at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
         at com.evermind.server.ejb.StatefulSessionRemoteInvocationHandler.invoke(StatefulSessionRemoteInvocationHandler.java:31)
         at __Proxy6.doMessage(Unknown Source)
         at oracle.jbo.client.remote.ejb.RootApplicationModuleImpl.invokeDoMessage(RootApplicationModuleImpl.java:485)
         at oracle.jbo.client.remote.ejb.RootApplicationModuleImpl.doMessage(RootApplicationModuleImpl.java:325)
         at oracle.jbo.client.remote.ejb.EJBApplicationModuleImpl.doMessage(EJBApplicationModuleImpl.java:194)
         at oracle.jbo.client.remote.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:6887)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendServiceMessage(ApplicationModuleImpl.java:1122)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendServiceMessage(ApplicationModuleImpl.java:1150)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendRequest2(ApplicationModuleImpl.java:1219)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendRequest(ApplicationModuleImpl.java:1187)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendRequestReceiveResponse(ApplicationModuleImpl.java:1234)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendRequestReceiveValues(ApplicationModuleImpl.java:1250)
         at oracle.jbo.client.remote.ApplicationModuleImpl.isRangeAt(ApplicationModuleImpl.java:3856)
         at oracle.jbo.client.remote.RowSetIteratorImpl.isRangeAtTop(RowSetIteratorImpl.java:1109)
         at oracle.jbo.client.remote.RowSetImpl.isRangeAtTop(RowSetImpl.java:861)
         at oracle.jbo.client.remote.ViewUsageImpl.isRangeAtTop(ViewUsageImpl.java:968)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.isOperationEnabled(JUCtrlActionBinding.java:409)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.isActionEnabled(JUCtrlActionBinding.java:247)
         at com.kunteng.fabric.jclientview.MyJUNavigationBar._isEnabled(MyJUNavigationBar.java:1558)
         at com.kunteng.fabric.jclientview.MyJUNavigationBar._updateButtonStates(MyJUNavigationBar.java:1506)
         at com.kunteng.fabric.jclientview.MyJUNavigationBar$1.run(MyJUNavigationBar.java:1419)
         at java.awt.event.InvocationEvent.dispatch(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
         Nested exception is:
    javax.transaction.InvalidTransactionException: Cannot resume transaction that has been rolledback, rollback cause=Timed out
         at com.evermind.server.ApplicationServerTransaction.resume(ApplicationServerTransaction.java:330)
         at com.evermind.server.ApplicationServerTransactionManager.resume(ApplicationServerTransactionManager.java:494)
         at com.evermind.server.ApplicationServer$2.resume(ApplicationServer.java:4559)
         at com.evermind.server.ejb.EJBTransactionManager.resume(EJBTransactionManager.java:209)
         at com.evermind.server.ejb.EJBTransactionManager.resumeRemote(EJBTransactionManager.java:200)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_transactionPostSuspend(StatefulSessionEJBObject.java:784)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteBaseManageAppModule_StatefulSessionBeanWrapper4.doMessage(RemoteBaseManageAppModule_StatefulSessionBeanWrapper4.java:491)
         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    at connection to /192.168.1.254
         at oracle.oc4j.rmi.OracleRemoteException.receive(OracleRemoteException.java:123)
         at oracle.oc4j.rmi.RmiTransport.annotateException(RmiTransport.java:141)
         at com.evermind.server.rmi.RMIClientConnection.handleMethodInvocationResponse(RMIClientConnection.java:812)
         at com.evermind.server.rmi.RMIClientConnection.handleOrmiCommandResponse(RMIClientConnection.java:242)
         at com.evermind.server.rmi.RMIClientConnection.dispatchResponse(RMIClientConnection.java:197)
         at com.evermind.server.rmi.RMIClientConnection.processReceivedCommand(RMIClientConnection.java:179)
         at com.evermind.server.rmi.RMIConnection.handleCommand(RMIConnection.java:154)
         at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands(RMIConnection.java:126)
         at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:105)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Unknown Source)

    when i use BC4J Test tool to connect to the Stateful Session Bean ,meet the same error .The full error message is
    oracle.jbo.JboException: JBO-29000: Error resuming transaction; nested exception is:
         javax.transaction.InvalidTransactionException: Cannot resume transaction that has been rolledback, rollback cause=Timed out
         at oracle.jbo.client.remote.ejb.RootApplicationModuleImpl.processRemoteJboException(RootApplicationModuleImpl.java:435)
         at oracle.jbo.client.remote.ejb.RootApplicationModuleImpl.doMessage(RootApplicationModuleImpl.java:333)
         at oracle.jbo.client.remote.ejb.EJBApplicationModuleImpl.doMessage(EJBApplicationModuleImpl.java:194)
         at oracle.jbo.client.remote.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:6887)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendServiceMessage(ApplicationModuleImpl.java:1122)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendServiceMessage(ApplicationModuleImpl.java:1150)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendRequest2(ApplicationModuleImpl.java:1219)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendRequest(ApplicationModuleImpl.java:1187)
         at oracle.jbo.client.remote.ApplicationModuleImpl.createAndInitRow(ApplicationModuleImpl.java:3989)
         at oracle.jbo.client.remote.RowSetIteratorImpl.createAndInitRow(RowSetIteratorImpl.java:1602)
         at oracle.jbo.client.remote.RowSetIteratorImpl.createRow(RowSetIteratorImpl.java:1553)
         at oracle.jbo.client.remote.RowSetImpl.createRow(RowSetImpl.java:1022)
         at oracle.jbo.client.remote.ViewUsageImpl.createRow(ViewUsageImpl.java:1168)
         at oracle.jbo.jbotester.NavBar$rsInsert.doAction(NavBar.java:151)
         at oracle.jbo.jbotester.AbstractJboAction.actionPerformed(AbstractJboAction.java:81)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    ## Detail 0 ##
    oracle.oc4j.rmi.OracleRemoteException: Error resuming transaction
         at com.evermind.server.ejb.EJBTransactionManager.resumeRemote(EJBTransactionManager.java:202)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_transactionPostSuspend(StatefulSessionEJBObject.java:784)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteBaseManageAppModule_StatefulSessionBeanWrapper4.doMessage(RemoteBaseManageAppModule_StatefulSessionBeanWrapper4.java:491)
         at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    at connection to FUWUQI/192.168.1.254
         at com.evermind.server.rmi.RMICall.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMICall.java:110)
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:128)
         at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
         at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
         at com.evermind.server.ejb.StatefulSessionRemoteInvocationHandler.invoke(StatefulSessionRemoteInvocationHandler.java:31)
         at __Proxy2.doMessage(Unknown Source)
         at oracle.jbo.client.remote.ejb.RootApplicationModuleImpl.invokeDoMessage(RootApplicationModuleImpl.java:485)
         at oracle.jbo.client.remote.ejb.RootApplicationModuleImpl.doMessage(RootApplicationModuleImpl.java:325)
         at oracle.jbo.client.remote.ejb.EJBApplicationModuleImpl.doMessage(EJBApplicationModuleImpl.java:194)
         at oracle.jbo.client.remote.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:6887)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendServiceMessage(ApplicationModuleImpl.java:1122)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendServiceMessage(ApplicationModuleImpl.java:1150)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendRequest2(ApplicationModuleImpl.java:1219)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendRequest(ApplicationModuleImpl.java:1187)
         at oracle.jbo.client.remote.ApplicationModuleImpl.createAndInitRow(ApplicationModuleImpl.java:3989)
         at oracle.jbo.client.remote.RowSetIteratorImpl.createAndInitRow(RowSetIteratorImpl.java:1602)
         at oracle.jbo.client.remote.RowSetIteratorImpl.createRow(RowSetIteratorImpl.java:1553)
         at oracle.jbo.client.remote.RowSetImpl.createRow(RowSetImpl.java:1022)
         at oracle.jbo.client.remote.ViewUsageImpl.createRow(ViewUsageImpl.java:1168)
         at oracle.jbo.jbotester.NavBar$rsInsert.doAction(NavBar.java:151)
         at oracle.jbo.jbotester.AbstractJboAction.actionPerformed(AbstractJboAction.java:81)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
         Nested exception is:
    javax.transaction.InvalidTransactionException: Cannot resume transaction that has been rolledback, rollback cause=Timed out
         at com.evermind.server.ApplicationServerTransaction.resume(ApplicationServerTransaction.java:330)
         at com.evermind.server.ApplicationServerTransactionManager.resume(ApplicationServerTransactionManager.java:494)
         at com.evermind.server.ApplicationServer$2.resume(ApplicationServer.java:4559)
         at com.evermind.server.ejb.EJBTransactionManager.resume(EJBTransactionManager.java:209)
         at com.evermind.server.ejb.EJBTransactionManager.resumeRemote(EJBTransactionManager.java:200)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_transactionPostSuspend(StatefulSessionEJBObject.java:784)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteBaseManageAppModule_StatefulSessionBeanWrapper4.doMessage(RemoteBaseManageAppModule_StatefulSessionBeanWrapper4.java:491)
         at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    at connection to FUWUQI/192.168.1.254
         at oracle.oc4j.rmi.OracleRemoteException.receive(OracleRemoteException.java:123)
         at oracle.oc4j.rmi.RmiTransport.annotateException(RmiTransport.java:141)
         at com.evermind.server.rmi.RMIClientConnection.handleMethodInvocationResponse(RMIClientConnection.java:812)
         at com.evermind.server.rmi.RMIClientConnection.handleOrmiCommandResponse(RMIClientConnection.java:242)
         at com.evermind.server.rmi.RMIClientConnection.dispatchResponse(RMIClientConnection.java:197)
         at com.evermind.server.rmi.RMIClientConnection.processReceivedCommand(RMIClientConnection.java:179)
         at com.evermind.server.rmi.RMIConnection.handleCommand(RMIConnection.java:154)
         at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands(RMIConnection.java:126)
         at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:105)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)
    ----- LEVEL 1: DETAIL 0 -----
    oracle.oc4j.rmi.OracleRemoteException: Error resuming transaction
         at com.evermind.server.ejb.EJBTransactionManager.resumeRemote(EJBTransactionManager.java:202)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_transactionPostSuspend(StatefulSessionEJBObject.java:784)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteBaseManageAppModule_StatefulSessionBeanWrapper4.doMessage(RemoteBaseManageAppModule_StatefulSessionBeanWrapper4.java:491)
         at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    at connection to FUWUQI/192.168.1.254
         at com.evermind.server.rmi.RMICall.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMICall.java:110)
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:128)
         at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
         at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
         at com.evermind.server.ejb.StatefulSessionRemoteInvocationHandler.invoke(StatefulSessionRemoteInvocationHandler.java:31)
         at __Proxy2.doMessage(Unknown Source)
         at oracle.jbo.client.remote.ejb.RootApplicationModuleImpl.invokeDoMessage(RootApplicationModuleImpl.java:485)
         at oracle.jbo.client.remote.ejb.RootApplicationModuleImpl.doMessage(RootApplicationModuleImpl.java:325)
         at oracle.jbo.client.remote.ejb.EJBApplicationModuleImpl.doMessage(EJBApplicationModuleImpl.java:194)
         at oracle.jbo.client.remote.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:6887)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendServiceMessage(ApplicationModuleImpl.java:1122)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendServiceMessage(ApplicationModuleImpl.java:1150)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendRequest2(ApplicationModuleImpl.java:1219)
         at oracle.jbo.client.remote.ApplicationModuleImpl.sendRequest(ApplicationModuleImpl.java:1187)
         at oracle.jbo.client.remote.ApplicationModuleImpl.createAndInitRow(ApplicationModuleImpl.java:3989)
         at oracle.jbo.client.remote.RowSetIteratorImpl.createAndInitRow(RowSetIteratorImpl.java:1602)
         at oracle.jbo.client.remote.RowSetIteratorImpl.createRow(RowSetIteratorImpl.java:1553)
         at oracle.jbo.client.remote.RowSetImpl.createRow(RowSetImpl.java:1022)
         at oracle.jbo.client.remote.ViewUsageImpl.createRow(ViewUsageImpl.java:1168)
         at oracle.jbo.jbotester.NavBar$rsInsert.doAction(NavBar.java:151)
         at oracle.jbo.jbotester.AbstractJboAction.actionPerformed(AbstractJboAction.java:81)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
         Nested exception is:
    javax.transaction.InvalidTransactionException: Cannot resume transaction that has been rolledback, rollback cause=Timed out
         at com.evermind.server.ApplicationServerTransaction.resume(ApplicationServerTransaction.java:330)
         at com.evermind.server.ApplicationServerTransactionManager.resume(ApplicationServerTransactionManager.java:494)
         at com.evermind.server.ApplicationServer$2.resume(ApplicationServer.java:4559)
         at com.evermind.server.ejb.EJBTransactionManager.resume(EJBTransactionManager.java:209)
         at com.evermind.server.ejb.EJBTransactionManager.resumeRemote(EJBTransactionManager.java:200)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_transactionPostSuspend(StatefulSessionEJBObject.java:784)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteBaseManageAppModule_StatefulSessionBeanWrapper4.doMessage(RemoteBaseManageAppModule_StatefulSessionBeanWrapper4.java:491)
         at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    at connection to FUWUQI/192.168.1.254
         at oracle.oc4j.rmi.OracleRemoteException.receive(OracleRemoteException.java:123)
         at oracle.oc4j.rmi.RmiTransport.annotateException(RmiTransport.java:141)
         at com.evermind.server.rmi.RMIClientConnection.handleMethodInvocationResponse(RMIClientConnection.java:812)
         at com.evermind.server.rmi.RMIClientConnection.handleOrmiCommandResponse(RMIClientConnection.java:242)
         at com.evermind.server.rmi.RMIClientConnection.dispatchResponse(RMIClientConnection.java:197)
         at com.evermind.server.rmi.RMIClientConnection.processReceivedCommand(RMIClientConnection.java:179)
         at com.evermind.server.rmi.RMIConnection.handleCommand(RMIConnection.java:154)
         at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands(RMIConnection.java:126)
         at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:105)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)

  • Stop passivation in stateful session bean

    hi
    How to stop the passivation in stateful session bean
    Regards
    Gajendran.G

    >
    Hi all,
    I am developing a Stateful session bean that has a
    Connection object as its instance variable. And this
    bean starts transaction that spans across multiple
    method calls and finally either commit or rollback.
    BeanClass
    UserTransaction utx;
    Connection conn;
    ejbCreate()
    allocateconnection();
    ejbRemove()
    closeconnection();
    ejbActivate()
    allocateconnection();
    ejbpassivate()
    closeconnection();
    StartTransaction()
    utx = getusertransaction();
    utx.begin();
    Method1()
    do something with database
    Method2()
    do something with database
    CommitTransaction()
    utx.commit();
    For example, the typical usage of this bean would be:
    bean.StartTransaction();
    bean.Method1();
    bean.Method2();
    bean.CommitTransaction();
    Here are my two questions:
    1. General Question: In order for a Connection object
    to join a Transaction, Do I have to create the
    connection after the transaction has started?Strictly NO. In fact, the connection is obtained first and then can a transaction begin.
    2. If the answer to the above question is yes, then: I
    understand that when this bean get passivated, the
    UserTransaction instance object would be passivated.
    And since the connection object can't not be
    passivated, I have to recreate the connection object
    in ejbactivate() method, would newly created
    connection participate in the same Transaction that
    was being passivated and now activated?
    The answer to first question being NO, your argument for question 2 does not hold true. According to the EJB specification, a stateful session bean can only be passivated between the transaction and not within a transaction. Your implementation for the stateful EJB is good to work.

  • How do i get back my stateful session bean after it has been passivated

    hi ,
    How do i get back my stateful session bean after it has been passivated by container.
    i'm confused that is it possible or not .......give me answer
    i've one stateful sessionbean which i'm accessing throgh my normal java client . now what i'm doing is when i first time call a method it is running ......then i'm shutting down the server jboss .......it is calling my ejbPassivate() method ... at this particular time client program doesn't do anything.....
    now after i restart my server i'm again calling back that business method with that last object reference.......it gives me the exception given below.....
    java.rmi.NoSuchObjectException: no such object in table
    java.rmi.NoSuchObjectException: no such object in table
         at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
         at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
         at sun.rmi.server.UnicastRef.invoke(Unknown Source)
         at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
         at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:118)
         at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:227)
         at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:167)
         at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
         at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
         at org.jboss.proxy.ejb.StatefulSessionInterceptor.invoke(StatefulSessionInterceptor.java:106)
         at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
         at $Proxy1.makeNewAcc(Unknown Source)
         at client.GanJavaClient.main(GanJavaClient.java:46)so pls tell me that is it possible to get back that session besn or not

    Stateful session beans are not persisted across restart of the EJB server instance(s) hosting them. You can't treat a Session bean as one would an entity bean.
    Chuck

  • Error While passivating Stateful session bean

     

    I also have same problem when WL passivating. However, the exception throwing from
    WL saying the "Ignoring exception raised while passivating".
    My question is will that exception lead to failure of passivating and evenually
    lead to memory leakage? I just thought that the memory is still in cache either
    removed or passivated, as a result more and more memory will be used up as more
    failure occurs.
    Frank
    Rob Woollen <[email protected]> wrote:
    It looks like you have a reference to a DB Connection as a member
    variable. This reference should be transient. You can re-acquire it
    in
    ejbActivate.
    -- Rob
    Hemant Arora wrote:
    Hi
    Can anybody please clarify the error that I'm getting while runningthe
    stateful session bean with weblogic
    I have instantiated 20 stateful session beans all using the DB connection
    but if the connection is unaailable I'm making the beans to wait.
    I'm not removeing the beans and again making the instance of 20 another
    beans
    The max beans in cache is 25.
    Thanks
    Hemant
    This is the output at the console of the weblogic
    ejbPassivate()
    Tue Jul 17 20:58:00 GMT+05:30 2001:<I> <EJB JAR deployment
    d:/weblogic/myserver/romanCount.jar> Ignoring exception raised while
    passivating:
    java.io.NotSerializableException:
    weblogic.jdbc20.rmi.internal.ConnectionImpl
    at
    java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1148)
    at
    java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
    at
    java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1841)
    at
    java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)
    at
    java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214)
    at
    java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
    at
    java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1841)
    at
    java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)
    Coming Soon: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnweblogic.com

  • Update object returned by a business method in stateful session bean

    I have a business method in stateful session Bean returning an Object "myObject getObject()". This object can be modified by the client.
    Is it necessary at the end to notify the bean about the changes with some kind of business method "setObject(Object myObject)"? or
    the client and the bean have the same reference to the object and it isn't necessary?
    Thanks

    When an EJB returns a value, it is serialised across the wire and is effectively lost to the EJB. Any changes to the returned object by the client, will have to be notified by a call on the EJB, as in your post.
    Dave

  • Stateful Session Beans are not passivated / serialized when cache idle time

    Technology: Sun Application Server version 7.0.0_01; JDK 1.4.1; developed on Windows 2000; Tested on Sun Solaris.
    Initial error on Sun Solaris:
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr: Exception in thread "service-j2ee-25" org.omg.CORBA.OBJ_ADAPTER: vmcid: SUN minor code: 1015 completed: No
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.ee.internal.POA.GenericPOAServerSC.preinvoke(GenericPOAServerSC.java:389)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.ee.internal.POA.ServantCachePOAClientSC.initServant(ServantCachePOAClientSC.java:112)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.ee.internal.POA.ServantCachePOAClientSC.setOrb(ServantCachePOAClientSC.java:95)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDRInputStream_1_0.createDelegate(CDRInputStream_1_0.java:760)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDRInputStream_1_0.internalIORToObject(CDRInputStream_1_0.java:750)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDRInputStream_1_0.read_Object(CDRInputStream_1_0.java:669)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:890)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:884)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDRInputStream.read_abstract_interface(CDRInputStream.java:307)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPInputStream.readObjectDelegate(IIOPInputStream.java:228)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPInputStream.readObjectOverride(IIOPInputStream.java:381)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:318)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.enterprise.iiop.IIOPHandleDelegate.getStub(IIOPHandleDelegate.java:58)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.enterprise.iiop.IIOPHandleDelegate.readEJBObject(IIOPHandleDelegate.java:38)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.ejb.portable.HandleImpl.readObject(HandleImpl.java:91)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPInputStream.readObject(Native Method)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1298)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPInputStream.inputObject(IIOPInputStream.java:908)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:261)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:981)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:287)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.copyObject(Util.java:598)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at javax.rmi.CORBA.Util.copyObject(Util.java:314)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.telstra.nodeman.ejb._NodeMaint_Stub.getHandle(Unknown Source)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.telstra.nodeman.arch.NMAViewBeanProxy.checkBeans(NMAViewBeanProxy.java:631)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.telstra.nodeman.view.html.NMAStandardButton.handleRequest(NMAStandardButton.java:143)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.telstra.nodeman.arch.NMAViewBeanBase.handleRequest(NMAViewBeanBase.java:1573)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.iplanet.jato.view.ViewBeanBase.dispatchInvocation(ViewBeanBase.java:824)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.iplanet.jato.view.ViewBeanBase.invokeRequestHandlerInternal(ViewBeanBase.java:637)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.iplanet.jato.view.ViewBeanBase.invokeRequestHandler(ViewBeanBase.java:595)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.iplanet.jato.ApplicationServletBase.dispatchRequest(ApplicationServletBase.java:772)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.iplanet.jato.ApplicationServletBase.processRequest(ApplicationServletBase.java:446)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.iplanet.jato.ApplicationServletBase.doPost(ApplicationServletBase.java:324)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.telstra.nodeman.view.ViewServlet.doPost(ViewServlet.java:243)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at java.security.AccessController.doPrivileged(Native Method)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:158)
    [10/Aug/2004:08:04:57] WARNING (17227): CORE3283: stderr:      at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    The above error caused the server to use all available memory and required a reboot to proceed.
    Subsequent testing against the Sun Appliucation Server 7 on Windows 2000 dev environment using the Sun Studio IDE for debugging and trace statements inserted in the code indicate that the Application Server is removing the Stateful Session Beans when they time out without an ejbPassivate event and without serializing the beans to the data-store. cache-idle-timeout-in-seconds set to 180 and removal-timeout-in-seconds set to 1800.
    The server.log indicates that the beans are timing out:
    [19/Aug/2004:18:15:10] WARNING ( 1664): [NRU-com.telstra.nodeman.ejb.AddressMaintBean]: IdleBeanCleanerTask finished after removing 2 idle beans
    Trace statements inserted in ejbPassivate do not appear in the log.
    It is my understanding that the above timeout should have caused an ejbPasssivate and serialization of the beans.
    The beans have been validated using Sun Java Studio Enterprise 6 with 'EJB validate'.
    My reading of the problem is that the beans are not being serialized and the error occurs when the application attempts to reference (getHandle) the bean after timeout.
    Any suggestions would be appreciated.

    Thanks Thorick.
    I am using NRU caching. WL 7.0 SP2.
    I have not defined idle-timeout-seconds in my weblogic-ejb-jar.xml. As I understand
    the default value for this is 600secs. So the ejbs should be removed after this
    time. Below is the
    weblogic-ejb-jar.xml that I am using.
    <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB//EN'
    'http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd'>
    <!-- Generated XML! -->
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>Cart</ejb-name>
    <stateful-session-descriptor>
    <stateful-session-clustering>
    <home-is-clusterable>true</home-is-clusterable>
    <replication-type>InMemory</replication-type>
    </stateful-session-clustering>
    </stateful-session-descriptor>
    <transaction-descriptor>
         <trans-timeout-seconds>
              60
         </trans-timeout-seconds>
    </transaction-descriptor>
    <jndi-name>CartHome</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    "thorick" <[email protected]> wrote:
    >
    The idle-timeout-seconds property controls the timeout/removal behavior.
    which stateful session cache type are you using ? LRUCache or NRUCache

  • Stateful session bean returns null

    Hi,
    I call a stateful session bean which should return a Long object. Everything works fine while the bean executes and the Long object is returned by the bean.
    But in the EJB-Client I get a null object.
    The EJB-Client is a OC4J 10g standalone server and the EJB-Server is a OC4J 9.03 server, both running on the same machine.
    Here are the JNDI properties:
    java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
    java.naming.provider.url=ormi://localhost:23791/ws
    java.naming.security.principal=admin
    java.naming.security.credentials=slash
    dedicated.rmicontext=true
    dedicated.connection=true
    Thanks for your help,
    A.

    Hi,
    Store HomeObject or EJB Object in the Session in the WebTier.
    Anil

  • HttpSession vs. Stateful Session Bean ---- when State Session is large

    I hope most of the people come across with this issue where to put the state
    for the internet/intranet based applications when they are using
    servlet/jsps calling session beans. Weblogic 4.5.1 does support httpsession
    in-memory replication for the servlets but the stateful session beans are
    not replicated in clustered environment. Plus with stateful bean u get
    activation/passivation overhead too. So one tempts to use stateless session
    beans and store state in httpsession?
    Then what is the upper limit for the session state one can put in
    HttpSession with the weblogic? Is there any way to configure it?
    One way to overcome the httpsession size limitation is to use database for
    storing state and just store some unique Ids for the session info in
    httpSession. But then there will be overhead for database connection?(jdbc
    connection pool can provide some help here). So what is the recommended way
    for doing this provided few thousand concurrent clients with session size
    say exceeding 4kb per client?
    Thanks
    Usmani

    There are no special setting in sun-ejb-jar.xml regarding cache settings. The default settings from server.xml are used:
        <jdbc-connection-pool steady-pool-size="8" max-pool-size="32" max-wait-time-in-millis="60000" pool-resize-quantity="2" idle-timeout-in-seconds="300" is-isolation-level-guaranteed="false" is-connection-validation-required="false" connection-validation-method="auto-commit" fail-all-connections="false" datasource-classname="oracle.jdbc.pool.OracleDataSource" name="ebs">
          <property value="jdbc:oracle:thin:@myebsdbsserver:1521:ebsdevdb" name="url"/>
          <property value="ebs" name="user"/>
          <property value="ebs" name="password"/>
        </jdbc-connection-pool>
      <ejb-container steady-pool-size="32" pool-resize-quantity="16" max-pool-size="64" cache-resize-quantity="32" max-cache-size="512" pool-idle-timeout-in-seconds="600" cache-idle-timeout-in-seconds="600" removal-timeout-in-seconds="5400" victim-selection-policy="nru" commit-option="B" monitoring-enabled="true">
         </ejb-container>The Session Bean uses Container Managed Transaction. Is it possible in this case, that the bean isn't 'idle enough' in order to set into passivated?

  • Cannot remove stateful session bean when transaction timed out

    The transaction timeout is set to 5 minutes. After several operations on the transactional
    stateful session bean(implements SessionSynchronization), the transaction timed out
    after 5 minutes and I got the IllegalStateException when calling another business
    method. After the transaction rolled back, weblogic.ejb20.locks.LockTimedOutException
    was thrown when attempting to remove the bean. It seems the lock on the bean was
    not released even though the transaction had been rolled back. Does anyone know how
    to remove the bean in this kind of situation?
    Here is the stacktrace:
    ####<Jun 11, 2002 2:39:35 PM PDT> <Notice> <EJB> <app1x.zaplet.cc> <server25044server>
    <ExecuteThread: '11' for queue: 'default'> <> <23168:7b09681c532dc7e3> <010015> <Error
    marking transaction for rollback: java.lang.IllegalStateException: Cannot mark the
    transaction for rollback. xid=23168:7b09681c532dc7e3, status=Rolled back. [Reason=weblogic.transaction.internal.TimedOutException:
    Transaction timed out after 299 seconds
    Xid=23168:7b09681c532dc7e3(3203140),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds
    since begin=299,seconds left=60,activeThread=Thread[ExecuteThread: '11' for queue:
    'default',5,Thread Group for Queue: 'default'],ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=ended,assigned=none),SCInfo[server25044+server25044server]=(state=active),properties=({weblogic.jdbc=t3://10.0.100.93:7001}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=server25044server+10.0.100.93:7001+server25044+,
    Resources={})],CoordinatorURL=server25044server+10.0.100.93:7001+server25044+)]>
    java.lang.IllegalStateException: Cannot mark the transaction for rollback. xid=23168:7b09681c532dc7e3,
    status=Rolled back. [Reason=weblogic.transaction.internal.TimedOutException: Transaction
    timed out after 299 seconds
    Xid=23168:7b09681c532dc7e3(3203140),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds
    since begin=299,seconds left=60,activeThread=Thread[ExecuteThread: '11' for queue:
    'default',5,Thread Group for Queue: 'default'],ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=ended,assigned=none),SCInfo[server25044+server25044server]=(state=active),properties=({weblogic.jdbc=t3://10.0.100.93:7001}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=server25044server+10.0.100.93:7001+server25044+,
    Resources={})],CoordinatorURL=server25044server+10.0.100.93:7001+server25044+)]
         at weblogic.transaction.internal.TransactionImpl.throwIllegalStateException(TransactionImpl.java:1486)
         at weblogic.transaction.internal.TransactionImpl.setRollbackOnly(TransactionImpl.java:466)
         at weblogic.ejb20.manager.BaseEJBManager.handleSystemException(BaseEJBManager.java:255)
         at weblogic.ejb20.manager.BaseEJBManager.setupTxListener(BaseEJBManager.java:215)
         at weblogic.ejb20.manager.StatefulSessionManager.preInvoke(StatefulSessionManager.java:371)
         at weblogic.ejb20.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:117)
         at weblogic.ejb20.internal.StatefulEJBObject.preInvoke(StatefulEJBObject.java:169)
         at mypackage.MyBean_wbr3eg_EOImpl.addRecipients(MyBean_wbr3eg_EOImpl.java:450)
    ####<Jun 11, 2002 2:39:37 PM PDT> <Info> <EJB> <app1x.zaplet.cc> <server25044server>
    <ExecuteThread: '11' for queue: 'default'> <> <> <010049> <EJB Exception in method:
    remove: weblogic.ejb20.locks.LockTimedOutException: The lock request from EJB:AppmailBean
    with primary key:21,775,960,933,010,237 timed-out after waiting 0 ms. The transaction
    or thread requesting the lock was:Thread[ExecuteThread: '11' for queue: 'default',5,Thread
    Group for Queue: 'default'].>
    weblogic.ejb20.locks.LockTimedOutException: The lock request from EJB:AppmailBean
    with primary key:21,775,960,933,010,237 timed-out after waiting 0 ms. The transaction
    or thread requesting the lock was:Thread[ExecuteThread: '11' for queue: 'default',5,Thread
    Group for Queue: 'default'].
         at weblogic.ejb20.locks.ExclusiveLockManager$LockBucket.lock(ExclusiveLockManager.java:448)
         at weblogic.ejb20.locks.ExclusiveLockManager.lock(ExclusiveLockManager.java:258)
         at weblogic.ejb20.manager.StatefulSessionManager.acquireLock(StatefulSessionManager.java:226)
         at weblogic.ejb20.manager.StatefulSessionManager.acquireLock(StatefulSessionManager.java:216)
         at weblogic.ejb20.manager.StatefulSessionManager.preInvoke(StatefulSessionManager.java:310)
         at weblogic.ejb20.manager.StatefulSessionManager.remove(StatefulSessionManager.java:754)
         at weblogic.ejb20.internal.StatefulEJBObject.remove(StatefulEJBObject.java:86)
         at mypackage.MyBean_wbr3eg_EOImpl.remove(MyBean_wbr3eg_EOImpl.java:7308)

    If a stateful session throws a RuntimeException (your rollback) the container destroys the instance of the bean and all
    associated state information is lost, as required by the EJB specification.
    If you want to maintain client state it is generally best to use HttpSession objects (if you have a web application)
    for short-lived, client-specific data and JPA entities or other database backed storage for long-lived data.

  • My weblogic 7 can not run stateful session bean??

    Hi,all
    I create a stateful session bean in jbuilder 7 and deploy it to weblogic 7,it
    successed.The Home interface have a method like this:
    public TestRemote create(int var) throws RemoteException, CreateException;
    But the client test bean call the create(int var) method throwing
    a exception :
    java.lang.IllegalArgumentException: wrong number of arguments
    Start server side stack trace:
    java.lang.IllegalArgumentException: wrong number of arguments
         at java.lang.reflect.Constructor.newInstance(Native Method)
         at weblogic.rmi.internal.OIDManager.makeActivatableServerReference(OIDManager.java:203)
         at weblogic.rmi.internal.OIDManager.getReplacement(OIDManager.java:129)
         at weblogic.common.internal.RemoteObjectReplacer.getReplacement(RemoteObjectReplacer.java:265)
         at weblogic.common.internal.RemoteObjectReplacer.replaceObject(RemoteObjectReplacer.java:107)
         at weblogic.common.internal.ChunkedObjectOutputStream.replaceObject(ChunkedObjectOutputStream.java:53)
         at weblogic.common.internal.ChunkedObjectOutputStream$NestedObjectOutputStream.replaceObject(ChunkedObjectOutputStream.java:239)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:323)
         at weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:107)
         at weblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.java:82)
         at com.berserk.ejb.Test_a6z4o8_HomeImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:346)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:300)
         at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:762)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:295)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    End server side stack trace
    -- Failed: create(0)
         at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:109)
         at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:127)
         at com.berserk.ejb.Test_a6z4o8_HomeImpl_WLStub.create(Unknown Source)
         at com.berserk.ejb.TestClient1.create(TestClient1.java:102)
         at com.berserk.ejb.TestClient1.main(TestClient1.java:199)
    -- Return value from create(0): null.
    Then I deploy it to the borland application server 4.5,it did work!!
    Somebody can help me ?thx

    Try throwing a CreateException in ejbCreate (int var).
    Jackie wrote:
    hi,Sabha:
    My source codes is like this.
    the home interface:
    import java.rmi.*;
    import javax.ejb.*;
    public interface TestHome extends EJBHome
    public TestRemote create(int var) throws RemoteException, CreateException;
    the remote interface :
    import java.rmi.*;
    import javax.ejb.*;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2002</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    public interface TestRemote extends EJBObject
    public void saycool() throws java.rmi.RemoteException;
    the stateful bean:
    import java.rmi.*;
    import javax.ejb.*;
    public class Test implements SessionBean
    private SessionContext sessionContext;
    private int m_var;
    public void ejbCreate(int var)
    this.m_var=var;
    public void ejbRemove()
    public void ejbActivate()
    public void ejbPassivate()
    public void setSessionContext(SessionContext sessionContext)
    this.sessionContext = sessionContext;
    public void saycool() throws java.rmi.RemoteException
    System.out.println("so cool");
    the client test class:
    import javax.naming.*;
    import java.util.Properties;
    import javax.rmi.PortableRemoteObject;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2002</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    public class TestClient1
    static final private String ERROR_NULL_REMOTE = "Remote interface reference
    is null. It must be created by calling one of the Home interface methods first.";
    static final private int MAX_OUTPUT_LINE_LENGTH = 100;
    private boolean logging = true;
    private TestHome testHome = null;
    private TestRemote testRemote = null;
    //Construct the EJB test client
    public TestClient1()
    long startTime = 0;
    if (logging)
    log("Initializing bean access.");
    startTime = System.currentTimeMillis();
    try
    //get naming context
    Context ctx = getInitialContext();
    //look up jndi name
    Object ref = ctx.lookup("TestRemote");
    //cast to Home interface
    testHome = (TestHome) PortableRemoteObject.narrow(ref, TestHome.class);
    if (logging)
    long endTime = System.currentTimeMillis();
    log("Succeeded initializing bean access.");
    log("Execution time: " + (endTime - startTime) + " ms.");
    catch(Exception e)
    if (logging)
    log("Failed initializing bean access.");
    e.printStackTrace();
    private Context getInitialContext() throws Exception
    String url = "t3://lettam:7001";
    String user = null;
    String password = null;
    Properties properties = null;
    try
    properties = new Properties();
    properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    properties.put(Context.PROVIDER_URL, url);
    if (user != null)
    properties.put(Context.SECURITY_PRINCIPAL, user);
    properties.put(Context.SECURITY_CREDENTIALS, password == null
    ? "" : password);
    return new InitialContext(properties);
    catch(Exception e)
    log("Unable to connect to WebLogic server at " + url);
    log("Please make sure that the server is running.");
    throw e;
    // Methods that use Home interface methods to generate a Remote interface
    reference
    public TestRemote create(int var)
    long startTime = 0;
    if (logging)
    log("Calling create(" + var + ")");
    startTime = System.currentTimeMillis();
    try
    testRemote = testHome.create(var);
    if (logging)
    long endTime = System.currentTimeMillis();
    log("Succeeded: create(" + var + ")");
    log("Execution time: " + (endTime - startTime) + " ms.");
    catch(Exception e)
    if (logging)
    log("Failed: create(" + var + ")");
    e.printStackTrace();
    if (logging)
    log("Return value from create(" + var + "): " + testRemote + ".");
    return testRemote;
    // Methods that use Remote interface methods to access data through the bean
    public void saycool()
    if (testRemote == null)
    System.out.println("Error in saycool(): " + ERROR_NULL_REMOTE);
    return ;
    long startTime = 0;
    if (logging)
    log("Calling saycool()");
    startTime = System.currentTimeMillis();
    try
    testRemote.saycool();
    if (logging)
    long endTime = System.currentTimeMillis();
    log("Succeeded: saycool()");
    log("Execution time: " + (endTime - startTime) + " ms.");
    catch(Exception e)
    if (logging)
    log("Failed: saycool()");
    e.printStackTrace();
    public void testRemoteCallsWithDefaultArguments()
    if (testRemote == null)
    System.out.println("Error in testRemoteCallsWithDefaultArguments():
    " + ERROR_NULL_REMOTE);
    return ;
    saycool();
    // Utility Methods
    private void log(String message)
    if (message == null)
    System.out.println("-- null");
    return ;
    if (message.length() > MAX_OUTPUT_LINE_LENGTH)
    System.out.println("-- " + message.substring(0, MAX_OUTPUT_LINE_LENGTH)
    + " ...");
    else
    System.out.println("-- " + message);
    //Main method
    public static void main(String[] args)
    TestClient1 client = new TestClient1();
    client.create(0);
    // Use the client object to call one of the Home interface wrappers
    // above, to create a Remote interface reference to the bean.
    // If the return value is of the Remote interface type, you can use it
    // to access the remote interface methods. You can also just use the
    // client object to call the Remote interface wrappers.
    Thank you for your help!!
    "Sabha" <[email protected]> wrote:
    Can you attach the sources of your ejb. Thanks.
    -Sabha
    "Jackie Lee" <[email protected]> wrote in message
    news:[email protected]...
    Hi,all
    I create a stateful session bean in jbuilder 7 and deploy it to weblogic7,it
    successed.The Home interface have a method like this:
    public TestRemote create(int var) throws RemoteException,CreateException;
    But the client test bean call the create(int var) method throwing
    a exception :
    java.lang.IllegalArgumentException: wrong number of arguments
    Start server side stack trace:
    java.lang.IllegalArgumentException: wrong number of arguments
    at java.lang.reflect.Constructor.newInstance(Native Method)
    atweblogic.rmi.internal.OIDManager.makeActivatableServerReference(OIDManager.j
    ava:203)
    at weblogic.rmi.internal.OIDManager.getReplacement(OIDManager.java:129)
    atweblogic.common.internal.RemoteObjectReplacer.getReplacement(RemoteObjectRep
    lacer.java:265)
    atweblogic.common.internal.RemoteObjectReplacer.replaceObject(RemoteObjectRepl
    acer.java:107)
    atweblogic.common.internal.ChunkedObjectOutputStream.replaceObject(ChunkedObje
    ctOutputStream.java:53)
    atweblogic.common.internal.ChunkedObjectOutputStream$NestedObjectOutputStream.
    replaceObject(ChunkedObjectOutputStream.java:239)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:323)
    atweblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObject
    OutputStream.java:107)
    atweblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.java:8
    2)
    at com.berserk.ejb.Test_a6z4o8_HomeImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:346)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:300)
    atweblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:762)
    atweblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:295)
    atweblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
    0)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    End server side stack trace
    -- Failed: create(0)
    atweblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.
    java:109)
    at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:127)
    at com.berserk.ejb.Test_a6z4o8_HomeImpl_WLStub.create(Unknown Source)
    at com.berserk.ejb.TestClient1.create(TestClient1.java:102)
    at com.berserk.ejb.TestClient1.main(TestClient1.java:199)
    -- Return value from create(0): null.
    Then I deploy it to the borland application server 4.5,it did work!!
    Somebody can help me ?thx
    Rajesh Mirchandani
    Developer Relations Engineer
    BEA Support

  • Error in updating secondary stateful session bean

              Hi all,
              I have set up a cluster of 2 managed servers with WebLogic 6.1. I have a
              stateful session bean and several stateless session beans. the stateful
              session bean keeps user info and limited cached objects, all are
              serializable. it seems working fine, even after killing any one of the
              servers, as long as one is alive. a java application client creates a
              stateful session bean first, then calls stateless session beans with the
              remote interface of the stateful bean as a method parameter. No problem
              when stateful session bean is created. However, each stateless bean method
              generates the following error message if I turn the debug on (level 64). No
              exception stack traces, and all methods execute successfully.
              <Error> <EJB> <Failed to update the secondary copy of a stateful session
              bean from home:clientsession>
              I wonder what causes the error, and why it tries to update the stateful
              session bean. in all stateless session beans, only read into the stateful
              bean.
              Thank you,
              Fujin
              

    This has been fixed in WLS 6.1 SP2.
              jagdip Talla wrote:
              > Hi Fujin,
              > please let me know, if u were able to solve the problem..
              >
              > hi guys,
              > appreciate if you could give me some clues
              > how to solve this problem ?
              >
              > i hv 2 WLS instances in a cluster,
              > when one server instance is shut down, i keep getting these errors ?
              > is it normal ?
              > <Feb 19, 2002 2:57:53 PM SGT> <Error> <EJB> <Failed to update the secondary copy of a stateful session bean from home:ejb/xyzrel1_2/xxxxHome>
              >
              > appreciate if u can let me know, if u could solve it..?
              >
              > thanks n regads
              > jagdip
              Rajesh Mirchandani
              Developer Relations Engineer
              BEA Support
              

  • SAME EJB 3.0 Stateful Session bean for different JSP sessions returned

    Forum,
    I have a strange problem utilizing stateful session beans. Please note, that I am using jdeveloper for the following:
    1) Here is a basic stateful session bean:
    @Stateful(name = "DemoClass")
    public class DemoClassBean implements DemoClass,
               DemoClassLocal, SessionSynchronization {
          public static int id=0;
          public DemoClassBean() {
          id++;
          public int getId() {
             return id;
          //... other methods
    }2) This bean is accessed from a JSP for testing purpose, I am copying only the script used in JSP:
    <%
       DemoClass bean = null;
       try {
          bean = (DemoClass) ((new javax.naming.InitialContext()).
                       lookup("DemoClass "));
          System.out.println("ID=" + bean.getId() );
          } catch (javax.naming.NamingException e) {
             // TODO
    %>If this page is addressed by different clients, from different browsers, the same bean is returned.
    Here is what I see in the logs:
    ID=1
    ID=1
    ID=1
    The same problem is being observed when this session bean is accessed from a JSF Backing bean.
    What could be wrong? Is this a bug in oc4j / jdeveloper (version 10.1.3.3.0)?
    Edited by: smw000000001 on Nov 17, 2008 10:52 AM

    Hi,
    The code for stateful is perfectly fine and working in a normal way. The way you are trying to implement the stateful session bean in your application is wrong.
    think of binding the stateful session bean with HttpSession object.
    So that you will get a unique stateful session bean object.

  • How to track the stateful Session Bean?

    Hi all,
    Am in a serious trouble. I have a message driven bean which will get initiated when some message gets dumped into the queue. I have got session bean which i use to process message which my message driven bean takes from the queue.
    My problem is, lets say there are 3 msgs in the queue. lets say the messages be "aaaa", "aaaa" and "bbbb".
    In this case, when i read the first message, i will create an instance of the session bean to process the message "aaaa". When i receive the second message still i create an instance to process the message "aaaa". When i get the 3rd message, i create an instance to process the message "bbbb".
    My problem in this is, i want to create only one instance of session bean for the message "aaaa".
    So once i create the instance for session bean for particular message, i need to store the object or something of the instance which i created along with the message. Please help me with what i can store with which i can reffer to the session bean again.
    Please see the sample code too.
    Thanks in advance,
    Ashly
    if(msg.equals("aaaa"))
    First n;
    Object obj = ctx.lookup("ejb/First");
    FirstHome home = (FirstHome) PortableRemoteObject.narrow(obj, FirstHome.class);
    n = home.create(msg);
    }

    Hi,
    thanks for information. But i have one question. In a stateful session bean why do we have to store the Remote Interface on the client side.
    I expected in the second jsp page when i do a lookup or create, the container/server should find out whether there is a session bean already created for this session if yes, then return that particular instance of the session bean else create a new one.
    If this is not a possible case then a stateful session bean is nuthing but an instance of an object in the EJB container which does not get destroyed unless there is a time out or the remove method is called. It has nuthing to do with session because throughout the session I have to store the remote interface in the session context of the client( the client here means the jsp).
    thanks in advance
    Anurag

  • Handling Transaction in Stateful Session Bean

    I wrote a public method like public void doTransaction()
    it will call 2 private method, like: methodA and methodB
    Both private methods have db accesss statement and will update the db. They got different db connection and will close the connection when method call finished.
    How to include them to one transaction? I want to be able to rollback the job of the first method when I catch exception thrown by the second method.
    I tried simply define transaction type of the public method to be Container and Required. But it doesn't work, the first method doesn't rollback. Of course I can let the 2 private methods share a same connection and commit after finishing calling them. But how if they are in different DB?

    Ok... Here it goes...
    You can do it in the following manner.
    As you said you have got 2 private methods doing d/b updates and these are called from a public method.
    Stateful session beans since associated with a client across methods, you can take advantage of it. Write your own user defined transaction.
    Begin the transaction scope in your public before calling the 1st private method. Call the 2 methods in a try block. Once you are done with these methods, you can commit and end the transaction. If you get any exception, rollback the transaction in the catch block. Otherwise if u get any exception in the 2nd method, you can rollback the transaction there itself.
    Stateful session beans lets u allow to spawn the bean managed transaction across methods. you can begin your transaction in one method and end it in a differnt method or you can end the transaction after calling the methods.
    The problem you are dealing with can typically very well handled by writing bean managed transaction.
    Hope this helps. If you need anymore clarity on my solution, please let me know.
    -amit

Maybe you are looking for