Email Connector issue

0
I am trying to add the “Email Connector” module from the marketplace. I followed the pre-requisites in the documentation. I removed all unused jars (Had to delete the jars one set at a time and run the app and check if it is breaking – Had to test more than 20 times). I tried replacing the jakarta mail jar which I downloaded from here “https://mavenlibs.com/jar/file/com.sun.mail/jakarta.mail”. I am still facing the “ServiceConfigurationError” exception. Please, help me with the fix.   Sudio Pro Version: 9.18.3     java.util.ServiceConfigurationError: jakarta.mail.Provider: com.sun.mail.imap.IMAPProvider not a subtype     at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:589)     at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1237)     at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1265)     at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1300)     at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1385)     at jakarta.mail.Session.loadProviders(Session.java:964)     at jakarta.mail.Session.<init>(Session.java:254)     at jakarta.mail.Session.getInstance(Session.java:281)     at org.simplejavamail.mailer.internal.MailerImpl.createMailSession(MailerImpl.java:187)     at org.simplejavamail.mailer.internal.MailerImpl.<init>(MailerImpl.java:134)     at org.simplejavamail.mailer.internal.MailerImpl.<init>(MailerImpl.java:119)     at org.simplejavamail.mailer.internal.MailerRegularBuilderImpl.buildMailer(MailerRegularBuilderImpl.java:210)
asked
3 answers
3

Hi,
when running locally you might need to clean your deployment directory to remove old .jar files there too.
Have you tried that?

answered
2

Following the instructions in the Prerequisites of the Email Connector module worked for me:

  1. Download and configure the latest version of Mx Model Reflection module. If you have the module already, ensure that it is up-to-date.
  2. Download and configure the latest version of the Encryption module. If you have the module already, ensure that it is up-to-date.
  3. Remove any existing email modules (IMAP/POP3 or Email Module with Templates).
  4. Check for and remove orphaned JAR files from any old email modules in the userlib subdirectory (including javax.mail-1.6.2.jaractivation-1.1.jar, and commons-email.jar).
  5. Clean the deployment directory before running the app

As I had to migrate the data from the Email Template module to the Email Connector module I could not delete the Email Template module. Instead, I deleted all the jar-files related to this modules in the userlib as well as the subfolders for the Email Template module in the folders javasource and javascriptsource, after ensuring that there was no use of the module anymore in the model. After downloading the relevant modules again (Email Connector, Encryption and Model Reflection) once again and cleaning up the userlib for older versions of the jar-files, the email connection worked.

answered
0

The Email Connector module should include all the .jar files it needs. If you download jars from another location you could be downloading the wrong version and seeing errors like the one you describe in your question.

I would suggest removing the .jar files you downloaded from elsewhere and just reinstall the Email Connector module directly from the Mendix Marketplace in Studio Pro.

I hope this helps.

answered