• Post Reply Bookmark Topic Watch Topic
  • New Topic

AssertionError

 
Chandar Vel
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All
In my project, we are using weblogic server 4.5.1. The idle timeout for the EJBs are kept at 1200 seconds (20 minutes) session timeout = 220 secs. There are only certain pages which call these stateful EJB(s), the other pages dont call the methods(Remote) of the EJB,they just call the jsps and hence the httpsession is active each time the request is made for such pages.The session time out for the jsps is kept at 30 minutes. Sometimes what happens is, even though the session hasnt timed out the bean times out because of the fact the bean is not used for the specified time(even though the session is used quite frequently). So when i call the method on the EJB i am getting an ASSERTION ERROR in the log (Assertion error is not an exception and it just pops-up in the log, The exception i get is mentioned below). I dont know how to catch this exception individually. I tried catching the RemoteException but it didnt work out as i could not figure out whether it is because of the Assertion error or someother error thrown by the EJB server. Also i tried adding a method in the remote interface which simply does nothing (just to reset the session timeout) and each time the session clock gets reset i call this method. I am not sure whether it is the proper way to handle.
Can anyone help me in this regard. Your timely help in this regard will be highly appreciated as this is an urgent requirement to fix this problem in my project.

Exception
at weblogic.ejb.pstore.PersistableEORef.<init>(EOReplacer.java, Compiled Code)
at weblogic.ejb.pstore.EOReplacer.replaceObject(EOReplacer.java, Compiled Code)
at weblogic.common.internal.ReplacerObjectInputStream.resolveObject(ReplacerObjectInputStream.java:70)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java, Compiled Code)
at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java, Compiled Code)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java, Compiled Code)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java, Compiled Code)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java, Compiled Code)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java, Compiled Code)
at weblogic.ejb.pstore.nonTxPSFile.setup(nonTxPSFile.java, Compiled Code)
at weblogic.ejb.internal.SessionEJBContext.setBean(SessionEJBContext.java, Compiled Code)
at weblogic.ejb.internal.SessionEJBContext.afterBegin(SessionEJBContext.java, Compiled Code)
at com.hsl.tango.controller.IncomeRequest.updateLoanInfo(IncomeRequest.java, Compiled Code)
at weblogic.ejb.internal.BaseEJBObject.preInvoke(BaseEJBObject.java, Compiled Code)
at weblogic.ejb.internal.StatefulEJBObject.remove(StatefulEJBObject.java, Compiled Code)
Thanks a bunch
Chandar
 
Chandar Vel
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All
Please help me in this regard. It is very Urgent in my project.
Thanks
Chandar
 
Marya Doery
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't help you, but have you tried looking at BEA site for tips? http://search.beasys.com/weblogic/gonews/
You can also post your question there.
 
Chandar Vel
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much mary. I will look into that. Will let you know if i find something.
 
Chandar Vel
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All
I went to the bea newsgroup and I am surprised to find lot of fellow developers getting similar problem although may be for different reasons . Here are some of the reasons and the way to rectify them as mentioned in that site.
1) Invalid reference in the case of stateless session bean. (ie) Once you create the ref. of stateless bean and execute the method and if you want to execute some other method in the bean even though immediately you need to re-instantiate the bean.
2) By avoiding TX_SUPPORTED if it is a non-transactional bean it may be fixed. If the bean does pure selects and not updates.
3) Service pack for 4.5.1 weblogic might help. In my case it didn't
4) Increase the idle timeout and session timeout. In my case it didnt
........
Unfortunately i could not find a place how to capture the exception which i needed. I tried catching the exception and putting it in the printStream
PrintWriter pw = new PrintWriter();
try {
ejbHomeInterface.method();
} catch(Exception e) {
e.printStactTrace(pw);
scrap(pw) for assertion error string
}
since the assertion error comes as a log and not as an exception scrapping for that didnt help.
So I am back to square-1.
 
Sam Wong
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope I'm not out to lunch here but I believe AssertionErrors are thrown by the container. Hence, you won't be able to catch it. As for how to solve your problem. If you're using stateful session beans, then is it possible to modify the design using a stateless? We've experienced instances where the obj ref is no longer valid during the duration of a session. So instead, we cache the home ref and reinstantiate the obj ref each time. Food for thought.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!