Hi Bertrand,

I can reproduce the issue, so it's a bug of camel-jetty component.
I just create a JIRA[1] for it and will try to fix it today.

[1] https://issues.apache.org/activemq/browse/CAMEL-2772

Willem

bgoetzmann wrote:
It seems that mail.jar missed on my classpath; now, there is no more
exception.
Now, I try to write to use the DataHandler to write a file on the disk, but
with:

DataHandler data = in.getAttachment("text.txt")

the statement bellow gives me 0, and I can't write anything:

data.getInputStream().available()


Any idea?

Cheer,

Bertrand.



bgoetzmann wrote:
Hello,

I'm writing a post on using Camel with Groovy; in my sample I'm using
Camel 2.3.0, the Jetty component and a Processor (written in a Groovy
DSL).
So, I would like to process an attachment in my processor as explained in
the documentation (http://camel.apache.org/jetty.html); I submit a form
with the "multipart/form-data" for enctype attribute, and in my processor
I can do the following when submitting a text file :

- I can get the DataHandler (DataHandler data =
in.getAttachment("text.txt"))
- I can display the MIME type (here "text/plain")
- but when I try to save the data into a file with something like:

FileOutputStream fos = ...
data.writeTo(fos)

I get this exception:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type
text/plain
        at
javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:870)
        at javax.activation.DataHandler.writeTo(DataHandler.java:301)
..

Any idea?

Thank you.

Cheers,

Bertrand.
http://www.odelia-technologies.com



Reply via email to