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
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to