-
1. Re: RequestScoped bean invoked by a cron Job throws ContextNotActiveException
peteroyle.howardmoon.hitcity.com.au May 23, 2011 10:44 PM (in response to fernando_jmt)Hi Fernando,
Apologies for the extended silence. I'm now back working on Seam Cron. All I can really say at the moment is that this is currently a known limitation of Cron. I have SEAMCRON-6 filed so that I can experiment with this at some point and see if we can support this use case (even if only under EJB). Feel free to watch that issue to get immediate feedback as it happens.
In the meantime using an @ApplicationScoped bean without any @RequestScoped dependencies for scheduled methods will work - if that's at all possible given your specific requirements.
Also I'm available a lot of the time in the 'seam' channel of freenode.org (username PeteRoyle) to help out with any issues. The one caveat there is that I'm GMT-plus-10.
Cheers,
Pete
-
2. Re: RequestScoped bean invoked by a cron Job throws ContextNotActiveException
peteroyle.howardmoon.hitcity.com.au May 25, 2011 6:51 PM (in response to fernando_jmt)oops, that's #seam on irc.freenode.net -
3. Re: RequestScoped bean invoked by a cron Job throws ContextNotActiveException
fernando_jmt May 26, 2011 9:45 AM (in response to fernando_jmt)Hi,
Thanks for your comments.
I'm currently using @Dependent (no annotation) beans and it is working so far. It is a rule in our project to implement all business logic in @RequestScoped beans, they work fine and most of the cases they have methods we want to re-use or invoke in a cron fired service's method, but currently this is not possible. So we have to create another bean (@Dependent) and repeat the same logic that currently is in some other @RequestScoped beans. So it would be fine to have request scope working in asynchronous or cron-fired methods.
I'll be watching the JIRA issue.
Regards,