[jboss-user] [JBoss Seam] - Re: No active application scope in long running process

apushadow do-not-reply at jboss.com
Tue Feb 27 17:56:24 EST 2007


Ahh, ok.  This answers a lot of my questions.  I'm looking forward to a solution to this problem.

I use Seam 1.1.6 with Tomcat and Embedded EJB.  I'm trying to prototype being able to run a method at a specified time - the method must (1) send an email, (2) update the database and (3) raise an event so that some @Observer methods get called to refresh collections of objects shown on-screen - and I've had mixed results:

--Using the @Asynchronous annotation doesn't work at all using the Embedded EJB stuff.
--Integrating Quartz with Seam (add quartz.jar and quartz.properties and it magically works) and kicking off a task at a specific time works, but I can't use a lot of Seam's cool functionality in that new thread - namely Emailing, which throws a NPE (JBSEAM-892), and Events, which gives me a "No active application scope" error.  Updating the database works (since I passed-in a reference to my persister bean), but I have to use JavaMail to send emails (passing-in the Email Renderer isn't sufficient) and I can no longer rely on the @Observer annotation to update the lists (I'm still working on an alternative).

Ideally (and this is easy for me to say, heh), it would be cool to be able to use Seam's scheduling, emailing and event system, regardless of what thread I'm running (or perhaps provide a way to reference those contexts?), but I know this is no easy task.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023342#4023342

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023342



More information about the jboss-user mailing list