Somkiat,
That is what happened. Your stateful sb got passivated after it has been inactive for some time. Your app server (i.e.
jboss) serialised the bean and saved it "D:\jboss-3.2.1_tomcat-4.1.24\server\default\tmp\sessions\SearchPatientManage-dtcpwdvw-r\dtcy9x08-2j.ser" file.
After the bean got timed out in the passivated (i.e. serialised) state the app server removed it - the file the bean got serialised to was deleted.
After all of the above happened your client that still had a reference to the bean's component interface tried to call a biz method on it. The first thing the app server did was to try to activate the bean (i.e. deserialise it). But the file (i.e. a file the bean has been serialised to) has been deleted and therefore the container cannot find it. That's why the app server throws "javax.ejb.EJBException: Could not activate; failed to restore state; CausedByException is: D:\jboss-3.2.1_tomcat-4.1.24\server\default\tmp\sessions\SearchPatientManage-dtcpwdvw-r\dtcy9x08-2j.ser (The system cannot find the file specified) "
In JBoss you can specify "maximum time in seconds a passivated bean can stay inactive before it has been removed". This is set in standardjboss.xml (container wide configuration, "cache configuration can be overridden for individual beans using jboss.xml")
<container-configuration>
<container-name>Standard Stateful SessionBean</container-name>
<!--OR
<container-name>Clustered Stateful SessionBean</container-name>
-->
..........
<container-cache-conf>
<cache-policy>org.jboss.ejb.plugins.LRUStatefulContextCachePolicy</cache-policy>
<cache-policy-conf>
...........
<!--This is where you set the maximum bean life in passivated state. Time in seconds -->
<max-bean-life>1800</max-bean-life>
I found info on the jboss config in JBoss 3.0 Deployment and Administration Handbook, written by Meeraj Moidoo Kunnumpurath
Hope it helps.