7 Replies Latest reply on Jul 30, 2007 9:14 AM by nhieb

    Need help with Timer in Seam application

    nhieb

      Hey guys, i hope somebody would be able to help.
      I am using timer service of EJB in a Seam application. When method marked as @TimeOut is called, i am getting

      Error invoking ejbTimeout: javax.ejb.EJBTransactionRolledbackException: java.lang.NullPointerException: facesContext

      I have no clue what facesContext it is looking for??? in my bean there is no any links to it. All the methods along work fine, but when @Timeout is called, the methods of ejb services fail with that exception.
      The souce code
      @SuppressWarnings({"unchecked"})
      @Stateless
      @Name("jobsTimerService")
      public class JobsTimerServiceImpl implements JobsTimerService {
       //in hours
       public final static int DUE_DATE_EXPIRATION_INTERVAL_IN_HOURS=2;
      
       @In(create = true)
       EmailHelper emailHelper;
      
       @Resource
       javax.ejb.TimerService timerService;
      
       @EJB
       AdditionalService additionalService
      
       @EJB
       UsersService usersService;
      
       @Logger
       private Log log;
      
       public void createTimer(long intervalDuration, String info) {
       Timer timer = timerService.createTimer(intervalDuration, intervalDuration,info);
       }
      
       @Timeout
       public void timeout(Timer timer) {
       sendNotifications();
       }
      
      
       public void sendNotifications(){
       List<User> recepients=getRecipients();
       //usually it fails in the next method!!!!!
       List objects=getObjects();
       emailHelper.send(recepients,wires);
       }
      
       }
      
       public List getObjects(){
       //using additionalService, getting the list of objects
       }
      
       public List<User> getRecipients() {
       //using usersService.. getting the list of users
       }
      
      }

      I have killed a lot time trying to find out what is wrong. If i invoke sendNotifications from UI of application, it works perfectly fine!!
      Thanks for attention

        • 1. Re: Need help with Timer in Seam application
          gavin.king

          stack trace??

          • 2. Re: Need help with Timer in Seam application
            nhieb

            That is the only thing i am getting in the logs

            Error invoking ejbTimeout: javax.ejb.EJBTransactionRolledbackException: java.lang.NullPointerExcepti
            on: facesContext



            • 3. Re: Need help with Timer in Seam application
              nhieb

              this is the full stack trace that i caught

              javax.ejb.EJBTransactionRolledbackException: java.lang.NullPointerException: facesContext
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:93)
              15:28:00,260 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
              15:28:00,260 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:211)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
              15:28:00,260 ERROR [STDERR] at $Proxy644.findExpiringWires(Unknown Source)
              15:28:00,260 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              15:28:00,260 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              15:28:00,260 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              15:28:00,260 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:72)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:50)
              15:28:00,260 ERROR [STDERR] at org.javassist.tmp.java.lang.Object_$$_javassist_502.findExpiringWires(Object_$$_javassist_502.java)
              15:28:00,260 ERROR [STDERR] at com.dbzco.das.helpers.EmailHelper.getExpiringWires(EmailHelper.java:78)
              15:28:00,260 ERROR [STDERR] at com.dbzco.das.helpers.EmailHelper.initData(EmailHelper.java:66)
              15:28:00,260 ERROR [STDERR] at com.dbzco.das.helpers.EmailHelper.send(EmailHelper.java:47)
              15:28:00,260 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              15:28:00,260 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              15:28:00,260 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              15:28:00,260 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.interceptors.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:34)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:47)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.interceptors.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:151)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
              15:28:00,260 ERROR [STDERR] at com.dbzco.das.helpers.EmailHelper_$$_javassist_527.send(EmailHelper_$$_javassist_527.java)
              15:28:00,260 ERROR [STDERR] at com.dbzco.das.services.JobsTimerServiceImpl.timeout(JobsTimerServiceImpl.java:55)
              15:28:00,260 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              15:28:00,260 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              15:28:00,260 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              15:28:00,260 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:37)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:47)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.interceptors.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:113)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:53)
              15:28:00,260 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor537.invoke(Unknown Source)
              15:28:00,260 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              15:28:00,260 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:46)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
              15:28:00,260 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.callTimeout(StatelessContainer.java:150)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb.txtimer.TimerImpl$TimerTaskImpl.run(TimerImpl.java:524)
              15:28:00,260 ERROR [STDERR] at java.util.TimerThread.mainLoop(Timer.java:512)
              15:28:00,260 ERROR [STDERR] at java.util.TimerThread.run(Timer.java:462)
              15:28:00,260 ERROR [STDERR] Caused by: java.lang.NullPointerException: facesContext
              15:28:00,260 ERROR [STDERR] at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:110)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:148)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.core.Events.raiseEvent(Events.java:63)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.security.Identity.checkPermission(Identity.java:438)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.security.Identity.checkEntityPermission(Identity.java:601)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.security.EntitySecurityListener.postLoad(EntitySecurityListener.java:24)
              15:28:00,260 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor536.invoke(Unknown Source)
              15:28:00,260 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              15:28:00,260 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
              15:28:00,260 ERROR [STDERR] at org.hibernate.ejb.event.ListenerCallback.invoke(ListenerCallback.java:31)
              15:28:00,260 ERROR [STDERR] at org.hibernate.ejb.event.EntityCallbackHandler.callback(EntityCallbackHandler.java:78)
              15:28:00,260 ERROR [STDERR] at org.hibernate.ejb.event.EntityCallbackHandler.postLoad(EntityCallbackHandler.java:71)
              15:28:00,260 ERROR [STDERR] at org.hibernate.ejb.event.EJB3PostLoadEventListener.onPostLoad(EJB3PostLoadEventListener.java:35)
              15:28:00,260 ERROR [STDERR] at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:201)
              15:28:00,260 ERROR [STDERR] at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
              15:28:00,260 ERROR [STDERR] at org.hibernate.loader.Loader.doQuery(Loader.java:717)
              15:28:00,260 ERROR [STDERR] at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
              15:28:00,260 ERROR [STDERR] at org.hibernate.loader.Loader.loadEntity(Loader.java:1784)
              15:28:00,260 ERROR [STDERR] at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
              15:28:00,260 ERROR [STDERR] at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
              15:28:00,260 ERROR [STDERR] at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2977)
              15:28:00,260 ERROR [STDERR] at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:393)
              15:28:00,260 ERROR [STDERR] at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:374)
              15:28:00,260 ERROR [STDERR] at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:137)
              15:28:00,260 ERROR [STDERR] at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:193)
              15:28:00,260 ERROR [STDERR] at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:101)
              15:28:00,260 ERROR [STDERR] at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
              15:28:00,260 ERROR [STDERR] at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:846)
              15:28:00,260 ERROR [STDERR] at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266)
              15:28:00,260 ERROR [STDERR] at org.hibernate.type.EntityType.resolve(EntityType.java:303)
              15:28:00,260 ERROR [STDERR] at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:116)
              15:28:00,260 ERROR [STDERR] at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
              15:28:00,260 ERROR [STDERR] at org.hibernate.loader.Loader.doQuery(Loader.java:717)
              15:28:00,260 ERROR [STDERR] at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
              15:28:00,260 ERROR [STDERR] at org.hibernate.loader.Loader.doList(Loader.java:2144)
              15:28:00,260 ERROR [STDERR] at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
              15:28:00,260 ERROR [STDERR] at org.hibernate.loader.Loader.list(Loader.java:2023)
              15:28:00,260 ERROR [STDERR] at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:393)
              15:28:00,260 ERROR [STDERR] at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
              15:28:00,260 ERROR [STDERR] at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
              15:28:00,260 ERROR [STDERR] at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
              15:28:00,260 ERROR [STDERR] at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
              15:28:00,260 ERROR [STDERR] at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64)
              15:28:00,260 ERROR [STDERR] at com.dbzco.das.services.WireFinderImpl.findExpiringWires(WireFinderImpl.java:103)
              15:28:00,260 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              15:28:00,260 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              15:28:00,260 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              15:28:00,260 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:37)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.interceptors.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
              15:28:00,260 ERROR [STDERR] at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:53)
              15:28:00,260 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor537.invoke(Unknown Source)
              15:28:00,260 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              15:28:00,260 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:46)
              15:28:00,260 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              15:28:00,260 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
              15:28:00,260 ERROR [STDERR] ... 94 more


              • 4. Re: Need help with Timer in Seam application
                nhieb

                I guess it has something to do with permissions for loading entities, since i think my class when it is called through timeout callback doesn't have those permissions. How do i fix that?

                • 5. Re: Need help with Timer in Seam application
                  wise_guybg

                  In think you should focus on the NPE.

                  15:28:00,260 ERROR [STDERR] Caused by: java.lang.NullPointerException: facesContext
                  15:28:00,260 ERROR [STDERR] at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.jav
                  a:110)
                  15:28:00,260 ERROR [STDERR] at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpress
                  ion(ActionParamBindingHelper.java:58)
                  15:28:00,260 ERROR [STDERR] at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionPar
                  amMethodBinding.java:75)
                  15:28:00,260 ERROR [STDERR] at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:148)
                  15:28:00,260 ERROR [STDERR] at org.jboss.seam.core.Events.raiseEvent(Events.java:63)
                  15:28:00,260 ERROR [STDERR] at org.jboss.seam.security.Identity.checkPermission(Identity.java:438)
                  15:28:00,260 ERROR [STDERR] at org.jboss.seam.security.Identity.checkEntityPermission(Identity.java
                  :601)


                  You may have an observer (Expressions$2.invoke) of the event (Events.raiseEvent) "org.jboss.seam.notLoggedIn" (Identity.checkPermission) which is causing the trouble. This should be located in the components.xml Some MethodBinding/MethodExpression that is failing. You may need to post some more code if you cannot figure it out by yourself.

                  • 6. Re: Need help with Timer in Seam application
                    gavin.king

                    What version of Seam is this?

                    • 7. Re: Need help with Timer in Seam application
                      nhieb

                      Thanks for responses!
                      Seam
                      Created-By: 1.5.0_07-87 ("Apple Computer, Inc.")
                      Seam-Version: 1.2.1.GAImplementation-Version: 1.2.1.GA

                      Also, wise_guybg, you are correct about the org.jboss.seam.notLoggedIn" component in components.xml/ Howerver, removing that doesn't solve the problem. It throws NotLoggedInExcpetion while trying to load the entity. The funny thing i noticed is the following.
                      If i load an entity that doesn't have a collection (lazy fetch type), the entity is loaded fine. but when i am trying to get entity with collections, the excpetion is thrown. Even the authentification in method doesn't solve that problem

                      Identity identity = new Identity();
                       identity.setUsername(TEST_USERNAME);
                       AuthenticatorImpl authenticator = new AuthenticatorImpl();
                       authenticator.setIdentity(identity);
                       authenticator.setEntityManager(em);
                       authenticator.setLog(Logging.getLog(Authenticator.class));
                       authenticator.authenticate();
                       authenticator.setActor(new Actor());

                      I have a temproraily fix -getting the properties this way
                      Query query= em.createQuery
                       ("select new map(r.id as id, r.amount as amount, r.createdDate as created, " +
                       "r.dueDate as due, r.reference as reference, r.status as status, r.createdBy as who) " +
                       "from WireTransferRequest r where r.dueDate >= :beginDate and r.dueDate <= :endDate"+
                       " and r.status<>:status" )
                       .setParameter("beginDate", beginDate)
                       .setParameter("endDate", endDate)
                       .setParameter("status", Status.TRANSMITTED);

                      and then creating objects and setting the pulled properties, but still wondering if there is a nice fix for that