1 2 Previous Next 25 Replies Latest reply on Mar 21, 2007 6:34 AM by tazman Go to original post
      • 15. Re: Is it possible to send mail from asynchronous method
        pmuir

        There is currently a fix (which I haven't tested properly, so it would be great if you could, and put any problems on the JIRA issue) which will be in today's release. Hopefully I'll close the issue next week sometime (its currently my number 2 priority)

        • 16. Re: Is it possible to send mail from asynchronous method
          piotr.walczyszyn

          I will build seam source from CVS and will try to test it today. I will post my results on JIRA.

          • 17. Re: Is it possible to send mail from asynchronous method
            pmuir

            The fix won't work with JSF 1.2

            • 18. Re: Is it possible to send mail from asynchronous method
              piotr.walczyszyn

              Yes unfortunetly it doesn't work with JSF 1.2, I will try to switch tomorrow to myfaces and test it in thi environment.

              • 19. Re: Is it possible to send mail from asynchronous method
                piotr.walczyszyn

                I checked it with myfaces, still there is a problem, I posted stack trace in JIRA issue.

                • 20. Re: Is it possible to send mail from asynchronous method
                  tazman

                  Hi Peter!

                  The fix won't work with JSF 1.2


                  Any idea when it'll work with JSF 1.2 RI? Seam mail with facelets templating looks so promising but it's pretty much useless for me at this time because I always send mails asynchronously.


                  tazman

                  • 21. Re: Is it possible to send mail from asynchronous method
                    pmuir

                    I'll try to get the fix into 1.2.1

                    • 22. Re: Is it possible to send mail from asynchronous method
                      pmuir

                      Btw, the best way to get a fix done sooner is to vote for it in JIRA!

                      • 23. Re: Is it possible to send mail from asynchronous method
                        pmuir

                        I've put a fix for 1.2 RI into CVS. Please test

                        • 24. Re: Is it possible to send mail from asynchronous method
                          piotr.walczyszyn

                          I can do it mid of next week. I'm out for few days. I will post my results.

                          • 25. Re: Is it possible to send mail from asynchronous method
                            tazman

                            I just tested sending a mail from an asynchronous method (using JSF RI 1.2_03).

                            1 - I rebuilt Seam from CVS
                            2 - tested the following method, which worked

                            public void newMessage(ContactMessage message) {
                             try {
                             renderer.render("/mails/contact.xhtml");
                             log.debug("Email sent successfully");
                             } catch (Exception e) {
                             log.error("Error sending email", e);
                             }
                            }


                            3 - modified the method to make it asynchronous:

                            @Asynchronous
                            public void newMessage(ContactMessage message) {
                             Contexts.getConversationContext().set("message", message);
                             try {
                             renderer.render("/mails/contact.xhtml");
                             log.debug("Email sent successfully");
                             } catch (Exception e) {
                             log.error("Error sending email", e);
                             }
                            }


                            This threw NPE:

                            java.lang.NullPointerException
                             at com.sun.faces.renderkit.RenderKitImpl.createResponseWriter(RenderKitI
                            mpl.java:203)
                             at org.jboss.seam.ui.facelet.FaceletsRenderer.wrapResponseWriter(Facelet
                            sRenderer.java:106)
                             at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.ja
                            va:62)
                             at actions.EventListener.newMessage(EventListener.java:
                            137)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                            java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                            sorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
                             at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocation
                            Context.java:31)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                            Context.java:57)
                             at org.jboss.seam.interceptors.RollbackInterceptor.aroundInvoke(Rollback
                            Interceptor.java:34)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                            Context.java:69)
                             at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(Bijecti
                            onInterceptor.java:47)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                            Context.java:69)
                             at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(Met
                            hodContextInterceptor.java:27)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                            Context.java:69)
                             at org.jboss.seam.interceptors.AsynchronousInterceptor.aroundInvoke(Asyn
                            chronousInterceptor.java:37)
                             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
                            Context.java:69)
                             at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:
                            103)
                             at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(Java
                            BeanInterceptor.java:151)
                             at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanIntercept
                            or.java:87)
                             at net.benim.core.actions.EventListener_$$_javassist_40.newCelebrity(Eve
                            ntListener_$$_javassist_40.java)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                            java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                            sorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
                             at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:123)
                             at org.jboss.seam.core.Dispatcher$AsynchronousInvocation.call(Dispatcher
                            .java:134)
                             at org.jboss.seam.core.Dispatcher$Asynchronous.execute(Dispatcher.java:8
                            8)
                             at org.jboss.seam.core.Dispatcher.dispatch(Dispatcher.java:165)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                            java:39)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                            sorImpl.java:25)
                             at java.lang.reflect.Method.invoke(Method.java:585)
                             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                            java:112)
                             at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationCo
                            ntextImpl.java:166)
                             at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3Int
                            erceptorsInterceptor.java:63)
                             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                            java:101)
                             at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invok
                            e(TransactionScopedEntityManagerInterceptor.java:54)
                             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                            java:101)
                             at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsI
                            nterceptor.java:47)
                             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                            java:101)
                             at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
                             at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java
                            :197)
                             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                            java:101)
                             at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInt
                            erceptor.java:76)
                             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                            java:101)
                             at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(Stateles
                            sInstanceInterceptor.java:62)
                             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                            java:101)
                             at org.jboss.aspects.security.AuthenticationInterceptor.invoke(Authentic
                            ationInterceptor.java:77)
                             at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3Auth
                            enticationInterceptor.java:131)
                             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                            java:101)
                             at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterce
                            ptor.java:47)
                             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                            java:101)
                             at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(Asynchrono
                            usInterceptor.java:106)
                             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
                            java:101)
                             at org.jboss.ejb3.stateless.StatelessContainer.callTimeout(StatelessCont
                            ainer.java:150)
                             at org.jboss.ejb.txtimer.TimerImpl$TimerTaskImpl.run(TimerImpl.java:524)
                            
                             at java.util.TimerThread.mainLoop(Timer.java:512)
                             at java.util.TimerThread.run(Timer.java:462)
                            



                            tazman



                            1 2 Previous Next