Help

Controls

PermLinkWikiLink

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Forum: Seam Users Forum ListTopic List
16. Sep 2008, 00:37 CET | Link

Hi guys,

I'm having a problem with seam mail. I use JBoss-4.2.2.GA and with Seam 2.0.1.GA it worked fine, but I REALLY need asynchronous email sending feature. So I switched to Seam 2.1.0.BETA1, and it stopped working completely (asynchronous as well as synchronous modes), same exception is thrown in both cases (see below). I tried latest nightly build as well. Any ideas what causing it? (everything else works fine though)

Thanks in advance!

org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.ui.facelet.facesContextFactory
	at org.jboss.seam.Component.newInstance(Component.java:2041)
	at org.jboss.seam.Component.getInstance(Component.java:1923)
	at org.jboss.seam.Component.getInstance(Component.java:1902)
	at org.jboss.seam.Component.getInstance(Component.java:1879)
	at org.jboss.seam.Component.getInstance(Component.java:1874)
	at org.jboss.seam.ui.facelet.RendererFacesContextFactory.instance(RendererFacesContextFactory.java:72)
	at org.jboss.seam.ui.facelet.RendererRequest.init(RendererRequest.java:52)
	at org.jboss.seam.ui.facelet.RendererRequest.run(RendererRequest.java:81)
	at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.java:43)
	at com.propel.notification.AsynchronousMailProcessor.scheduleSend(AsynchronousMailProcessor.java:54)
	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:22)
	at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
	at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	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.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
	at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
	at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
	at com.propel.notification.AsynchronousMailProcessor_$$_javassist_25.scheduleSend(AsynchronousMailProcessor_$$_javassist_25.java)
	at com.propel.notification.NotificationManager.notifyUserAboutItemUnassigned(NotificationManager.java:94)
	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:22)
	at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
	at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	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.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:138)
	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.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
	at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
	at com.propel.notification.NotificationManager_$$_javassist_6.notifyUserAboutItemUnassigned(NotificationManager_$$_javassist_6.java)
	at com.propel.notification.ItemUpdateHandler.handleAssignment(ItemUpdateHandler.java:57)
	at com.propel.notification.ItemUpdateHandler.handle(ItemUpdateHandler.java:27)
	at com.propel.session.HibernateInterceptor.onFlushDirty(HibernateInterceptor.java:54)
	at org.hibernate.event.def.DefaultFlushEntityEventListener.invokeInterceptor(DefaultFlushEntityEventListener.java:331)
	at org.hibernate.ejb.event.EJB3FlushEntityEventListener.invokeInterceptor(EJB3FlushEntityEventListener.java:47)
	at org.hibernate.event.def.DefaultFlushEntityEventListener.handleInterception(DefaultFlushEntityEventListener.java:308)
	at org.hibernate.event.def.DefaultFlushEntityEventListener.scheduleUpdate(DefaultFlushEntityEventListener.java:248)
	at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:128)
	at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
	at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
	at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
	at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
	at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:296)
	at org.jboss.seam.persistence.EntityManagerProxy.flush(EntityManagerProxy.java:92)
	at org.hibernate.search.jpa.impl.FullTextEntityManagerImpl.flush(FullTextEntityManagerImpl.java:102)
	at org.jboss.seam.persistence.EntityManagerProxy.flush(EntityManagerProxy.java:92)
	at com.propel.dao.BaseHibernateDAO.update(BaseHibernateDAO.java:46)
	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:22)
	at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
	at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	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.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
	at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
	at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
	at com.propel.dao.project.item.ItemDAO_$$_javassist_13.update(ItemDAO_$$_javassist_13.java)
	at com.propel.session.project.item.ItemHome.doUpdate(ItemHome.java:117)
	at com.propel.session.project.item.ItemHome.update(ItemHome.java:132)
	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:22)
	at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
	at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	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.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:138)
	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.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
	at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
	at com.propel.session.project.item.ItemHome_$$_javassist_19.update(ItemHome_$$_javassist_19.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:585)
	at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
	at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
	at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
	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 org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
	at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
	at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
	at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
	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.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
	at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:80)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:150)
	at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
	at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:379)
	at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:506)
	at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	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.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:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
	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:157)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
	at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory
	at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:267)
	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:585)
	at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
	at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:126)
	at org.jboss.seam.Component.callComponentMethod(Component.java:2146)
	at org.jboss.seam.Component.callCreateMethod(Component.java:2069)
	at org.jboss.seam.Component.newInstance(Component.java:2029)
	... 162 more

17 Replies:
17. Sep 2008, 03:22 CET | Link

