Spring--cannot convert javax.mail.session

You most likely have two copies if javax.mail.Session on your classpath. One probably comes from the appserver's internal libraries, the other is likely packed in your app's lib directory. The two copies will clash when you try and use them like this.

Remove the one in your app's lib directory, and try again.


This is a classloading issue. Usually this is because the class is both in a jar in your server and in your application. In this case, you probably want to remove it from your application. Do you have something like mail.jar in your WEB-INF/lib or EAR?