Reputation: 1302
I have a stateful session bean that inject extended entity manager. When I deploy the application for some time, an exception occur indicating that extended Entity manager is not serialized. after some search I found that passivation of the bean might be the cause of this exception.
Note: please don't ask about the code it is just a stateful bean with extended entity manager called by an application scope cdi bean.
Upvotes: 4
Views: 862
Reputation: 393
You must set passivationCapable to false.
passivationCapable Specifies whether this stateful session bean is passivation capable
@Stateful(passivationCapable=false)
public class HelloBean {
private NonSerializableType ref = ...
. . .
}
Upvotes: 3