-
1. Re: Could not activate; failed to restore state
surajmundada Aug 6, 2004 5:09 AM (in response to surajmundada)Hi,
It seems I have fixed the problem.
I was calling this stateful session bean from a servlet.
In servlet, I had declared remote interface object for this bean as a global variable. That was the problem. Because when I moved this declaration inside the doService() method where it is created by calling create() on home interface, I didn't get any exception/error, whatever may be the no. of concurrent requests to the servlet.
The remote interface object after initialization in first request might have been overwritten/reinitialized again by the next request to servlet, before sending response for the first request. That means reference to the state associated with the first remote intreface object was lost this causing the "Failed to restore state" problem.
Thanks,
Suraj
wrong one:public class testserv extends HttpServlet { remote interface object declaration; .. .. service() { ... ... } doPost() { ... ... } }
correct one:public class testserv extends HttpServlet { .. .. service() { remote interface object declaration; ... ... } doPost() { ... ... } }