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());
@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); } } } }
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
Seems it will be corrected in Seam 2.1
See JBSEAM-2427 in JIRA