Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
ADe_Pinto1673864968
Contributor
Contributor

Mail issue on Karaf container

Hi everyone,

I have 2 different servers where I deployed a simple dummy mail application and for some reason on 1 server it doesn't work and It logs:

Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "com.sun.mail.util.PropUtil.getBooleanSessionProperty(Ljavax/mail/Session;Ljava/lang/String;Z)Z" the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) of the current class, javax/mail/internet/MimeMessage, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, com/sun/mail/util/PropUtil, have different Class objects for the type javax/mail/Session used in the signature

The application works properly locally. The configuration, the libraries, the java version are exactly the same on both the server. During the deploy it logs :

2023-01-16 12:26:55,403 | INFO | -192.168.125.143 | FeaturesServiceImpl       | 8 - org.apache.karaf.features.core - 4.0.7 | Adding features: DummySendMailAdp-feature/[0.1.0.SNAPSHOT,0.1.0.SNAPSHOT]

2023-01-16 12:26:57,575 | INFO | pool-3-thread-1 | FeaturesServiceImpl       | 8 - org.apache.karaf.features.core - 4.0.7 | Changes to perform:

2023-01-16 12:26:57,575 | INFO | pool-3-thread-1 | FeaturesServiceImpl       | 8 - org.apache.karaf.features.core - 4.0.7 |  Region: root

2023-01-16 12:26:57,575 | INFO | pool-3-thread-1 | FeaturesServiceImpl       | 8 - org.apache.karaf.features.core - 4.0.7 |   Bundles to install:

2023-01-16 12:26:57,575 | INFO | pool-3-thread-1 | FeaturesServiceImpl       | 8 - org.apache.karaf.features.core - 4.0.7 |    mvn:DemoRoutes/DummySendMailAdp-bundle/0.1.0-SNAPSHOT

2023-01-16 12:26:57,590 | INFO | pool-3-thread-1 | FeaturesServiceImpl       | 8 - org.apache.karaf.features.core - 4.0.7 |    mvn:org.apache.camel/camel-mail/2.17.3

2023-01-16 12:26:57,590 | INFO | pool-3-thread-1 | FeaturesServiceImpl       | 8 - org.apache.karaf.features.core - 4.0.7 | Installing bundles:

2023-01-16 12:26:57,590 | INFO | pool-3-thread-1 | FeaturesServiceImpl       | 8 - org.apache.karaf.features.core - 4.0.7 |  mvn:DemoRoutes/DummySendMailAdp-bundle/0.1.0-SNAPSHOT

2023-01-16 12:26:57,622 | INFO | pool-3-thread-1 | FeaturesServiceImpl       | 8 - org.apache.karaf.features.core - 4.0.7 |  mvn:org.apache.camel/camel-mail/2.17.3

2023-01-16 12:26:57,637 | INFO | pool-3-thread-1 | FeaturesServiceImpl       | 8 - org.apache.karaf.features.core - 4.0.7 | Starting bundles:

2023-01-16 12:26:57,637 | INFO | pool-3-thread-1 | FeaturesServiceImpl       | 8 - org.apache.karaf.features.core - 4.0.7 |  org.apache.camel.camel-mail/2.17.3

2023-01-16 12:26:57,731 | INFO | pool-3-thread-1 | FeaturesServiceImpl       | 8 - org.apache.karaf.features.core - 4.0.7 |  mdw.DummySendMailAdp/0.1.0.SNAPSHOT

2023-01-16 12:26:57,731 | INFO | pool-3-thread-1 | ultOsgiApplicationContextCreator | 243 - org.springframework.osgi.extender - 1.2.1 | Discovered configurations {osgibundle:/META-INF/spring/*.xml} in bundle [DummySendMailAdp (mdw.DummySendMailAdp)]

Thanks for any tips!

Andrea De Pinto

Labels (4)
2 Replies
Anonymous
Not applicable

Hello @Andrea De Pinto​ ,

You probably have two different versions of the JavaMail jars in your application and Runtime.

The possible solution:

  1. try to delete the mail folder under <runtime home folder>\system\javax\mail, please zip the folder as a backup first.
  2. restart runtime to re-try?
ADe_Pinto1673864968
Contributor
Contributor
Author

Hi Achen, thanks for your reply, I really appreciate it. I found the problem, there are files that make conflict with the email lib, so after removing them the process works. These files are :

 

aws-java-sdk-1.11.397-javadoc.jar

aws-java-sdk-1.11.397-sources.jar

aws-java-sdk-1.11.397.jar

camel-aws-alldep-2.17.3.jar