0 Replies Latest reply on Jan 21, 2010 10:44 AM by ha kra

    Problem sending mail in Stateless local ejb bean

    ha kra Newbie

      This is me pretty simple mail sending function



           @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
           public void sendSearchAsMailForOneUser(ARCHIVE_EMailAddress curMail, Image[] searchResult, Integer mailId) {
                Contexts.getMethodContext().set("searchResult", searchResult);
                Contexts.getMethodContext().set("searchId", mailId);
                Contexts.getMethodContext().set("curMail", curMail);
                Renderer.instance().render("/search.result.email.pictures.xhtml");
           }


      Which is called like this:



           SendSearchAsMail statelessWorker = (SendSearchAsMail) Component.getInstance(SendSearchAsMailBean.class, ScopeType.STATELESS, true);
           statelessWorker.sendSearchAsMailForOneUser(curMail, searchResultProvider.getSearchResult(), mail.getId());


      and always fails to send the mail with




      javax.ejb.EJBException: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.ui.facelet.facesContextFactory
           at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:77)
           at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
           at org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:252)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:201)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:176)
           at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:216)
           at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
           at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
           at $Proxy901.sendSearchAsMailForOneUser(Unknown Source)
           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:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
           at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
           at org.javassist.tmp.java.lang.Object_$$_javassist_24.sendSearchAsMailForOneUser(Object_$$_javassist_24.java)
           at com.spratpix.session.search.mail.SendSearchAsMailBean.sendSearchResultAsMail(SendSearchAsMailBean.java:61)
           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:597)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
           at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
           at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor$InvocationContext.proceed(InvocationContextInterceptor.java:138)
           at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:31)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at com.spratpix.timing.interceptors.TimingInterceptor.timeCall(TimingInterceptor.java:34)
           at sun.reflect.GeneratedMethodAccessor782.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:186)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:72)
           at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:29)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
           at sun.reflect.GeneratedMethodAccessor715.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:83)
           at org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:70)
           at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:59)
           at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
           at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
           at sun.reflect.GeneratedMethodAccessor331.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
           at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_456089357.invoke(InvocationContextInterceptor_z_fillMethod_456089357.java)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
           at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_456089357.invoke(InvocationContextInterceptor_z_setup_456089357.java)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
           at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:194)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:201)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:176)
           at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:216)
           at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
           at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
           at $Proxy918.sendSearchResultAsMail(Unknown Source)
           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:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
           at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
           at org.javassist.tmp.java.lang.Object_$$_javassist_24.sendSearchResultAsMail(Object_$$_javassist_24.java)
           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:597)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:274)
           at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
           at org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
           at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
           at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
           at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
           at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
           at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
           at javax.faces.component.UICommand.broadcast(UICommand.java:387)
           at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
           at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
           at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at com.spratpix.timing.interceptors.TimingFilter.doFilter(TimingFilter.java:32)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
           at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:436)
           at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:384)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
           at java.lang.Thread.run(Thread.java:637)
      Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.ui.facelet.facesContextFactory
           at org.jboss.seam.Component.newInstance(Component.java:2106)
           at org.jboss.seam.Component.getInstance(Component.java:1988)
           at org.jboss.seam.Component.getInstance(Component.java:1967)
           at org.jboss.seam.Component.getInstance(Component.java:1961)
           at org.jboss.seam.Component.getInstance(Component.java:1934)
           at org.jboss.seam.Component.getInstance(Component.java:1929)
           at org.jboss.seam.ui.facelet.RendererFacesContextFactory.instance(RendererFacesContextFactory.java:72)
           at org.jboss.seam.ui.facelet.RendererRequest.init(RendererRequest.java:45)
           at org.jboss.seam.ui.facelet.RendererRequest.run(RendererRequest.java:72)
           at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.java:43)
           at com.spratpix.session.search.mail.SendSearchAsMailBean.sendSearchAsMailForOneUser(SendSearchAsMailBean.java:79)
           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:597)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
           at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
           at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor$InvocationContext.proceed(InvocationContextInterceptor.java:138)
           at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:31)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at com.spratpix.timing.interceptors.TimingInterceptor.timeCall(TimingInterceptor.java:34)
           at sun.reflect.GeneratedMethodAccessor782.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:186)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:72)
           at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:29)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
           at sun.reflect.GeneratedMethodAccessor715.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:83)
           at org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:70)
           at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:59)
           at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
           at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
           at sun.reflect.GeneratedMethodAccessor331.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
           at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_456089357.invoke(InvocationContextInterceptor_z_fillMethod_456089357.java)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
           at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_456089357.invoke(InvocationContextInterceptor_z_setup_456089357.java)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
           ... 183 more
      Caused by: java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory
           at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:725)
           at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:239)
           at org.jboss.seam.ui.facelet.RendererFacesContextFactory.create(RendererFacesContextFactory.java:47)
           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:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2211)
           at org.jboss.seam.Component.callCreateMethod(Component.java:2134)
           at org.jboss.seam.Component.newInstance(Component.java:2094)
           ... 252 more



      the class is declared as



      @Name("sendSearchAsMail")
      @Stateless
      public class SendSearchAsMailBean implements SendSearchAsMail {