Possibly you ran into a timeout, and the stateful session been has been removed by the container.
You can use @StatefulTimeout
(EJB 3.1) to set this value. A quote from the Javadoc:
Specifies the amount of time a stateful session bean can be idle (not receive any client invocations) before it is eligible for removal by the container.
To verify if that is really the case, add a method with @PreDestroy
, so you can see if the SFSB has been removed.
Example:
@Stateful(name = "xxx")
@StatefulTimeout(value = 15, unit = TimeUnit.SECONDS)
public class Sfsb {
@PreDestroy
public void preDestroy() {
System.out.println("INFO: " + "@PreDestroy");
}
}