Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

octet-stream as attachment

843834Sep 29 2004 — edited Sep 30 2004
Hi

I successfully transmitted a string via jaxrpc (using text/plain as mime type). No I would like to transmit a binary file. I think in this case the application/octed-stream mime type should be used. However when I try this I get a

"no object DCH for MIME type application/octet-stream"

error message in my server.log. The source looks like this:

AttachmentPart att = MessageFactory.newInstance().createMessage().createAttachmentPart();
att.setContentId("distributedFile");
javax.activation.FileDataSource fds = new javax.activation.FileDataSource("/usr/bin/grep");
att.setContent(fds, "application/octet-stream");

I also tried to use a ByteArrayInputStream(bytes) but I always get the same message. Well, it might be, that I have to write an own DataHandler for OctetStream but this seems to be a bit strange because it's not really exotic...

any ideas? Thanks a lot in advance. Regards

Oliver
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 28 2004
Added on Sep 29 2004
3 comments
393 views