1 2 Previous Next 26 Replies Latest reply on Oct 30, 2006 10:45 PM by modoc

    Scheduling in Seam?

    modoc

      I have a seam component which has a method I would like to invoke on a scheduled basis. All the jboss scheduler docs I can find seem to say the scheduled code has to be deployed in a .sar.

      1) I'd really like to avoid having to put a .sar next to my .jar and .war just for one class.

      2) I'm not even sure if I could make seam lookups/calls between my .jar and .sar... right?

      Any suggestions on how I can get my code called on a schedule?

      Regards,

      Modoc

        • 1. Re: Scheduling in Seam?
          gavin.king

          You mean using Seam 1.1 @Asynchronous methods? You don't need a sar...

          • 2. Re: Scheduling in Seam?
            modoc

            I hadn't seen that. I was referring to the normal jboss scheduler.

            I will checkout the @Asynchronous...

            Thanks!

            • 3. Re: Scheduling in Seam?
              modoc

              in Chapter 13, it refers to the IntervalDuration as a long (millis I assume?):

              @Asynchronous public Timer scheduleAlerts(Alert alert, @Expiration Date date, @IntervalDuration long interval) { ... }


              But in Chapter 7, it refers to it as a Date:

              @Asynchronous
              public void processRecurringPayment(Payment payment, @Expiration Date date, @IntervalDuration Date interval)'


              A long doesn't seem to work, and the seam source java comments refer to a Date, however, it doesn't make any sense to me to measure an interval with a date... A date is a fixed date, not a duration or interval. If I am supposed to use a date, how do I create a date for one minute?

              Thanks!

              • 4. Re: Scheduling in Seam?
                gavin.king

                It should be a long. The JavaDoc is wrong.

                • 5. Re: Scheduling in Seam?
                  modoc

                  Ok. So the javadoc and chapter 7 are wrong. I still can't get it to work with a long. I've tried on the assumption that it's millis and then when that didn't work seconds.

                  I may be doing something wrong. There aren't any examples of it that I can find.

                  Here's my code:

                  @Asynchronous
                   public void processEmailsRecurring(@Expiration
                   Date pDate, @IntervalDuration
                   long pInterval) {
                   mLog.info("proccessEmailsReccurring running...");
                   processNewEmails(mIMAPClient.getNewMessages());
                   }
                  


                  Which gets called by:


                  @Create
                   public void doStartService() {
                   mLog.info("Starting up...");
                   mLog.info("Kicking off recurring email processor.");
                   processEmailsRecurring(new Date(), 2);
                   }
                  


                  I've tried with 2 and with 60000.

                  Either way, it starts up, calls the method, which runs once, and never runs again:

                  22:25:17,277 INFO [EmailManager] Starting up...
                  22:25:17,277 INFO [EmailManager] Kicking off recurring email processor.
                  22:25:17,277 INFO [EmailManager] proccessEmailsReccurring running...
                  


                  Any ideas what I'm doing wrong?

                  Thanks!

                  Modoc



                  • 6. Re: Scheduling in Seam?
                    gavin.king

                     

                    Ok. So the javadoc and chapter 7 are wrong.



                    Really?

                    But chapter 7 clearly tells you to put the @Asynchronous annotation on the local interface, not on the bean class.

                    And yours is on the bean class.

                    • 7. Re: Scheduling in Seam?
                      modoc

                      What I meant when I said chapter 7 is wrong, is that chapter 7 says that IntervalDuration is a Date not a long. Chapter 13 is the only place where the IntervalDuration is referred to as a long.

                      Chapter 7 also clearly says:

                      (For JavaBean components we can annotate the component implementation class if we like.)


                      And since this component is a POJO, I put the annotations on the implementation class.

                      Is this wrong? Do Ansyncronous annotated methods HAVE to be ejbs? If so, that's fine, I'll make an ejb interface/impl pair just to handle this, but the documentation led me to believe I could annotate a javabean component.

                      Because it felt to me that your reply was a little defensive or sarcastic, I want to assure you that I am in no way implying any failings of Seam, its documentation, examples, or your work on it. I've worked on plenty of projects to know that keeping docs, examples, javadoc, etc... all in sync with a changing product is hard to do without a dedicated doc team. Seam seems like a pretty amazing project, and thus far I'm really impressed by it. All I'm trying to do it figure out how to get my project working, and at the moment my lack of familiarity with Seam and the ejb3 spec, combined with a couple doc issues and the fact that since Seam is so new, there aren't a ton of other sites with information other developers have uncovered, I come here to ask my questions.

                      Regards,

                      Modoc

                      • 8. Re: Scheduling in Seam?
                        gavin.king

                        OK, np, ....


                        (1) Can you show me your code (all of it)
                        (2) What environment are you running in (JBoss with EJB3?)


                        I'm not trying to say there are no bugs in this stuff (no doubt there are) or in the docs (I know there are). But lets take it a bit more slowly and patiently, please.

                        Cheers.

                        • 9. Re: Scheduling in Seam?
                          modoc

                          Ok. Here is the entire class in question. Let me know if you need any other files..

                          package com.digitalsanctuary.seam;
                          
                          import java.util.Collections;
                          import java.util.Date;
                          import java.util.HashMap;
                          import java.util.List;
                          import java.util.ListIterator;
                          import java.util.Map;
                          
                          import javax.ejb.Remove;
                          
                          import org.jboss.seam.ScopeType;
                          import org.jboss.seam.annotations.Asynchronous;
                          import org.jboss.seam.annotations.Create;
                          import org.jboss.seam.annotations.Destroy;
                          import org.jboss.seam.annotations.In;
                          import org.jboss.seam.annotations.Logger;
                          import org.jboss.seam.annotations.Name;
                          import org.jboss.seam.annotations.Scope;
                          import org.jboss.seam.annotations.Startup;
                          import org.jboss.seam.annotations.Synchronized;
                          import org.jboss.seam.annotations.timer.Expiration;
                          import org.jboss.seam.annotations.timer.IntervalDuration;
                          import org.jboss.seam.log.Log;
                          
                          import com.digitalsanctuary.mail.IMAPClient;
                          import com.digitalsanctuary.mail.message.RenderableMessage;
                          
                          @Name("emailManager")
                          @Scope(ScopeType.APPLICATION)
                          @Synchronized
                          @Startup
                          public class EmailManager {
                           private int mEmailIndex;
                          
                           @Logger
                           private Log mLog;
                          
                           @In(value = "IMAPClient", create = true)
                           private IMAPClient mIMAPClient;
                          
                           @Asynchronous
                           public void processEmailsRecurring(@Expiration
                           Date pDate, @IntervalDuration
                           long pInterval) {
                           mLog.info("proccessEmailsReccurring running...");
                           processNewEmails(mIMAPClient.getNewMessages());
                           }
                          
                           /**
                           * Map of client SessionMailQueues keyed by email address.
                           */
                           private Map<String, SessionMailQueue> mClientMap;
                          
                           @Create
                           public void doStartService() {
                           mLog.info("Starting up...");
                           mClientMap = new HashMap<String, SessionMailQueue>();
                           mLog.info("Kicking off recurring email processor.");
                           processEmailsRecurring(new Date(), 2);
                           }
                          
                           /**
                           * Removes the email and it's associated client sessionmailqueue if it exists in the map.
                           *
                           * @param pEmail
                           * the e-mail address to remove from the map.
                           */
                           public void removeEmail(String pEmail) {
                           mLog.info("Removing email from Map:#0", pEmail);
                           this.mClientMap.remove(pEmail);
                           }
                          
                           /**
                           * Generate a new email address.
                           *
                           * @return the new e-mai address.
                           */
                           private String getNewEmailAddress() {
                           // String newMail = "newMail" + this.mEmailIndex + "@digitalsanctuary.com";
                           String newMail = "test@digitalsanctuary.com";
                           mLog.info("Created new email:#0", newMail);
                           mEmailIndex = mEmailIndex + 1;
                           return newMail;
                           }
                          
                           /**
                           * This method sets up a new session. It generates a new e-mail address, adds the client's sessionMailQueue to the
                           * Map keyed with the new e-mail address, and returns the new e-mail address.
                           *
                           * @param pMailQueue
                           * the client's session scopes SessionMailQueue component.
                           * @return the new e-mail address the client should use.
                           */
                           public String getNewEmail(SessionMailQueue pMailQueue) {
                           String newMail = getNewEmailAddress();
                           mLog.info("Adding mail queue to map for newMail: #0", newMail);
                           mClientMap.put(newMail, pMailQueue);
                           return newMail;
                           }
                          
                           /**
                           * This method takes in a List of RenderableMessages, iterates through them all, looking at all of the recipients on
                           * each message, attempting to match those e-mail addresses to keys in the ClientMap Map. If it matches an entry in
                           * the Map, it adds the RenderableMessage to the SessionMailQueue for that client.
                           *
                           * @param pEmails
                           * the List of RenderableMessages to process.
                           */
                           public void processNewEmails(List<RenderableMessage> pEmails) {
                           // Reverse the order so that the client side collections will always be correctly sorted by date, regardless of
                           // how many e-mail arrive per batch.
                           Collections.reverse(pEmails);
                           // Loop through the new emails
                           for (ListIterator<RenderableMessage> iter = pEmails.listIterator(); iter.hasNext();) {
                           RenderableMessage currentEmail = iter.next();
                           if (currentEmail != null) {
                           // Loop through the recipients of the incoming e-mail
                           for (String currentToAddress : currentEmail.getRecipientList()) {
                           mLog.info("Checking e-mail address: #0", currentToAddress);
                           SessionMailQueue clientQueue = mClientMap.get(currentToAddress);
                           // If we find a client SessionMailQueue in the map...
                           if (clientQueue != null) {
                           mLog.info("Matched e-mail address: #0", currentToAddress);
                           // Add the message to the client queue
                           clientQueue.addMessage(currentEmail);
                           }
                           }
                           }
                           }
                           }
                          
                           @Destroy
                           @Remove
                           public void destroy() {
                           mLog.info("Stopping...");
                           }
                          }
                          



                          I'm running JBoss 4.0.5, I used the JEMS installer and the ejb-3 profile. I'm using the seam 1.1 beta release.

                          21:12:38,256 INFO [Server] Starting JBoss (MX MicroKernel)...
                          21:12:38,257 INFO [Server] Release ID: JBoss [Zion] 4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)



                          Let me know if there's anything else you need, or anything else I should try.

                          Thanks.

                          Modoc

                          • 10. Re: Scheduling in Seam?
                            gavin.king

                            The problem is that you are calling the @Asynchronous method from another method of the class. Calls to this do not get intercepted by the EJB container (or by Seam). You need to call the method from another component if you want it to be processed asynchronously.

                            • 11. Re: Scheduling in Seam?
                              mzeijen

                              Or you move the method to a different component and call it from the original component. Maybe this also could be handled in a inner class? Or am I saying stupid things now?

                              • 12. Re: Scheduling in Seam?
                                modoc

                                Ok good to know. I didn't know that about intercepting stuff. However, I'm now having errors. here are the two new classes, and the error messages I get at startup. I would greatly appreciate any insight into what I'm doing wrong.


                                package com.digitalsanctuary.seam;
                                
                                import java.util.Collections;
                                import java.util.Date;
                                import java.util.HashMap;
                                import java.util.List;
                                import java.util.ListIterator;
                                import java.util.Map;
                                
                                import javax.ejb.Remove;
                                
                                import org.jboss.seam.ScopeType;
                                import org.jboss.seam.annotations.Create;
                                import org.jboss.seam.annotations.Destroy;
                                import org.jboss.seam.annotations.In;
                                import org.jboss.seam.annotations.Logger;
                                import org.jboss.seam.annotations.Name;
                                import org.jboss.seam.annotations.Scope;
                                import org.jboss.seam.annotations.Startup;
                                import org.jboss.seam.annotations.Synchronized;
                                import org.jboss.seam.log.Log;
                                
                                import com.digitalsanctuary.mail.message.RenderableMessage;
                                
                                @Name("emailManager")
                                @Scope(ScopeType.APPLICATION)
                                @Synchronized
                                @Startup
                                public class EmailManager {
                                 private int mEmailIndex;
                                
                                 @Logger
                                 private Log mLog;
                                
                                 @In(value = "emailService", create = true)
                                 private EmailService mEmailService;
                                
                                 /**
                                 * Map of client SessionMailQueues keyed by email address.
                                 */
                                 private Map<String, SessionMailQueue> mClientMap;
                                
                                 @Create
                                 public void doStartService() {
                                 mLog.info("Starting up...");
                                 mClientMap = new HashMap<String, SessionMailQueue>();
                                 mLog.info("Kicking off recurring email processor.");
                                 this.mEmailService.processEmailsRecurring(new Date(), 1000);
                                 }
                                
                                 /**
                                 * Removes the email and it's associated client sessionmailqueue if it exists in the map.
                                 *
                                 * @param pEmail
                                 * the e-mail address to remove from the map.
                                 */
                                 public void removeEmail(String pEmail) {
                                 mLog.info("Removing email from Map:#0", pEmail);
                                 this.mClientMap.remove(pEmail);
                                 }
                                
                                 /**
                                 * Generate a new email address.
                                 *
                                 * @return the new e-mai address.
                                 */
                                 private String getNewEmailAddress() {
                                 // String newMail = "newMail" + this.mEmailIndex + "@digitalsanctuary.com";
                                 String newMail = "test@digitalsanctuary.com";
                                 mLog.info("Created new email:#0", newMail);
                                 mEmailIndex = mEmailIndex + 1;
                                 return newMail;
                                 }
                                
                                 /**
                                 * This method sets up a new session. It generates a new e-mail address, adds the client's sessionMailQueue to the
                                 * Map keyed with the new e-mail address, and returns the new e-mail address.
                                 *
                                 * @param pMailQueue
                                 * the client's session scopes SessionMailQueue component.
                                 * @return the new e-mail address the client should use.
                                 */
                                 public String getNewEmail(SessionMailQueue pMailQueue) {
                                 String newMail = getNewEmailAddress();
                                 mLog.info("Adding mail queue to map for newMail: #0", newMail);
                                 mClientMap.put(newMail, pMailQueue);
                                 return newMail;
                                 }
                                
                                 /**
                                 * This method takes in a List of RenderableMessages, iterates through them all, looking at all of the recipients on
                                 * each message, attempting to match those e-mail addresses to keys in the ClientMap Map. If it matches an entry in
                                 * the Map, it adds the RenderableMessage to the SessionMailQueue for that client.
                                 *
                                 * @param pEmails
                                 * the List of RenderableMessages to process.
                                 */
                                 public void processNewEmails(List<RenderableMessage> pEmails) {
                                 // Reverse the order so that the client side collections will always be correctly sorted by date, regardless of
                                 // how many e-mail arrive per batch.
                                 Collections.reverse(pEmails);
                                 // Loop through the new emails
                                 for (ListIterator<RenderableMessage> iter = pEmails.listIterator(); iter.hasNext();) {
                                 RenderableMessage currentEmail = iter.next();
                                 if (currentEmail != null) {
                                 // Loop through the recipients of the incoming e-mail
                                 for (String currentToAddress : currentEmail.getRecipientList()) {
                                 mLog.info("Checking e-mail address: #0", currentToAddress);
                                 SessionMailQueue clientQueue = mClientMap.get(currentToAddress);
                                 // If we find a client SessionMailQueue in the map...
                                 if (clientQueue != null) {
                                 mLog.info("Matched e-mail address: #0", currentToAddress);
                                 // Add the message to the client queue
                                 clientQueue.addMessage(currentEmail);
                                 }
                                 }
                                 }
                                 }
                                 }
                                
                                 @Destroy
                                 @Remove
                                 public void destroy() {
                                 mLog.info("Stopping...");
                                 }
                                }
                                




                                /**
                                 *
                                 */
                                package com.digitalsanctuary.seam;
                                
                                import java.util.Date;
                                
                                import org.jboss.seam.ScopeType;
                                import org.jboss.seam.annotations.Asynchronous;
                                import org.jboss.seam.annotations.In;
                                import org.jboss.seam.annotations.Logger;
                                import org.jboss.seam.annotations.Name;
                                import org.jboss.seam.annotations.Scope;
                                import org.jboss.seam.annotations.Synchronized;
                                import org.jboss.seam.annotations.timer.Expiration;
                                import org.jboss.seam.annotations.timer.IntervalDuration;
                                import org.jboss.seam.log.Log;
                                
                                import com.digitalsanctuary.mail.IMAPClient;
                                
                                @Name("emailService")
                                @Scope(ScopeType.APPLICATION)
                                @Synchronized
                                public class EmailService {
                                
                                 @Logger
                                 private Log mLog;
                                
                                 @In(value = "EmailManager", create = true)
                                 private EmailManager mEmailManager;
                                
                                 @In(value = "IMAPClient", create = true)
                                 private IMAPClient mIMAPClient;
                                
                                 @Asynchronous
                                 public void processEmailsRecurring(@Expiration
                                 Date pDate, @IntervalDuration
                                 long pInterval) {
                                 mLog.info("proccessEmailsReccurring running...");
                                 this.mEmailManager.processNewEmails(mIMAPClient.getNewMessages());
                                 }
                                }
                                




                                and the errors:


                                00:56:59,898 INFO [Lifecycle] starting up: emailManager
                                00:57:00,449 INFO [EmailManager] Starting up...
                                00:57:00,454 INFO [EmailManager] Kicking off recurring email processor.
                                00:57:00,471 ERROR [[/10MinuteMail]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
                                java.lang.NullPointerException
                                 at org.jboss.seam.interceptors.AsynchronousInterceptor.invokeAsynchronouslyIfNecessary(AsynchronousInterceptor.java:23)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                                 at org.jboss.seam.interceptors.SynchronizationInterceptor.serialize(SynchronizationInterceptor.java:31)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                                 at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:168)
                                 at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:141)
                                 at org.jboss.seam.intercept.RootInterceptor.aroundInvoke(RootInterceptor.java:128)
                                 at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:103)
                                 at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:69)
                                 at com.digitalsanctuary.seam.EmailService$$EnhancerByCGLIB$$1472f137.processEmailsRecurring(<generated>)
                                 at com.digitalsanctuary.seam.EmailManager.doStartService(EmailManager.java:48)
                                 at com.digitalsanctuary.seam.EmailManager$$FastClassByCGLIB$$5cab5b2c.invoke(<generated>)
                                 at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
                                 at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:47)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
                                 at org.jboss.seam.interceptors.ValidationInterceptor.validateTargetComponent(ValidationInterceptor.java:65)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                                 at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:51)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                                 at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:77)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                                 at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:23)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                                 at org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.java:32)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                                 at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:60)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                                 at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:50)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                                 at org.jboss.seam.interceptors.TransactionInterceptor$1.work(TransactionInterceptor.java:26)
                                 at org.jboss.seam.util.Work.workInTransaction(Work.java:31)
                                 at org.jboss.seam.interceptors.TransactionInterceptor.doInTransactionIfNecessary(TransactionInterceptor.java:20)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                                 at org.jboss.seam.interceptors.ConversationalInterceptor.checkConversationForConversationalBean(ConversationalInterceptor.java:81)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                                 at org.jboss.seam.interceptors.EventInterceptor.aroundInvoke(EventInterceptor.java:51)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                                 at org.jboss.seam.interceptors.RemoveInterceptor.removeIfNecessary(RemoveInterceptor.java:40)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                                 at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:28)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                                 at org.jboss.seam.interceptors.AsynchronousInterceptor.invokeAsynchronouslyIfNecessary(AsynchronousInterceptor.java:29)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                                 at org.jboss.seam.interceptors.SynchronizationInterceptor.serialize(SynchronizationInterceptor.java:31)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                                 at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:168)
                                 at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:141)
                                 at org.jboss.seam.intercept.RootInterceptor.aroundInvoke(RootInterceptor.java:128)
                                 at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:103)
                                 at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:69)
                                 at com.digitalsanctuary.seam.EmailManager$$EnhancerByCGLIB$$613c632f.doStartService(<generated>)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
                                 at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:101)
                                 at org.jboss.seam.Component.callComponentMethod(Component.java:1647)
                                 at org.jboss.seam.Component.callCreateMethod(Component.java:1595)
                                 at org.jboss.seam.Component.newInstance(Component.java:1584)
                                 at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:151)
                                 at org.jboss.seam.contexts.Lifecycle.endInitialization(Lifecycle.java:125)
                                 at org.jboss.seam.init.Initialization.init(Initialization.java:323)
                                 at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:32)
                                 at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
                                 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
                                 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
                                 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
                                 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
                                 at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
                                 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                 at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
                                 at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
                                 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                 at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297)
                                 at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103)
                                 at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371)
                                 at org.jboss.web.WebModule.startModule(WebModule.java:83)
                                 at org.jboss.web.WebModule.startService(WebModule.java:61)
                                 at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                                 at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                                 at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                 at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                                 at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                 at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                                 at $Proxy0.start(Unknown Source)
                                 at org.jboss.system.ServiceController.start(ServiceController.java:417)
                                 at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                 at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                                 at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                 at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                                 at $Proxy42.start(Unknown Source)
                                 at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                 at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                 at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                                 at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                                 at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
                                 at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
                                 at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
                                 at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
                                 at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
                                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                                 at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                 at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                                 at $Proxy43.start(Unknown Source)
                                 at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
                                 at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
                                 at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
                                 at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                                 at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                 at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                 at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                                 at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                                 at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                 at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                                 at $Proxy6.deploy(Unknown Source)
                                 at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
                                 at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
                                 at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
                                 at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
                                 at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                                 at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                 at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                                 at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                 at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                                 at $Proxy0.start(Unknown Source)
                                 at org.jboss.system.ServiceController.start(ServiceController.java:417)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                 at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                                 at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                 at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                                 at $Proxy4.start(Unknown Source)
                                 at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
                                 at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
                                 at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
                                 at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                                 at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                 at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                 at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                                 at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                                 at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                 at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                                 at $Proxy5.deploy(Unknown Source)
                                 at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
                                 at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
                                 at org.jboss.Main.boot(Main.java:200)
                                 at org.jboss.Main$1.run(Main.java:490)
                                 at java.lang.Thread.run(Thread.java:613)
                                
                                



                                Thanks for any assistance...

                                • 13. Re: Scheduling in Seam?
                                  gavin.king

                                  Show me your startup log, I want to see if "org.jboss.seam.core.dispatcher" gets installed. (Looks like it does not.)

                                  • 14. Re: Scheduling in Seam?
                                    gavin.king

                                    Oh, I think I forgot to document that you need to install the dispatcher using:

                                    <component name="org.jboss.seam.core.dispatcher"
                                     class="org.jboss.seam.core.Dispatcher" />


                                    in components.xml.

                                    Sorry about that.

                                    I'll also make the NPE look prettier.

                                    1 2 Previous Next