[jboss-user] [JBoss Seam] - Re: Seam Email - IllegalStateException: No Factories configu

bsmithjj do-not-reply at jboss.com
Sun Feb 25 08:00:07 EST 2007


These methods are not called by JSF - rather, they are the points at which I invoke my MailSenderBean.sendEmailMessage() method.  In both (all) cases, I put some objects in event scope (for rendering) and invoke sendEmailMessage().  Here's the code for one invokation:


  |         // contextual email data
  |         Contexts.getEventContext().set(
  |             "accessRequest",
  |             accessRequest
  |         );
  |         Contexts.getEventContext().set(
  |             "accessRequestUser",
  |             QueryEPeopleUtil.findUserByUid(accessRequest.getUserId())
  |         );
  |         mailSender.sendEmailMessage(
  |             EmailTemplateType.UserManagerRejectedRequest.getTemplateFilePath()
  |         );
  | 

Here is the relevant portions of MailSenderBean:


  | @Stateless
  | @Name("mailSenderBean")
  | public class MailSenderBean implements MailSender {
  | 
  |     private Log log = LogFactory.getLog(MailSenderBean.class);
  | 
  |     @In(required=false)
  |     private EmailMessage emailMessage;
  | 
  |     @In(create = true)
  |     private Session mailSession;
  | 
  |     @PersistenceContext(unitName = "accessControlDatabase")
  |     private EntityManager em;
  | 
  |     @In(create = true)
  |     private Renderer renderer;
  | 
  |     ....
  | 
  |     public String sendEmailMessage(String templateFile) {
  |         try {
  |             log.info("sending email:  "+templateFile);
  |             renderer.render(templateFile);
  |             log.info("...mailt sent(?)");
  |             return "success";
  | 
  |         } catch (Exception e) {
  |             log.error(e,e);
  |         }
  |         return null;
  |     }
  | 
  | }
  | 

The only other thing I could do is dump the classloaders from a factory method that supplieds a 'mailConfiguration' object during rendering of the email - I tried this, but since the factory method is an SLSB method, both calls show the same classloader - the EAR classloader.

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

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



More information about the jboss-user mailing list