[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-3555) SeamMailAgain

Carey Foushee (JIRA) jira-events at lists.jboss.org
Sun Jan 25 03:09:44 EST 2009


    [ https://jira.jboss.org/jira/browse/JBSEAM-3555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12449602#action_12449602 ] 

Carey Foushee commented on JBSEAM-3555:
---------------------------------------

I found a work around in 2.1.1GA to send periodic email async:

Took out the  <async:quartz-dispatcher/> from components.xml then just used a standard java.util.Timer like this:

   @In(create=true) AsynchronousMailProcessor asynchronousMailProcessor;
   
   long pollingInterval = 30000L;

   @Observer("org.jboss.seam.postInitialization")
   public void observe() {
	    new Timer().schedule(new PollTask(asynchronousMailProcessor), pollingInterval, 2*pollingInterval);
   }
   
   private class PollTask extends TimerTask {
	   
	   AsynchronousMailProcessor asynchronousMailProcessor;
	   
	   public PollTask(AsynchronousMailProcessor asynchronousMailProcessor){
		   this.asynchronousMailProcessor = asynchronousMailProcessor;
	   }
	   
	   public void run(){
		   asynchronousMailProcessor.sendMail(0);
	   }
   }

@Name("asynchronousMailProcessor")
public class AsynchronousMailProcessor {
	
@Asynchronous
	public void sendMail(@Duration long interval) {
		renderer.render("/email/reminder.xhtml");
	}



> SeamMailAgain
> -------------
>
>                 Key: JBSEAM-3555
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-3555
>             Project: Seam
>          Issue Type: Bug
>    Affects Versions: 2.1.0.CR1
>         Environment: JBoss AS 4.2.1.GA
> JBoss Seam 2.1.0-SNAPSHOT (10.10. HudsonNo330)
>            Reporter: Markus Heidt
>            Assignee: Pete Muir
>             Fix For: 2.1.2.CR1
>
>         Attachments: RendererFacesContextFactory.java, server.log
>
>
> Simple Mailing via Renderer doesn't work.
> 'Seam-gen'erated a new project and added a new action 'sendMail'
> Added the line to the action code:
> Renderer.instance().render("/simple.xhtml");
> simple.xhtml is a modified version of the seam example (without #{person})
> Error after executing the action:
> 2008-10-14 11:40:21,847 FATAL [javax.enterprise.resource.webcontainer.jsf.application] org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.ui.facelet.facesContextFactory
> javax.faces.el.EvaluationException: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.ui.facelet.facesContextFactory
> 	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
> 	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
> ...
> 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:256)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list