Camunda-bpm-mail: Cannot load class org.camunda.bpm.extension.mail.dto.Mail

I try to deploy camunda-bpm-mail.example.pizza-1.3.0-SNAPSHOT.war from https://github.com/camunda/camunda-bpm-mail example on a camunda-bpm-wildfly10-7.7.0 server (using https://camunda.org/release/camunda-bpm/wildfly10/7.7/camunda-bpm-wildfly10-7.7.0.zip). I followed the “special instructions” (https://github.com/camunda/camunda-bpm-mail/blob/master/docs/shared-process-engine-wildfly.md), then set MAIL_CONFIG to point to a valid mail-config.properties file. And it all looked good - once I sent a message to the configured mailbox a “make the pizza” task appeared, but not without an error. On the server I can see the following logs:

ERROR [org.camunda.bpm.engine.context] (default task-24) ENGINE-16004 Exception while closing command context:

Error while evaluating expression: ${mail.getText()}.
Cause: Cannot deserialize object in variable ‘mail’: ENGINE-09017 Cannot load class ‘org.camunda.bpm.extension.mail.dto.Mail’: org.camunda.bpm.extension.mail.dto.Mail from [Module “deployment.camunda-bpm-mail.example.pizza-1.3.0-SNAPSHOT.war:main” from Service Module Loader]:

org.camunda.bpm.engine.ProcessEngineException: Error while evaluating expression: ${mail.getText()}.
Cause: Cannot deserialize object in variable ‘mail’: ENGINE-09017 Cannot load class ‘org.camunda.bpm.extension.mail.dto.Mail’: org.camunda.bpm.extension.mail.dto.Mail from [Module “deployment.camunda-bpm-mail.example.pizza-1.3.0-SNAPSHOT.war:main” from Service Module Loader]
at org.camunda.bpm.engine.impl.el.JuelExpression.getValue(JuelExpression.java:66)

Caused by: org.camunda.bpm.engine.ProcessEngineException: Cannot deserialize object in variable ‘mail’: ENGINE-09017 Cannot load class ‘org.camunda.bpm.extension.mail.dto.Mail’: org.camunda.bpm.extension.mail.dto.Mail from [Module “deployment.camunda-bpm-mail.example.pizza-1.3.0-SNAPSHOT.war:main” from Service Module Loader]
at org.camunda.bpm.engine.impl.variable.serializer.AbstractSerializableValueSerializer.readValue(AbstractSerializableValueSerializer.java:81)

Caused by: org.camunda.bpm.engine.ClassLoadingException: ENGINE-09017 Cannot load class ‘org.camunda.bpm.extension.mail.dto.Mail’: org.camunda.bpm.extension.mail.dto.Mail from [Module “deployment.camunda-bpm-mail.example.pizza-1.3.0-SNAPSHOT.war:main” from Service Module Loader]
at org.camunda.bpm.engine.impl.util.EngineUtilLogger.classLoadingException(EngineUtilLogger.java:135)

Caused by: java.lang.ClassNotFoundException: org.camunda.bpm.extension.mail.dto.Mail from [Module “deployment.camunda-bpm-mail.example.pizza-1.3.0-SNAPSHOT.war:main” from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)

I checked and camunda-bpm-mail-core-1.3.0-SNAPSHOT.jar which I built as a part of the example does contain org.camunda.bpm.extension.mail.dto.Mail.class - what could I be missing?

Hi @maxint,

I try to reproduce your issue.
Can you please share your complete log?
Did you follow all instructions? Did you copy the JAR file “camunda-bpm-mail-core-1.2.0.jar” into the module?
What JDK version do you use?

Best regards,
Philipp

Hi @maxint,

it seems that another module import is missing. Please add the line
<module name="org.camunda.bpm.extension.camunda-bpm-mail-core" services="import" />
to the \server\wildfly-10.0.0.Final\modules\org\camunda\bpm\camunda-engine\main\module.xml and try again.
Does this solve the issue?

Best regards,
Philipp

I came across this issue and resolved it by setting the scope to provided in the maven pom file for the mail bpm and the related java mail libraries. I sue tomcat 8 .

@adat

Hi,

I also want to use the camunda-bpm-mail extension.
But where do I find the camunda-bpm-mail-core-1.1.0.jar file?
Is there a newer version than 1.1.0?

I use a wildfly 10, full distribution, engine (shared engine).

Also, in the instructions it says:

If you use Wildfly, follow the special instructions.

Does this mean I only have to follow this part or I still have to add the dependencies mentioned above that line?

Thanks

My question now is how the mail-config.properties file works?
Do I have to included it both in my application (under src/main/resources/) and also in the server\standalone\configuration\?

The latest version is 1.2.0. You can download it from https://mvnrepository.com/artifact/org.camunda.bpm.extension/camunda-bpm-mail-core/1.2.0

Only the special instructions.

Only in Wildfly.

1 Like

Thanks @Philipp_Ossler!

Do you know by the way why I get an ERROR when I build my project?

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

(my process is build successfully but in the logs I get this error and I don’t know if it will affect anything).

In the prepackaged distribution I use, I see there was already a folder slf4j under
..server\wildfly-10.1.0.Final\modules\system\layers\base\org
with the following folders:
image

Also, in the camunda maven project there are the following dependencies in my pom.xml

<dependency>
<groupId>org.slf4j</groupId>
<!– apache commons logging => slf4j –>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.7</version>
<scope>test</scope>
</dependency>

<dependency>
<!– java util logging => slf4j –>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>1.7.7</version>
<scope>test</scope>
</dependency>

So, so far there were no errors.

But once I put the slf4j folder under
..\server\wildfly-10.1.0.Final\modules\org
(as instructed in github for using the mail plugin)
I get the above error.

You can ignore this error. I just say that the logging is not configured correctly.

1 Like