Anybody? :(

17. Sep 2008, 06:56 CET | Link

I have the same issue. But also no solution. Even tough I need some of the 2.1 features (csv/excel, async mail) it seems it's not the best time to switch.

- chris

17. Sep 2008, 11:29 CET | Link

Please file an issue in JIRA with a standalone example I can use to reproduce.

 

Read about how to report a bug.

22. Sep 2008, 19:39 CET | Link

I'm facing this issue when trying to render an Excel spreadsheet. I'd like to get a JIRA issue filed, but I'm not being successful in coming up with a standalone example for this issue. If you were creating one for the mail issue, I'd hold off to see the resolution on that. If not, let me know and I'll see what I can do on my end. Thanks.

23. Sep 2008, 12:43 CET | Link

I don't have a spare minute right now to create a standalone example. Too much work. Thing is - I use Seam for the project which is outside work, so don't have much time to spend on it :( I'll try my best, but don't think anything will happen in next few weeks :( Sorry mate.

10. Oct 2008, 21:36 CET | Link

Do you guys still need a standalone example?

I have the same issue...

11. Oct 2008, 12:13 CET | Link

Ok, I created a clean project. I'm using Ganymede, JBoss Tools 3.0.1 Nightly Build and Seam 2.1 Nightly Build

After creating an empty war-packed Seam project I added a Seam Action.

Compiling and sending the action works.

When putting the following line into the action code

Renderer.instance().render("/simple.xhtml");

i get the well known error:

12:06:34,706 ERROR [MailAction] org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.ui.facelet.facesContextFactory
12:06:35,360 ERROR [AjaxPhaseListener] Exception on get current Skin 
java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory
	at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:256)
	at org.richfaces.skin.SkinFactoryImpl.processProperties(SkinFactoryImpl.java:263)

The simple.xhtml is from the mail sample.

12. Oct 2008, 15:40 CET | Link

Please attach the project to a new JIRA issue - I don't use JBoss Tools 3, so if you could use seam-gen or JBoss Tools 2.1 that would be great!

 

Read about how to report a bug.

12. Oct 2008, 22:01 CET | Link

Or try trunk, I think this is properly fixed now.

 

Read about how to report a bug.

13. Oct 2008, 14:49 CET | Link
Or try trunk, I think this is properly fixed now.

Hi Pete,

What do you mean with trunk? I'm not using svn... I get the versions from http://hudson.jboss.org/hudson/job/seam-trunk-nightly/lastBuild/

I used no.330.

And Ingo, I'm using AS 4.2.1 and not 5...

I'm going to build a test using seam-gen tonight...

20. Oct 2008, 18:16 CET | Link

Hey pete, unfortunately I can't confirm that it's fixed in trunk (2.1.1-SNAPSHOT). However, I tried it with my own application since I couldn't find the JIRA issue (and the example attached?) to test with...

Can you provide some more infos? Thanks a lot. vivian

21. Oct 2008, 10:04 CET | Link
I can't confirm that it's fixed in trunk (2.1.1-SNAPSHOT).

Well, using @Asynchronous it works to send the mail in a separate thread which is nice. However, sending mails from within an MDB doen't yet work. Any ideas?

21. Oct 2008, 16:39 CET | Link

It does not work. https://jira.jboss.org/jira/browse/JBSEAM-3555

Is there any workaround?

26. Nov 2008, 21:29 CET | Link

True ... we have also found out that it does not work properly to use Quartz-backed @Asynchronous mail sending as of Seam 2.1.1.CR1.

While waiting for a proper fix it seems to be just fine to home roll the asynchronicity:


// todo Home rolled asynchronicity. : (    Awaiting fix of JBSEAM-3555.
SERVICE.submit(new Runnable() {
    public void run() {
        mailer.scheduleSend(Email.this);
    }
}); 

... where SERVICE is any of all ExecutorServices you might fancy, for instance:


private final static ExecutorService SERVICE =
     Executors.newSingleThreadExecutor();

Works for us. For now.

01. Dec 2008, 12:33 CET | Link

How do you handle the context when the mail sending is running on another thread? I tried this concept but I am getting a No application context active error.

03. Dec 2008, 03:22 CET | Link

I tried getting the application context in the separate thread using the following:

Lifecycle.beginCall(); Renderer.instance().render(/simple.xhtml); Lifecycle.endCall();

When I did this, I was back at square one. Got the initial error message. (ie. Application was not properly initialized at startup)

As per Seam Jira issue id JBSEAM-3555, this will get fixed in 2.1.1.CR2. Not sure when that will be out. In the meantime is there a workaround.

Appreciate if we can come up with a workaround until the problem is fixed. I don't want to use java mail API for asynchronous mail as the seam way is so easy but I guess I might have to do that at least until JBSEAM-3555 is resolved.

If anyone has a workaround, please let me know.

12. Oct 2008, 21:30 CET | Link

Perhaps related to JBSEAM-3542 ?

 

If you hold a cat by the tail you learn things you cannot learn any other way. (Mark Twain)