How to activate logging within camunda-bpm-mail connector

Used Environment:
Adopt Open JDK 11
Camundas Pre-Packaged Distribution 7.15 for WildFly,
which is based on wildfly-22.0.1.Final, augmented with Camunda stuff.
Installing the mail connector camunda-bpm-mail-core:1.3.0 following the provided
instructions.
Install the Extension for a Shared Process Engine on Wildfly

When starting WildFly (also without any other webapp deployed) the following error lines are
seen in the log file
ERROR [stderr] (ServerService Thread Pool – 80) SLF4J: Failed to load class
“org.slf4j.impl.StaticLoggerBinder”.
ERROR [stderr] (ServerService Thread Pool – 80) SLF4J: Defaulting to no-operation (NOP)
logger implementation.
This is caused when no binding is provided for SLF4J.

The defaulting to NOP causes that the following important exception is not
seen in the log file:
Within method PollMailResponse:collectResponseParameters
LOGGER.error(“exception while transforming message to dto”, e);

I think that the above-mentioned instructions within the paragraph “Create a module for slf4j.api”
are not sufficient.

Greetings from Munich
Stephan

Hello @StephanMuc81927 ,

the first thing that comes to my mind here is that the version of slf4j api is quite old, as this installation guide is 5 years old now.
By default, our distro comes with slf4j in version 1.7.26, so you can basically skip step 2.
The module you need to reference then in the module.xml of the extension is then org.slf4j.slf4j-api.

I hope this helps

Jonathan

Thank you for your advice!
At a first try the module org.slf4j.slf4j-api could not be loaded as a dependency of the connector.
And the reason I found was, that in modules directory of your distro
“modules/org/slf4j/slf4j-api/main”
there is a “slf4j-api-1.7.26.jar” but no “modules.xml”
Intent or mistake?
I added one by myself, but the ERROR log is still there.
I think what is missing is not the slf4 api but a needed binding, e.g.: sl4j-simple
Stephan

Additional information:
Of course I have a configured binding in my web application.
I think we met again here the class loading problem as stated
in a former thread:
https://forum.camunda.io/t/camunda-bpm-mail-class-loading-problem/28750

Hello @StephanMuc81927 ,

after doing some research, I found out that the wildfly distro provides a already configured slf4j-api module. You can use it by adjusting the module.xml from your mail connector to this:

<module xmlns="urn:jboss:module:1.0" name="org.camunda.bpm.extension.camunda-bpm-mail-core">
  <resources>
    <resource-root path="camunda-bpm-mail-core-1.3.0.jar" />
  </resources>

  <dependencies>
    <module name="javax.mail.api" />
    <module name="org.slf4j" />
    
    <module name="org.camunda.connect.camunda-connect-core" />
  </dependencies>
</module>

The good news is:
Logging seems to work now.
Thx!
The bad news is: when setting mail.attachment.download=true
The following exception is thrown:
Caused by: java.lang.NoClassDefFoundError: javax/activation/DataHandler
at org.camunda.bpm.extension.camunda-bpm-mail-core@1.3.0//
org.camunda.bpm.extension.mail.dto.Attachment.download(Attachment.java:46)
at org.camunda.bpm.extension.camunda-bpm-mail-core@1.3.0//
org.camunda.bpm.extension.mail.dto.Mail.downloadAttachments(Mail.java:181)
at org.camunda.bpm.extension.camunda-bpm-mail-core@1.3.0//
org.camunda.bpm.extension.mail.poll.PollMailResponse.collectResponseParameters
(PollMailResponse.java:54)

It seems, here, too, the dependencies for the connector would have to be adapted to the new distro

Hello @StephanMuc81927 ,

this seems to be kind of an endless story :slight_smile:

What I basically did was importing the source code to my IDE and then searching the dependency tree for the class that went missing.
Then, I searched the modules for missing dependencies. And prefer system modules over our distro modules :wink:

Maybe this helps

Jonathan

Hello @StephanMuc81927 ,

for further investigation of the class loading problems, I would like to refer to Camunda-bpm-mail class loading problem