emailing pdf using smtp

Hi,

Am receiving below execption while sending PDF as an attachment thru client.smtp service. Did any one came across this situation and had been resolved. Appreciate your valuable suggestions on this.

Input parameters passed to Pub.client.smtp for mailing pdf:

to:xxxxx@xxxxx.com
Subject:xxxxx
mailhost:xxxxxx
attachements/contenttype: application/pdf
attachments/filename:samplePDF.pdf
attachments/content:bytes(Using getFile, PDF content is loaded as bytes and passed here)

Also tried other options like passing pdf location in filename/passing org.apache.pdfbox.pdmodel.PDDocument as content in the API but it doesn’t help and always got the following error.

Error:

java.lang.ClassCastException: com.wm.util.Values cannot be cast to java.lang.String
at pub.clientimpl.smtp(clientimpl.java:324)
at sun.reflect.GeneratedMethodAccessor441.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:443)
at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:640)
at com.wm.app.b2b.server.util.tspace.ReservationProcessor.process(ReservationProcessor.java:39)
at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:49)
at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:243)
at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)

Please check this thread and especially the end of the thread responses:

HTH,
RMG

It seems you are trying to map List to String. Please cross check mapping once again.

Regards,
Syed Faraz Ahmed