aspose file tools*
The moose likes Threads and Synchronization and the fly likes Having Problem in sending mail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Having Problem in sending mail" Watch "Having Problem in sending mail" New topic
Author

Having Problem in sending mail

Harsha Patil
Greenhorn

Joined: Jul 14, 2011
Posts: 4
I get following error,
Exception in thread "Thread-19" java.lang.ClassCastException: com.sun.xml.ws.encoding.StringDataContentHandler cannot be cast to javax.activation.DataContentHandler
at javax.activation.MailcapCommandMap.getDataContentHandler(MailcapCommandMap.java:581)
at javax.activation.MailcapCommandMap.createDataContentHandler(MailcapCommandMap.java:535)
at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:597)
at javax.activation.DataHandler.writeTo(DataHandler.java:301)
at javax.mail.internet.MimeUtility.getEncoding(MimeUtility.java:264)
at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1299)
at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1008)
at javax.mail.internet.MimeMultipart.updateHeaders(MimeMultipart.java:414)
at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1285)
at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2071)
at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:2039)
at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1739)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:737)
at com.webaccess.cibilonline.util.SendMail.postMail(SendMail.java:127)
at com.webaccess.cibilonline.util.HTMLUtil$ThreadImpl.run(HTMLUtil.java:762)

if i call web service in my code and if don't use web service mails are getting send properly
the jars used are activation.jar and mail-1.4.2.jar

Thanks in advance
Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

Please post code snippet(s), for faster assistance.


S.D. MADHAN
Not many get the right opportunity !
Harsha Patil
Greenhorn

Joined: Jul 14, 2011
Posts: 4

In my code i am using activation.jar and JAX-WS 2.1 - activation.jar which comes when i import .wsdl file to call web service
Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

Harsha Patil wrote:In my code i am using activation.jar and JAX-WS 2.1 - activation.jar which comes when i import .wsdl file to call web service


I believe, you need to use the "JAX-WS 2.1-activation.jar" only.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Having Problem in sending mail
 
Similar Threads
Unable to Send Java mail
Mail is not get send if i call web service, if i don't call web service mail is getting send
Help Me : Error in sending mail from JSP
NoClassDefFoundError JavaMail..........
com.sun.mail... no classdef error when sending Mail