Puneet,
I am trying to help you out of this.
The problem lies somewhere inside this try-catch-Block:
try
{
fileName = it.next().toString();
content = in.getAttachment(fileName);
File f = File.createTempFile("tmp_", fileName);
FileOutputStream fos = new FileOutputStream(f);
content.writeTo(fos);
fos.flush();
fos.close();
// for the sake of simplicity only return the
file received as attachment
NormalizedMessage out =
exchange.createMessage();
// set the content to dummy xml tag
out.setContent(new StringSource("<payload/>"));
FileDataSource fds = new FileDataSource(f);
InputStream is = fds.getInputStream();
// create a handler for the attachment
DataHandler dh = new DataHandler(new
StreamDataSource(is, fds.getContentType()));
// and add it to the message
out.addAttachment(fileName, dh);
// prepare and send the exchange
exchange.setMessage(out, "out");
channel.send(exchange);
f.deleteOnExit();
}
catch (IOException ex)
{
throw new
MessagingException("HandlerBean.onProviderExchange(): " +
ex.getLocalizedMessage());
}
Please do an output in the catch-Block printing out the IOException stack
trace. Put the line in front of the throw statement.
Please let me know the result.
Regards,
Lars
puneetjain wrote:
>
> I have follow all the step to create http upload application given in the
> tutorial of servicemix successfully.
> The deployable of the application is successfully deployed on the
> servicemix.
> When I create a client and try to upload a file using the appliaction
> following exception displayed in the browser:
>
> <?xml version="1.0" encoding="UTF-8" ?>
> - <error>
> - <![CDATA[
> javax.jbi.messaging.MessagingException: HandlerBean.onProviderExchange():
> The filename, directory name, or volume label syntax is incorrect
> at
> org.apache.servicemix.jbi.HandlerBean.onProviderExchange(HandlerBean.java:173)
> at
> org.apache.servicemix.jbi.HandlerBean.onMessageExchange(HandlerBean.java:56)
> at
> org.apache.servicemix.bean.BeanEndpoint.onProviderExchange(BeanEndpoint.java:235)
> at
> org.apache.servicemix.bean.BeanEndpoint.process(BeanEndpoint.java:211)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)
> at
> org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
> at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:170)
> at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167)
> at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> at java.lang.Thread.run(Thread.java:595)
> ]]>
> </error>
>
>
>
> And following exception appear on the console of servicemix:
>
>
> ERROR - BeanComponent - Error processing exchange InOut[
> id: ID:10.105.115.61-117c979d8b4-10:2
> status: Active
> role: provider
> service: {http://www.servicemix.org/example}httphandler
> endpoint: handlerEndpoint
> in: <?xml version="1.0" encoding="UTF-8"?><payload/>
> ]
> javax.jbi.messaging.MessagingException: HandlerBean.onProviderExchange():
> The filename, directory name, or volume label syntax is incorrect
> at
> org.apache.servicemix.jbi.HandlerBean.onProviderExchange(HandlerBean.java:173)
> at
> org.apache.servicemix.jbi.HandlerBean.onMessageExchange(HandlerBean.java:56)
> at
> org.apache.servicemix.bean.BeanEndpoint.onProviderExchange(BeanEndpoint.java:235)
> at
> org.apache.servicemix.bean.BeanEndpoint.process(BeanEndpoint.java:211)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)
> at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)
> at
> org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
> at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
> at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:170)
> at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167)
> at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> at java.lang.Thread.run(Thread.java:595)
>
>
> Please help me to solve this problem.
>
> Thanks,
> Puneet Jain
>
>
>
--
View this message in context:
http://www.nabble.com/Problem-in-running-the-http-upload-application-tutorial-Example-tp15178224s12049p15189991.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.