[jboss-user] [JBoss Seam] - Sending email asynchronously

dthibau@opencs.net do-not-reply at jboss.com
Fri Feb 8 14:39:47 EST 2008


Hello everybody, 

My config : 
Jboss 4.2.1GA
Seam 2.0.1

I'm trying to send email asynchronously from a Seam Component like this :

  | asynchroneNotifier.scheduleSendCR( 1000, selectedCR, server.toString());
  | 

asynchroneNotifier is another SeamComponent :

  | @Name("asynchroneNotifier")
  | @AutoCreate
  | public class AsynchroneNotifier {
  | 
  | 	@In 
  | 	EntityManager entityManager;
  | 	
  | 	@Logger
  | 	private Log log;
  | 	
  | 	@Asynchronous
  | 	@TransactionAttribute(value=TransactionAttributeType.NOT_SUPPORTED)
  | 	public void scheduleSendCR(@Duration
  | 	long delay, CR cr, String server) {
  | 	
  | 		cr = entityManager.find(CR.class,cr.getId());
  | 		for (Account a : cr.getDestinataires()) {
  | 				Contexts.getEventContext().set("cr", cr);
  | 				Contexts.getEventContext().set("sender", cr.getAuteur());
  | 				Contexts.getEventContext().set("receiver", a);
  | 				Contexts.getEventContext().set("server", server);
  | 				try {
  | 					Renderer.instance().render("/mail/envoiCRMail.xhtml");
  | 				} catch (FacesException e) {
  | 					e.printStackTrace();
  | 					log.error(" Impossible d'envoyer la notification de CR Ã  "+a.getNomComplet(), e);
  | 				}
  | 				
  | 		}
  | 	}
  | 
  | }
  | 
  | 

This code used to work fine with Seam 1.2 and JBoss 4.0.5. But with my 
new config, I encounter classpath problem. 
This occurs when Seam tries to create a MockFacesContext.

Here is the trace log : 

20:11:44,337 ERROR [TimerImpl] Error invoking ejbTimeout: javax.ejb.EJBException: java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory

Did I code something badly or is it a bug ?

Thanks in advance

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127963#4127963

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127963




More information about the jboss-user mailing list