|
Re: javax.mail issues with multipart messages [message #1258501 is a reply to message #1234547] |
Thu, 27 February 2014 12:59 |
Martin Baumgartner Messages: 9 Registered: June 2013 |
Junior Member |
|
|
Which version of javax.mail do you use? I had the same issue, but could fix it. Use Javax.mail 1.5 as it ships a osgi-Manifest.MF and change the classloader.
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.5.1</version>
<exclusions>
<exclusion>
<artifactId>activation</artifactId>
<groupId>javax.activation</groupId>
</exclusion>
</exclusions>
</dependency>
https://community.oracle.com/message/6663195
Quote:
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
javaMailSender.send(message);
Thread.currentThread().setContextClassLoader(oldClassLoader);
Ugly but works (for me).
Edit, I am not sure, if you need to change the classloader on virgo too. In our environment, we use virgo for development and websphere for production use. You should try without changing the classloader first.
[Updated on: Thu, 27 February 2014 13:06] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04211 seconds