2 Replies Latest reply on Dec 9, 2008 2:38 PM by Shantanu Upadhyaya

    Problem while using email template of JBPM

    Shantanu Upadhyaya Newbie


      I'm getting a null pointer while using mail templates (mostly due to my config environment ). I'm trying to figure out what's missing.

      Here are the relevant things :
      1. hibernate.cfg.xml ,jbpm.mail.templates.xml, jbpm.cfg.xml , and my processdefinition.xml are in the same location ( inside the EAR )

      2. jbpm.cfg.xml contains

      <string name="resource.mail.templates" value="jbpm.mail.templates.xml" />

      3. I know email sending works fine because I've been using it without the templates.

      4. My template file contains :

      <mail-template name="task-assign">
       <subject>Task '#{taskInstance.name}'</subject>
       blah blah
       <mail-template name="task-reminder">
       <mail-template name="mailToMgr">

      5. My process definition contains :

      <task-node name="taskNodeName" end-tasks="true">
       <event type="node-enter">
       <mail name="mailToMgr" to="someone@somecompany.com" template="jbpm.mail.templates.xml">

      6. When I run this, I get
      Caused by: java.lang.NullPointerException
       at org.jbpm.mail.Mail.send(Mail.java:103)

      7. On debug of org.jbpm.mail.Mail, I get
      Method getMailTemplateProperties(templateName passed is "jbpm.mail.templates.xml")
       mailTemplatesResource = "jbpm.mail.templates.xml"
       mailTemplatesElement = [mail-templates: null]
       mailTemplateElements = [[mail-template: null], [mail-template: null], [mail-template: null]]

      * What could the problem be ?
      * Also, how do I link my tag with a specific <mail-template> ?
      * Can I include html as part of email ?