[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] JavaMail version conflicts


I have an application deployed using equinox which bundles the java
mail API by reusing the respective eclipse bundles
javax.activation_1.1.0.v201005080500.jar and
javax.mail_1.4.0.v201005080615.jar. Everything worked fine. Now one
user ran this application on a machine where there was a version of
mail.jar and activation.jar in the JRE extension directory
(~/Library/Java/extensions/ on Mac OS X) and the following Exception
got thrown:

 javax.mail.NoSuchProviderException: Provider class does not have a
constructor(Session, URLName): protocol=smtp;
class=com.sun.mail.smtp.SMTPTransport; vendor=Sun Microsystems, Inc
at javax.mail.Session.getService(Session.java:488)
at javax.mail.Session.getTransport(Session.java:379)
at javax.mail.Session.getTransport(Session.java:339)
at javax.mail.Session.getTransport(Session.java:368)
at javax.mail.Transport.send(Transport.java:67)
at javax.mail.Transport.send(Transport.java:48)

I read some threads in several forums where people had encountered the
same when there were multiple versions of java mail available through
different classloaders.

What is the easiest/cleanest way to ensure that only my javamail
version is used regardless of what's in the JRE extension directory?

I checked the archive search and didn't find anything, so I hope it's
not an FAQ. If it is, please point me to the archive.

Thanks in advance,