You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by puneetjain <pu...@wipro.com> on 2008/01/30 11:37:38 UTC
Problem in running the http upload application tutorial Example
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-tp15178224s12049p15178224.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Problem in running the http upload application tutorial Example
Posted by lhe <lr...@web.de>.
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.
Re: Problem in running the http upload application tutorial Example
Posted by puneetjain <pu...@wipro.com>.
Hi Lars,
Thanks a lot for ur time u gave to look into my problem.
Meanwhile i have rectified the problem. Actually in the code of
MarshallerHandler.java and HandlerBean.java there is a statement which
creates a temprary file and filename is prepanded by "tmp_" and appended by
the filename coming in the request.
File f = File.createTempFile("tmp_", fileName);
Since its a http file upload control it give the complete path of the file
which may contains "\". So it trys to create a file which contains the "\"
in it and that the problem. File system do not allow to create such a file
and throw a IO exception, which later on converted into MessagingException
in the catch block.
I have rectified the code and problem is resolved now.
Thanks,
Puneet Jain
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-tp15178224s12049p15199787.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Problem in running the http upload application tutorial Example
Posted by lhe77 <la...@compart.net>.
Tribon,
it would be nice if you could add some hint to the tutorial for those people
facing the same problem.
Thanks in advance,
Lars
Tribon Cheng wrote:
>
> puneetjain,您好!
>
> I meet the same problem, this is caused by
> "File.createTempFile(filename)", the filename should not
> be an absolute path, See the modified method code belowing:
>
>
> private void onProviderExchange(MessageExchange exchange) throws
> MessagingException
> {
> // Exchange is finished
> if (exchange.getStatus() == ExchangeStatus.DONE)
> {
> return;
> }
> // Exchange has been aborted with an exception
> else if (exchange.getStatus() == ExchangeStatus.ERROR)
> {
> return;
> }
> // Fault message
> else if (exchange.getFault() != null)
> {
> exchange.setStatus(ExchangeStatus.DONE);
> channel.send(exchange);
> }
> else
> {
> NormalizedMessage in = exchange.getMessage("in");
>
> if (in == null)
> {
> // no in message - strange
> throw new
> MessagingException("HandlerBean.onProviderExchange(): Exchange has no IN
> message");
> }
> else
> {
> String fileName = null;
> DataHandler content = null;
> Set attNames = in.getAttachmentNames();
> Iterator it = attNames.iterator();
>
> if (attNames.size()==1)
> {
> if (it.hasNext())
> {
> try
> {
>
> //////mofify the code start
> File file = new File(it.next().toString());
> fileName = file.getName();
> content =
> in.getAttachment(file.getAbsolutePath());
>
> File f = File.createTempFile("tmp_",
> fileName);
>
> //////mofify the code end
>
> 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+"_cch", 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());
> }
> }
> }
> else
> {
> // more or less than one attachment
> throw new
> MessagingException("HandlerBean.onProviderExchange(): Wrong message format
> (invalid attachment count)");
> }
> }
> }
> }
>
> ======= 2008-01-30 18:37:38 您在来信中写道:=======
>
>>
>>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-tp15178224s12049p15178224.html
>>Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
>
> = = = = = = = = = = = = = = = = = = = =
>
>
> 致
> 礼!
>
>
> ---------------------------------------------------------
> 程操红
> 用友软件股份有限公司 集团平台技术开发部
> Tel:62435466
> Email:cch@ufida.com.cn
> 地址:北京市海淀区北清路68号 用友软件园
> 邮编:100085
> ---------------------------------------------------------
>
>
>
--
View this message in context: http://www.nabble.com/Problem-in-running-the-http-upload-application-tutorial-Example-tp15178224s12049p15199294.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.