[jboss-user] [EJB 3.0] - SessionContext and TimerService
go_rags
do-not-reply at jboss.com
Thu Feb 8 16:29:42 EST 2007
Hi,
I am using JBossAS 4.0.3 SP1 in our product and recently tried to add a timer service to it. I am having problem retrieving the session context for writing a Timer Service. I am getting a NULL value injected for both the TimerService and SessionContext, is there a way to work around it.
I am invoking the startPolling() method on startup from a servlet.
|
| @Stateless
| @Remote(IRSSPoller.class)
| public class RSSPoller implements IRSSPoller {
|
| private @Resource
| SessionContext ctx;
|
| private @Resource
| TimerService tms;
|
| private @PersistenceContext
| EntityManager _entityManager;
|
|
| public void startPolling() {
|
| if (ctx == null) System.err.println("SessionContext is NULL!!");
| if (tms == null) System.err.println("TimerService is NULL!!");
|
| if (ctx != null) {
| ctx.getTimerService().createTimer(new Date(),
| milliseconds, com.nukore.hub.rss.RSSPoller.class);
| }
| }
|
| @Timeout
| public void timeoutHandler(Timer timer) {
|
| //Timer Method....
|
| }
|
| }
|
|
Thanks in advance.
-
Raghu.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4013278#4013278
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4013278
More information about the jboss-user
mailing list