4 Replies Latest reply on Sep 18, 2008 9:52 AM by aconn7

    EJB Timeout firing too soon on bootup; LoginContext not avai

    aconn7

      On bootup, any expired timers go off. My EJB @Timeout method attempts to login first to establish and identity. However on bootup, it seems the JAAS/LoginContext facility is not established.

      It would seem I need to somehow set a simple dependency for the EJB on startup. How is this done?

      Here is my stack trace:
      2008-09-15 14:43:59,734 INFO [org.jboss.ejb3.EJBContainer] STARTED EJB: com.bittware.parts.session.dominosync.ConErpSync ejbName: ConErpSync
      2008-09-15 14:44:00,093 INFO [com.bittware.parts.session.dominosync.ConErpSync] ConErpSync.timeout expired ...

      2008-09-15 14:44:00,109 ERROR [STDERR] javax.security.auth.login.LoginException: unable to find LoginModule class: No ClassLoaders found for: com.bittware.parts.session.ContainerLogin
      2008-09-15 14:44:00,109 ERROR [STDERR] at javax.security.auth.login.LoginContext.invoke(LoginContext.java:808)
      2008-09-15 14:44:00,109 ERROR [STDERR] at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
      2008-09-15 14:44:00,109 ERROR [STDERR] at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
      2008-09-15 14:44:00,109 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
      2008-09-15 14:44:00,109 ERROR [STDERR] at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
      2008-09-15 14:44:00,109 ERROR [STDERR] at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
      2008-09-15 14:44:00,109 ERROR [STDERR] at com.bittware.parts.session.dominosync.ConErpSync.login(ConErpSync.java:166)
      2008-09-15 14:44:00,109 ERROR [STDERR] at com.bittware.parts.session.dominosync.ConErpSync.timeout(ConErpSync.java:330)
      2008-09-15 14:44:00,109 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2008-09-15 14:44:00,109 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      2008-09-15 14:44:00,109 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      2008-09-15 14:44:00,109 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
      2008-09-15 14:44:00,109 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
      2008-09-15 14:44:00,109 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
      2008-09-15 14:44:00,109 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
      2008-09-15 14:44:00,109 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      2008-09-15 14:44:00,109 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
      2008-09-15 14:44:00,109 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      2008-09-15 14:44:00,109 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      2008-09-15 14:44:00,109 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      2008-09-15 14:44:00,109 ERROR [STDERR] at org.jboss.ejb3.tx.BMTInterceptor.handleStateless(BMTInterceptor.java:71)
      2008-09-15 14:44:00,109 ERROR [STDERR] at org.jboss.ejb3.tx.BMTInterceptor.invoke(BMTInterceptor.java:131)
      2008-09-15 14:44:00,109 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      2008-09-15 14:44:00,109 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
      2008-09-15 14:44:00,109 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      2008-09-15 14:44:00,109 ERROR [STDERR] at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:249)
      2008-09-15 14:44:00,109 ERROR [STDERR] at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:236)
      2008-09-15 14:44:00,109 ERROR [STDERR] at org.jboss.ejb3.mdb.MessagingContainer.callTimeout(MessagingContainer.java:290)
      2008-09-15 14:44:00,109 ERROR [STDERR] at org.jboss.ejb.txtimer.TimerImpl$TimerTaskImpl.run(TimerImpl.java:561)
      2008-09-15 14:44:00,109 ERROR [STDERR] at java.util.TimerThread.mainLoop(Timer.java:512)
      2008-09-15 14:44:00,109 ERROR [STDERR] at java.util.TimerThread.run(Timer.java:462)

        • 1. Re: EJB Timeout firing too soon on bootup; LoginContext not
          aconn7

          I have more information that makes this a bit more perplexing. I found that if there are ANY pending timers at all, even if they don't go off during bootup, that I get this error.

          • 2. Re: EJB Timeout firing too soon on bootup; LoginContext not
            aconn7

            To clarify: If there are any pending timers at the time of bootup. It doesn't matter whether they fire during the bootup cycle or afterwards.

            Furthermore, once this error has occurred for pre-existing timers, NEW timers receive this error as well.

            If the timer pool is empty at the time of bootup, new timers work just fine.

            • 3. Re: EJB Timeout firing too soon on bootup; LoginContext not
              aconn7

              Did some hunting around, seems that during bootup the JAAS stuff will only look in the default/lib and I'll need to put my security module there.

              Can someone confirm that this may be the problem?

              • 4. Re: EJB Timeout firing too soon on bootup; LoginContext not
                aconn7

                Ok. Really need help here.

                I am able to confirm that by placing my classes and properties in the conf/lib folders that persisted timers will work. However, I don't think that is a practical solution.

                What if my timers depended on more of my application being initialized?

                There must be some way to delay the timer service startup. In addition, having to maintain my application classes in the deployed .EAR and also the lib folder is a maintenance nightmare.

                Help appreciated!!!