permaculture playing cards*
The moose likes Web Services and the fly likes SAAJ client issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "SAAJ client issue " Watch "SAAJ client issue " New topic
Author

SAAJ client issue

anas alsarairah
Greenhorn

Joined: Sep 27, 2007
Posts: 28
hello

i have a web service client that uses SAAJ API to create a message with attachment and send it to a web service endpoint but after i construct the message and send it i get the following exception in sending the soap

CAUSE:
java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Error during saving a multipart message
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:162)
at ae.com.rwd.ecs.root.integration.client.DocumentClient.sendDocument(DocumentClient.java:213)
at ae.com.rwd.ecs.root.integration.client.DocumentClient.loopIntegrationReadyDocuments(DocumentClient.java:141)
at ae.com.rwd.ecs.root.integration.client.DocumentClient.startTimeoutActions(DocumentClient.java:114)
at ae.com.rwd.ecs.root.integration.client.DocumentClient.newTimeout(DocumentClient.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1056)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1128)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5292)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:567)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:157)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundTimeout(SystemInterceptorProxy.java:144)
at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:858)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:367)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5264)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5252)
at com.sun.ejb.containers.BaseContainer.callEJBTimeout(BaseContainer.java:3965)
at com.sun.ejb.containers.EJBTimerService.deliverTimeout(EJBTimerService.java:1667)
at com.sun.ejb.containers.EJBTimerService.access$100(EJBTimerService.java:98)
at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.run(EJBTimerService.java:2485)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Error during saving a multipart message
at com.sun.xml.messaging.saaj.soap.MessageImpl.writeTo(MessageImpl.java:1336)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:324)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:191)
... 36 more
Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/pdf
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:877)
at javax.activation.
SEVERE: DataHandler.writeTo(DataHandler.java:302)
at com.sun.xml.messaging.saaj.packaging.mime.internet.MimeBodyPart.writeTo(MimeBodyPart.java:971)
at com.sun.xml.messaging.saaj.packaging.mime.internet.MimeMultipart.writeTo(MimeMultipart.java:277)
at com.sun.xml.messaging.saaj.soap.MessageImpl.writeTo(MessageImpl.java:1327)
... 38 more

SEVERE: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Error during saving a multipart message
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:162)
at ae.com.rwd.ecs.root.integration.client.DocumentClient.sendDocument(DocumentClient.java:213)
at ae.com.rwd.ecs.root.integration.client.DocumentClient.loopIntegrationReadyDocuments(DocumentClient.java:141)
at ae.com.rwd.ecs.root.integration.client.DocumentClient.startTimeoutActions(DocumentClient.java:114)
at ae.com.rwd.ecs.root.integration.client.DocumentClient.newTimeout(DocumentClient.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1056)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1128)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5292)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:567)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:157)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundTimeout(SystemInterceptorProxy.java:144)
at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:858)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:367)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5264)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5252)
at com.sun.ejb.containers.BaseContainer.callEJBTimeout(BaseContainer.java:3965)
at com.sun.ejb.containers.EJBTimerService.deliverTimeout(EJBTimerService.java:1667)
at com.sun.ejb.containers.EJBTimerService.access$100(EJBTimerService.java:98)
at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.run(EJBTimerService.java:2485)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Error during saving a multipart message
at com.sun.xml.messaging.saaj.soap.MessageImpl.writeTo(MessageImpl.java:1336)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:324)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:191)
... 36 more
Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/pdf
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:877)
at javax.activation.DataHandler.writeTo(DataHandler.java:302)
at com.sun.xml.messaging.saaj.packaging.mime.internet.MimeBodyPart.writeTo(MimeBodyPart.java:971)
at com.sun.xml.messaging.saaj.packaging.mime.internet.MimeMultipart.writeTo(MimeMultipart.java:277)
at com.sun.xml.messaging.saaj.soap.MessageImpl.writeTo(MessageImpl.java:1327)
... 38 more

and here is the code in which i add the attachment into the message

private void addAttachment(SOAPMessage message, EcsAppDocs ecsAppDoc) throws FileNotFoundException {

AttachmentPart attachment = message.createAttachmentPart();
String fileToAttach=DocumentClient.getPropertyManager().getProperty(RWDConstants.INTEGRATION_PROPERTIES_FILE_NAME, RWDConstants.MAPPED_NETWORK_DRIVE) + ":" + ecsAppDoc.getDocAbspath() + "/" + ecsAppDoc.getDocName();
System.out.println(fileToAttach);
InputStream input = new FileInputStream(fileToAttach);
attachment.setContent(input,"application/pdf");
attachment.setContentId(ecsAppDoc.getDocName());
message.addAttachmentPart(attachment);
}

thanks in advance
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SAAJ client issue
 
Similar Threads
javax.mail error
Connection Multiple Databases with diynamically persistence unit names
EJB local injection and transactions
Problem using alias for columns in a query JPA
NamedStoredProcedureQuery gets no result