Win a copy of Microservices in Action this week in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Having Problem in sending mail  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post code snippet(s), for faster assistance.
 
Harsha Patil
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!