Mail sending error
demetrio812 May 16, 2007 1:03 PMHi,
I have this mail template:
<m:message xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://jboss.com/products/seam/mail" xmlns:h="http://java.sun.com/jsf/html"> <m:from name="Upload4Freedom" address="info@upload4freedom.com" /> <m:to name="info">filocamo@demetrio.it</m:to> <m:subject>Message from Contact Form</m:subject> <m:body> <p> <h:outputText value="Name: #{ContactForm.name}" /> <h:outputText value="E-mail: #{ContactForm.email}" /> <h:outputText value="Message: #{ContactForm.msg}" /> </p> </m:body> </m:message>
and I'm trying to send it with this method:
public void sendEmail() { try { renderer.render("/mailTemplate.xhtml"); facesMessages.add("E-mail sent, thank you!"); } catch (Exception e) { facesMessages.add("Email sending failed: " + e.getMessage()); } }
I also tried various combination of configuration in components.xml, like this:
<mail:mail-session host="smtp.tiscali.it" port="25" debug="true" ssl="false" />
or:
<mail:mail-session host="smtp.tiscali.it" port="25" username="" password="" debug="true" ssl="false" />
but the error I got is:
No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions! If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml. A typical config looks like this; <listener> <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class> </listener>
How can I solve this problem? I use the latest version of seam with JBoss AS.
Thanks a lot!
Demetrio Filocamo
(filocamo@demetrio.it)