Error in Sending Email Task using connector Id "mail-send"

Hi,

I am trying to send an email notification during a process. Seeing the pizza example I implemented a service task as below

but I am getting an error while initiating this task as below:
15-Mar-2017 10:37:53.097 SEVERE [http-nio-8080-exec-10] org.camunda.commons.logging.BaseLogger.logError ENGINE-16004 Exception while closing command context: No connector found for connector id ‘mail-send’
org.camunda.connect.ConnectorException: > No connector found for connector id 'mail-send'
at org.camunda.connect.plugin.impl.ServiceTaskConnectorActivityBehavior.ensureConnectorInitialized(ServiceTaskConnectorActivityBehavior.java:94)
at org.camunda.connect.plugin.impl.ServiceTaskConnectorActivityBehavior.execute(ServiceTaskConnectorActivityBehavior.java:49)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute$2.callback(PvmAtomicOperationActivityExecute.java:57)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute$2.callback(PvmAtomicOperationActivityExecute.java:46)
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.continueIfExecutionDoesNotAffectNextOperation(PvmExecutionImpl.java:1936)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivityExecute.java:38)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivityExecute.java:27)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:89)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:125)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:104)
at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performOperation(CommandInvocationContext.java:79)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:611)

Can anyone help on the issue?

Regards,
Tushar

1 Like

Hi Tushar,

Did you follow the Install and How to use it? sections of the mail connector documentation?

Yes I followed it…a jar was missing in lib folder…I added it so that issue got resolved…
but after that new error came up while starting the process…
The process could not be started. :
Cannot find mail configuration at: classpath:/mail-config.properties

but I have added “mail-config.properties” file in src/main/resources location as shown in pizza mail example and nowhere in that sample its mentioned to define classpath:/mail-config.properties as it is a default one.

Can you help?

Regards,
Tushar

Hi Tushar,

the documentation of the pizza examples says that you must copy this config file to the application server config folder. In case of tomcat, this is server\apache-tomcat-8.0.24\conf.

That means you have one config for all applications if you use a shared process engine.

Does this help you?

Best regards,
Philipp

I have copied the mail-config.properties file to “conf” folder also…
and have created Environment Variable : “MAIL_CONFIG” in my docker container…but still I am facing the same issue…

Regards,
Tushar

Hi Tushar,

please make sure that you set the env variable at the right place. For me, it work when I set the env var in the start-camunda.bat script.

set "MAIL_CONFIG=%CATALINA_HOME%\conf\mail-config.properties"

Best regards,
Philipp

Hi Philipp,

  1. I have added the environment variable as
    MAIL_CONFIG=“$CATALINA_HOME/conf/mail-config.properties” in my Container’s bin/catalina.sh file (which starts my camunda server in the container)

  2. I have copied mail-config.properties file to conf folder also.

  3. I have same mail-config.properties file in my src/main/resources folder also.

Still I am getting error as :
> 16-Mar-2017 11:47:21.400 SEVERE [http-nio-8080-exec-4] org.camunda.commons.logging.BaseLogger.logError ENGINE-16004 Exception while closing command context: Cannot find mail configuration at: classpath:/mail-config.properties

 java.lang.IllegalStateException: Cannot find mail configuration at: classpath:/mail-config.properties
        at org.camunda.bpm.extension.mail.config.PropertiesMailConfiguration.loadProperties(PropertiesMailConfiguration.java:122)
        at org.camunda.bpm.extension.mail.config.PropertiesMailConfiguration.getProperties(PropertiesMailConfiguration.java:106)
        at org.camunda.bpm.extension.mail.config.PropertiesMailConfiguration.getSender(PropertiesMailConfiguration.java:78)
        at org.camunda.bpm.extension.mail.send.SendMailRequest.getFrom(SendMailRequest.java:62)
        at org.camunda.bpm.extension.mail.send.SendMailRequest.isRequestValid(SendMailRequest.java:147)
        at org.camunda.connect.impl.AbstractConnectorRequest.execute(AbstractConnectorRequest.java:39)
        at org.camunda.connect.plugin.impl.ServiceTaskConnectorActivityBehavior$1.call(ServiceTaskConnectorActivityBehavior.java:57)
        at org.camunda.connect.plugin.impl.ServiceTaskConnectorActivityBehavior$1.call(ServiceTaskConnectorActivityBehavior.java:51)
        at org.camunda.bpm.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.executeWithErrorPropagation(AbstractBpmnActivityBehavior.java:108)

Regards,
Tushar

Hi Tushar,

do you export the env variable via

export MAIL_CONFIG="$CATALINA_HOME/conf/mail-config.properties"

?

I put it without export…after ur post…I added the export and that error got resolved…

but after that a new error came

17-Mar-2017 05:35:34.140 SEVERE [http-nio-8080-exec-10] org.camunda.commons.logging.BaseLogger.logError ENGINE-16006 BPMN Stack Trace:
ServiceTask_1sckkg7 (activity-execute, ProcessInstance[8abdef14-0ad3-11e7-8755-0242ac110002], pa=VNF Process App)
ServiceTask_1sckkg7
^
|
StartEvent_1

17-Mar-2017 05:35:34.141 SEVERE [http-nio-8080-exec-10] org.camunda.commons.logging.BaseLogger.logError ENGINE-16004 Exception while closing command context: failed to send mail
org.camunda.bpm.extension.mail.MailConnectorException: failed to send mail
at org.camunda.bpm.extension.mail.send.SendMailConnector.execute(SendMailConnector.java:65)
at org.camunda.bpm.extension.mail.send.SendMailConnector.execute(SendMailConnector.java:38)
at org.camunda.connect.impl.AbstractConnectorRequest.execute(AbstractConnectorRequest.java:42)
at org.camunda.connect.plugin.impl.ServiceTaskConnectorActivityBehavior$1.call(ServiceTaskConnectorActivityBehavior.java:57)
at org.camunda.connect.plugin.impl.ServiceTaskConnectorActivityBehavior$1.call(ServiceTaskConnectorActivityBehavior.java:51)

the Cause was given as : Caused by: javax.mail.NoSuchProviderException: smtp

smtp which I mentioned in mail-config.properties file as below:

mail.transport.protocol=smtp
mail.smtp.host=ABC.COM
mail.smtp.port=21
mail.smtp.auth=true
mail.smtp.ssl.enable=true
mail.smtp.socketFactory.port=21
mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory

Regards,
Tushar

Hi Tushar,

this sound’s odd. Do you use the Camunda distribution? Which version?

Best regards,
Philipp

I am using camunda 7.6.0

Hi Tushar,

maybe this is not caused by the extension directly. Can you try to send a mail without the extension? For example using Java Mail.

Best regards,
Philipp

Hi Philipp,

where to set env variables if I’m running Tomcat as a service?

Hi @radovan,

I didn’t try it out yet.

What system do you use? (win/linux)

Maybe you can find an answer on

Best regards,
Philipp

Hi Tushar,

Have you had you resolve this error because right now I am getting the same error.
PFB snapshot.

If any solution for this problem please suggest.

Thank you,
Jignesh Pithva.

Do you have mail-config.properties file in your src/main/resources location of workspace???

You need javax.mail-1.5.5.jar,

Put it under camunda-7.x.x/server/apache-tomcat-8.x.xx/lib

(If still not working, remove other mail*.jar)

I have the text emails going through fine, but html is not going through. Any idea how to get this working?

Resolved… Issue was with the emails server

adat

Hi how you have resolved the mail server issue .
as I am getting
javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted. while sending mail through connector