Best way to remove Stateful session beans
Hi folks.
I'm running Weblogic 6.1. I'm trying to find the best way of removing
stateful session beans. I know to call EJBObject.remove() on the
client side, but this will not always happen if the client crashes or
times out. This is a java client application connection to weblogic,
no servlets are involved.
Is there a way to signal the appserver to remove all stateful session
beans associated with a user when the User logs out? I would rather
not remove them using a time out mechanism.
thanks.
rob.
But in the documentation and also based on my experience I noticed that the
timeout does not take effect till the max-beans-in-cache limit is reached.
How do you handle that?
"Thomas Christen" <[email protected]> wrote in message
news:3e35795d$[email protected]..
Hi,
Is there a way to signal the appserver to remove all stateful session
beans associated with a user when the User logs out? I would rather
not remove them using a time out mechanism.Had the same problem and solved it the following way :
- The client has thread polling its sessionbean at the server (every 30
Sec.)
- The session bean has a short timeout (2 Minutes)
If the client fails, the timeout will catch it otherwise the client will
gracefully call remove bevor exit.
Regards
Tomy
Similar Messages
-
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. -
I use EJB3, JPA, JSF in my web application. There are 2 database tables: Teacher and Student. A teacher can have many (or none) students and a student can have at most 1 teacher.
I have a JSF page to print the teacher info and all his students' info. I don't want to load the students' info eagerly because there's another JSF page I need to display the teacher info only. So I have a stateful session bean to retrieve the teacher info and all his students' info. The persistence context in that stateful session bean has the type of PersistenceContextType.EXTENDED. The reason I choose a stateful session bean and an extended persistence context is that I want to write something like this without facing the lazy initialization exception:
<h:dataTable value="#{backingBean.teacher.students}" var="student">
<h:outputText value="${student.name}"/>
</h:dataTable>Because my session bean is stateful, I have a method with the @Remove annotation. This method is empty because I don't want to persist anything to the database.
Now, my question is: How can I make the @Remove method of my stateful session bean be called automatically when my JSF page finishes being rendered?Philip Petersen wrote:
I have a few questions concerning the EJB remove method.
1) What is the purpose of calling the remove method on stateless session
bean?There isn't one.
>
2) What action does the container take when this method is called?It checks that you were allowed to call remove (a security check) and then
just returns.
>
3) What happens to the stateless session bean if you do not call the remove
method?Nothing
>
4) Is it a good practice to call the remove method, or should the remove
method be avoided in the case of stateless session beans?
Personally, I never do it.
-- Rob
>
>
Thanks in advance for any insight that you may provide.
Phil--
AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
by Michael Girdley, Rob Woollen, and Sandra Emerson
http://learnWebLogic.com
[att1.html] -
When will Stateful Session Bean be removed?
I develop a stateful session bean and deploy it in the oc4j server successfully.
I write a java GUI Frame.
This Frame call this stateful Session bean and get some data,
and hold its remote interface reference as Frame's private member.
Code like that:
public class CargoFrame extends JFrame
//private member
private DataPager dataPager;
I found that before i release CargoFrame, Stateful session bean will be removed.
And System report session time out.
And i want to know when stateful session bean will be removed,
and how to set the session time?Default is 30mts.
This is done as a parameter in orion-ejb-jar.xml. Please look at the EJB Guide at http://otn.oracle.com/docs/products/ias/doc_library/903doc_otn/generic.903/a97677/dtdxml.htm#634197 for details
regards
Debu -
EJB 3.0 Stateful session bean shared between Servlet's
Hello
I have a bit of a noob question regarding Stateful sessions beans.
I am wanting to know if there is a way that I can share an instance of a session bean between multiple HttpServlet instances?
I am sending XML messages from a mobile J2ME application, there will be several http POST's made from the mobile client to the server. I would like these multiple POST's to be passed from the handling servlet instance to the same uniquely identified single stateful session bean instance (i can then @Remove the stateful bean when I have finished my several requests).
I would greatly appreciate any tips anyone could give me.If not, your only option is to maintain the
association yourself by creating a unique id for
each
conversation and storing that id along with the SFSB
reference in the ServletContext. Then you'll
need to pass the id in along with each invocation to
retrieve the appropriate SFSB reference.Thanks for your reply.
Will I always be presented with the same ServletContext instance? Even if the time between requests might be many minutes? Where can I learn more about how to use the ServletContext?
Thanks! -
Creating multiple stateful session beans from a java client. (EJB 3.0)
I'm having difficulties with the following:
To access the ShoppingCartBean, I have to put the following annotation in my standalone java client:
@EJB
private static ShoppingCartRemote shoppingCartBean;
The static must be there, thus only one ShoppingCartBean will exist within my java client. But as the ShoppingCartBean is a stateful session bean, I want to be able to get different beans of the same type.
What is the correct way to do this in EJB 3.0?Great question. Because Home interfaces have been removed for the EJB 3.0 simplified
API, stateful session bean creation happens as a side-effect of injection. However, the
same is true of EJB 3.0 business interface lookups. The easiest way to create additional
stateful session beans is to lookup the same dependency that was declared via your
@EJB annotation.
E.g.,
// Assuming the declaring class is pkg1.ShoppingCartClient.java
InitialContext ic = new InitialContext();
ShoppingCartRemote scr1 = (ShoppingCartRemote)
ic.lookup("java:comp/env/pkg1.ShoppingCartClient/shoppingCartBean");
Note that the name relative to java:comp/env is the default associated with your
@EJB annotation since the name() attribute wasn't used. Alternatively, you
could have used :
@EJB(name="scb") private static ShoppingCartRemote shoppingCartBean;
InitialContext ic = new InitialContext();
ShoppingCartRemote scr1 = (ShoppingCartRemote) ic.lookup("java:comp/env/scb");
Yet another alternative is to declare the @EJB at the class-level. This just defines
the dependency without any injection, which is fine if you want to create a bunch of
them via lookup anyway.
@EJB(name="scb", beanInterface=ShoppingCartRemote.class)
public class .... { -
Stateful Session Bean Question
I have a stateful session bean being invoked by my web tier on several request/response transactions. What would be the best way to locate the same session bean ? Would that be the create method in the Home i/f or would i need to supply a finder method for locating an existing bean?
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
UsmaniThere 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? -
Remove() on Session Bean
Is it strictly necessary to call the remove() method of a session bean when
I am done using it? Won't the container simply clean up session beans when
the session times-out, or will they be left hanging around in memory?
Is it simply a case of 'good programming practice' to call remove() at the
right times?
Mark.My response was for stateless session beans. For stateless session beans, there
is not a direct correspondance between calling remove on the EJBObject and the
containter callind ejbRemove on the bean. The container only calls ejbRemove on
the bean when it evicts a bean from the freepool. In WLS 5.1, this never
happens.
For stateful session beans, calling remove on the EJBObject will cause ejbRemove
to be called on the bean class. If you don't call remove, the container will
eventually passivate the bean and then remove it from the disk (once it has been
passivated for > idle-timeout-seconds). You will save yourself some disk access
if you call remove on the reference.
In general, it's probably good practice to call remove.
-- Rob
Tom Preston wrote:
You don't have to call remove. Here is a post with Rob Wollen response on the
remove issue from a couple days ago on ejb list:
++++++++++++++=
No.
-- Rob
Eran Erlich wrote:
Hi.
Is there any difference if I call it or not ?
will calling ejbRemove affect the free pool or cache in any way ?
Thanks.
--Eran++++++++++++++=
Mark Bower wrote:
Is it strictly necessary to call the remove() method of a session bean when
I am done using it? Won't the container simply clean up session beans when
the session times-out, or will they be left hanging around in memory?
Is it simply a case of 'good programming practice' to call remove() at the
right times?
Mark.--
Tom
Thomas Preston
Vacation.com, Inc.
Engineering Department
617.210.4850 x 124 -
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 AMHi,
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. -
Stateful Session Bean Initialization (EJB 3.0)
Hi all!
In EJB 2.1 the initialization was with create (args) methods. NOw, how is it exploited? Create methods are no more there and there must be a way to send parameters to the stateful session bean when it is newly created...isn't it?
Thank you!There is no pre-defined equivalent of a create method in EJB 3.0. If you want to initialize a
stateful session bean, just define a business method that the client should use as an initialization
method. -
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 -
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 -
How can I create a stateful session bean?
I created a stateless session bean. Now I want to make it be a stateful session bean. How can I do? Where can I find a session bean sample?
Thanks
QingLook at this site. The tutorial explains it all.
Well if you want to convert your stateless EJB to stateful, all you have to do is change the deployment descriptor and re-deploy the ejb. You should be ready to go.
All the best. -
Lock Timed out exception in stateful Session Bean
Hi All,
We have a stateful session bean and put the reference of the bean in HttpSession
and retrieve it from other JSP.
While calling a method from bean, we are often getting the following exception.
Any help please?
weblogic.ejb.extensions.LockTimedOutException: Lock for primaryKey:1018581328443_46
could not be acquired without waiting.
at weblogic.ejb.internal.LockManagerImpl.lock(LockManagerImpl.java:134)
at weblogic.ejb.internal.LockManagerImpl.lock(LockManagerImpl.java:81)
at weblogic.ejb.internal.StatefulEJBCache.bind(StatefulEJBCache.java:447)
at weblogic.ejb.internal.StatefulEJBObject.getContextForInvoke(StatefulEJBObject.java:159)
at weblogic.ejb.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:487)
at com.elink.jbe.savejobses.SaveJobSesBeanEOImpl.getJobHeaderData(SaveJobSesBeanEOImpl.java:1258)
at jsp_servlet._jobentry._jbeenquirydefaults._jspService(_jbeenquirydefaults.java:243)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:123)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:761)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:708)
at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:252)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:346)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:246)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)Hi Arjuna,
Thanks for your suggestions. But can you also help me how to make the session
bean thread safe?
Thanks in Advance
Srinath
"Arjuna Chala" <[email protected]> wrote:
Looks like you have two threads accessing the bean at the same time.
You
need to make it thread safe. Also, store the handle of the session bean
instead of the session bean itself in the session.
By the way, session beans (handle or otherwise) are not meant to be stored
in the HttpSession, and here is why:
http://groups.google.com/groups?q=stateful+session+bean+httpsession&hl=en&se
lm=3b72acb9%40newsgroups.bea.com&rnum=6
"srinath" <[email protected]> wrote in message
news:[email protected]...
Hi All,
We have a stateful session bean and put the reference of the bean inHttpSession
and retrieve it from other JSP.
While calling a method from bean, we are often getting the followingexception.
Any help please?
weblogic.ejb.extensions.LockTimedOutException: Lock forprimaryKey:1018581328443_46
could not be acquired without waiting.
atweblogic.ejb.internal.LockManagerImpl.lock(LockManagerImpl.java:134)
atweblogic.ejb.internal.LockManagerImpl.lock(LockManagerImpl.java:81)
atweblogic.ejb.internal.StatefulEJBCache.bind(StatefulEJBCache.java:447)
atweblogic.ejb.internal.StatefulEJBObject.getContextForInvoke(StatefulEJBObjec
t.java:159)
atweblogic.ejb.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:487)
atcom.elink.jbe.savejobses.SaveJobSesBeanEOImpl.getJobHeaderData(SaveJobSesBea
nEOImpl.java:1258)
atjsp_servlet._jobentry._jbeenquirydefaults._jspService(_jbeenquirydefaults.ja
va:243)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:123)
atweblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:761)
atweblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:708)
atweblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
Manager.java:252)
atweblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:346)
atweblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:246)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
Maybe you are looking for
-
Length error occurred during in IMPORT statement
Dear Friends, (length error occurred during in IMPORT statement),when im using the SUBMIT syntax..can i know what is the reason. Thanks Rajkumar.A
-
I've noticed that it is possible to miss mouse events if you move the mouse very quickly. For example, if you quickly move the mouse off a control, you can fairly easily miss the MouseOut event. Is there a Best Practice way to get around this? Thanks
-
Automatic confirmation indicator set in TO
Dear forum I am creating a transfer order with reference to a delivery, using transaction LT03. But when I look at the transfer order in display mode after it is created, the Confirmation indicator (LTAK-KQUIT) is set automatically in the TO. How is
-
Script with diff.page formats
Hi friends, My client needs some pages of the form in A4 format and some in A3 format. Could you please let me know how to do it? Thanks in advance... -MSReddy
-
SQL Server Service Broker Updating Stored procedure
how can you update the service broker stored procedure. when i update the stored procedure the changes dont come into affect. i have tried to alter the queue, waited for all jobs to finish, but some how still the old stored procedure is running. is t