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
> 

-- 
View this message in context: 
http://old.nabble.com/Unsupported-data-type-exception-with-Jetty-component-tp28730373p28731758.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to