I'm having a problem about the bean lifecycle I don't understand. I have a @SessionScoped bean in my war:
@Named
@SessionScoped
public class UserBean implements Serializable {
@Inject
UserServicesLocal userServices;
[...]
}
then a @Staseful session bean in the ejb part:
@Stateful
@LocalBean
@SessionScoped
@ExcludeDefaultInterceptors
public class UserServices implements UserServicesLocal, Serializable {
[...]
}
they play nicely but when an unchecked exception is generated in the ejb part the SFSB "die". I understand it's the expected behavior but I don't understand how to manage this situation. For example: the user go into a page where he can upload an xls file, upload a file and then the processing of the file fail for some weird reason. The "WeirdReasonException" is not caught, the SFSB disappear, and every subsequent call generate a "javax.ejb.NoSuchObjectLocalException: The EJB does not exist". I know I should avoid leave an exception uncaught, but if something weird pass I think the user should be able to continue his work. Is there a method to "force" the recreation of the SFSB?
Thank you