I'm using CXF 2.0.3-incubator with Maven 2. I get this exception when I try to use java mail from within my web service (running on Tomcat 5.5.16) :-
javax.mail.NoSuchProviderException: Provider class does not have a constructor(Session, URLName): protocol=smtp; type= [EMAIL PROTECTED]; class=com.sun.mail.smtp.SMTPTransport; vendor=Sun Microsystems, Inc at javax.mail.Session.getService(Session.java:485) at javax.mail.Session.getTransport(Session.java:379) at javax.mail.Session.getTransport(Session.java:339) at com.wearegt.messenger.transports.SMTPSend.doSend(SMTPSend.java :64) at com.wearegt.messenger.transports.SMTPSend.run(SMTPSend.java:99) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.NoSuchMethodException: com.sun.mail.smtp.SMTPTransport .<init>(javax.mail.Session, javax.mail.URLName) at java.lang.Class.getConstructor0(Class.java:2647) at java.lang.Class.getConstructor(Class.java:1629) at javax.mail.Session.getService(Session.java:480) ... 5 more Exception in thread "Thread-28" java.lang.RuntimeException: Error sending email at com.wearegt.messenger.transports.SMTPSend.doSend(SMTPSend.java :76) at com.wearegt.messenger.transports.SMTPSend.run(SMTPSend.java:99) at java.lang.Thread.run(Thread.java:595) Caused by: javax.mail.NoSuchProviderException: Provider class does not have a constructor(Session, URLName): protocol=smtp; type= [EMAIL PROTECTED]; class=com.sun.mail.smtp.SMTPTransport; vendor=Sun Microsystems, Inc at javax.mail.Session.getService(Session.java:485) at javax.mail.Session.getTransport(Session.java:379) at javax.mail.Session.getTransport(Session.java:339) at com.wearegt.messenger.transports.SMTPSend.doSend(SMTPSend.java :64) ... 2 more Caused by: java.lang.NoSuchMethodException: com.sun.mail.smtp.SMTPTransport .<init>(javax.mail.Session, javax.mail.URLName) at java.lang.Class.getConstructor0(Class.java:2647) at java.lang.Class.getConstructor(Class.java:1629) at javax.mail.Session.getService(Session.java:480) ... 5 more Having searched on the web, it appears this indicates that there are 2 implementations of java mail on the classpath. Tomcat has the Sun mail.jaras expected, but having run a "mvn site" it seems I have a geronimo-javamail_1.4_spec-1.0-M1.jar on my classpath. Does anyone which if any CXF pom.xml may be pulling this in, so I can exclude it ? thanks, Deepak