cancel
Showing results for 
Search instead for 
Did you mean: 

mail task: mail not send but no errors either

michafn
Champ in-the-making
Champ in-the-making
hello,

I am just getting started with activit and BPMN 2.0, and therefore tried to setup a really simple process, which does nothing but sending an email via an external SMTP server.

This is my process definition:

<process id="process1" name="process1">
    <startEvent id="startevent1" name="Start"></startEvent>
    <endEvent id="endevent1" name="End"></endEvent>
    <serviceTask id="mailtask1" name="Mail Task" activiti:async="true" activiti:type="mail">
      <extensionElements>
        <activiti:field name="to" expression="my@mailadress"></activiti:field>
        <activiti:field name="subject" expression="test"></activiti:field>
        <activiti:field name="html">
          <activiti:expression><![CDATA[retretret]]></activiti:expression>
        </activiti:field>
        <activiti:field name="text">
          <activiti:expression><![CDATA[retretret]]></activiti:expression>
        </activiti:field>
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="mailtask1"></sequenceFlow>
    <sequenceFlow id="flow2" name="" sourceRef="mailtask1" targetRef="endevent1"></sequenceFlow>
  </process>

In the activiti.cfg.xml file I added following paramters

<property name="mailServerHost" value="xxx" />
       <property name="mailServerUsername" value="xxx" />
       <property name="mailServerPassword" value="xxx" />

and finally generated a simple test unit to start the process:

RepositoryService repositoryService = activitiRule.getRepositoryService();
      repositoryService.createDeployment().addInputStream("process1.bpmn20.xml",
            new FileInputStream(filename)).deploy();
      
      RuntimeService runtimeService = activitiRule.getRuntimeService();
      Map<String, Object> variableMap = new HashMap<String, Object>();
      variableMap.put("name", "Activiti");
      ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process1", variableMap);
      assertNotNull(processInstance.getId());
      System.out.println("id " + processInstance.getId() + " "
            + processInstance.getProcessDefinitionId());

so everything pretty much standard operations…
However, if i start the process it looks all fine, I get the expected output from the last line of the code and no error message…but I do not receive any email as well and since I do not get any error I cannot even debug…

did anyone experience a similar problem? Am I missing anything fundamental?

Thanks for any help…
3 REPLIES 3

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
since I do not get any error I cannot even debug…

You can if you use a real debugger and set some breakpoints in e.g. the activiti mail classes.

valarmathi
Champ in-the-making
Champ in-the-making
Hi,

The same process i'm also done with this.While Run the juint i got the mail ,but export the xml from the activit-explorer i can't get the
mail i'm getting the start process error.

Exception

com.vaadin.event.ListenerMethod$MethodException
Cause: org.activiti.engine.ActivitiException: Could not send e-mail
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1193)
at com.vaadin.ui.Button.fireClick(Button.java:539)
at com.vaadin.ui.Button.changeVariables(Button.java:206)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1299)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1219)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:735)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:296)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)

Please help me for this,if any one knows.

Thanks,
Valarmarthi P

jbarrez
Star Contributor
Star Contributor
IS that all exception stack trace there? I would expect some nested exception about why the mail sending failed.

And you don't get any errors when running in the unit test? Then something is wrong on the mail server side.