cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Deepak Gupta" <javaread...@googlemail.com>
Subject Problem with java mail - suspect geronimo-javamail_1.4_spec-1.0-M1.jar is the problem
Date Thu, 24 Jan 2008 18:10:27 GMT
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=
javax.mail.Provider$Type@12bbe6b; 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=
javax.mail.Provider$Type@12bbe6b; 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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message