You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Jussi Nummelin <ju...@gmail.com> on 2009/10/01 12:53:53 UTC

Re: VFS zip file problems

Hi,

I build the 2009.02 version and tried the same use case. Now I get
exception every 5 seconds (seems to be the default polling cycle)

17:29:58,068 | DEBUG | pool-component.servicemix-vfs-thread-14 |
VFSPollingEndpoint       | vicemix.vfs.VFSPollingEndpoint  231 |
Unable to resolve path: zip:file://c:/temp/inbox/poju.zip!/log/PM.xml
java.io.IOException: Failed to create folder:
org.apache.commons.vfs.FileSystemException: Could not create folder
"zip:file:///c:/temp/inbox/poju.zip!/log/PM.xml" because it already
exists and is a file.
	at org.apache.servicemix.vfs.FileObjectResolver.resolveToFileObject(FileObjectResolver.java:62)
	at org.apache.servicemix.vfs.VFSPollingEndpoint.poll(VFSPollingEndpoint.java:229)
	at org.apache.servicemix.common.endpoints.PollingEndpoint$PollSchedulerTask$1.run(PollingEndpoint.java:202)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:619)

This seems to be because VFS component tries to create a folder
instead of file. I changed this to create a file instead of folder and
recompiled the code. After this change I can get the file contents
passed into bus but deleting the file fails:
org.apache.commons.vfs.FileSystemException: Could not delete
"zip:file:///c:/temp/inbox/poju.zip!/log/PM.xml".
        at org.apache.commons.vfs.provider.AbstractFileObject.deleteSelf(AbstractFileObject.java:709)
        at org.apache.commons.vfs.provider.AbstractFileObject.delete(AbstractFileObject.java:761)
        at org.apache.commons.vfs.provider.AbstractFileObject.delete(AbstractFileObject.java:724)
        at org.apache.servicemix.vfs.VFSPollingEndpoint.process(VFSPollingEndpoint.java:170)
        at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
        at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:598)
        at org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)
        at org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
        at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)
        at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
        at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
        at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.commons.vfs.FileSystemException: This file type
does not support delete.
        at org.apache.commons.vfs.provider.AbstractFileObject.doDelete(AbstractFileObject.java:190)
        at org.apache.commons.vfs.provider.AbstractFileObject.deleteSelf(AbstractFileObject.java:698)


The desired/expected behavior is to delete the whole zip file. Any
ideas how to make this possible?

Another oddity is that the output file (I'm using simple file "bridge"
in my tests currently) name is exactly the same as the input file.
This doesn't make sense to me since the normal file:sender endpoint is
as follows:
<file:sender service="test:receiver"
               endpoint="endpoint"
               directory="c:\Temp\outbox"
			   overwrite="true"
			   tempFilePrefix="pm_log-"
			   tempFileSuffix=".xml">



Cheers,
- Jussi -





On Tue, Sep 29, 2009 at 3:10 PM, Lars Heinemann <lh...@apache.org> wrote:
> The snapshots are built periodically. I would suggest building those
> from trunk because it's faster ;)
>
> Lars
>
>
> 2009/9/29 Jussi Nummelin <ju...@gmail.com>:
>> Hi Lars,
>>
>> Thanks for checking this so rapidly. I will check the fix asap.
>>
>> Are these packages in any maven repo, or should I build them locally from trunk?
>>
>>
>> Cheers,
>> - Jussi -
>>
>> On Tue, Sep 29, 2009 at 2:42 PM, Lars Heinemann <lh...@apache.org> wrote:
>>> Jussin,
>>>
>>> seems you discovered a bug. I fixed it in the trunk
>>> (2009.02-SNAPSHOT). You will probably need Servicemix-utils
>>> 2009.02-SNAPSHOT and Servicemix-common 2009.02-SNAPSHOT as well to get
>>> it running.
>>>
>>> Could you retry with that version?
>>>
>>> Regards
>>> Lars
>>>
>>>
>>>
>>> 2009/9/28 Jussi Nummelin <ju...@gmail.com>:
>>>> Hi all,
>>>>
>>>> We're trying to develop something on top of VFS component. The use
>>>> case is following:
>>>>
>>>> An external service uploads a zip file into pre-defined directory.
>>>> That zip file contains multiple files from which only one is of
>>>> interest for us. So this file should be passed to the bus by VFS
>>>> component.
>>>>
>>>> We tried this with following SU xbean:
>>>> <vfs:poller service="test:file_poller"
>>>>               endpoint="endpoint"
>>>>               targetService="test:file_sender"
>>>>               path="zip:file:///tmp/import/somefile.zip!/log/log.xml">
>>>>
>>>>  </vfs:poller>
>>>>
>>>> According to the VFS pages the file URL should be fine.
>>>> http://commons.apache.org/vfs/filesystems.html
>>>>
>>>>
>>>> With this we get following exception:
>>>>
>>>> INFO  - ServiceUnitLifeCycle           - Starting service unit: vfs-poller
>>>> INFO  - DeploymentService              - Error in start
>>>> java.lang.Exception: <?xml version="1.0" encoding="UTF-8"?>
>>>> <jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message"
>>>> version="1.0">
>>>> <jbi-task-result>
>>>> <frmwk-task-result>
>>>> <frmwk-task-result-details>
>>>> <task-result-details>
>>>> <task-id>start</task-id>
>>>> <task-result>FAILED</task-result>
>>>> <message-type>ERROR</message-type>
>>>> </task-result-details>
>>>> </frmwk-task-result-details>
>>>> </frmwk-task-result>
>>>> <component-task-result
>>>> xmlns="http://java.sun.com/xml/ns/jbi/management-message">
>>>>        <component-name>servicemix-vfs</component-name>
>>>>        <component-task-result-details>
>>>>                <task-result-details>
>>>>                        <task-id>start</task-id>
>>>>                        <task-result>FAILED</task-result>
>>>>                        <message-type>ERROR</message-type>
>>>>                        <task-status-msg>
>>>> <msg-loc-info>
>>>> <loc-token/>
>>>> <loc-message>Unable to start service unit</loc-message>
>>>> </msg-loc-info>
>>>> </task-status-msg>
>>>>                        <exception-info>
>>>>                                <nesting-level>1</nesting-level>
>>>>                                <msg-loc-info>
>>>>                                        <loc-token/>
>>>>                                        <loc-message>Failed to
>>>> initialize file system manager:
>>>> org.apache.commons.vfs.FileSystemException: Could not r
>>>> eplicate "file:///tmp/import/somefile.zip" as it does not exist.</loc-message>
>>>>
>>>> <stack-trace><![CDATA[java.io.IOException: Failed to initialize file
>>>> system manager: org.apache.commons.vfs.Fi
>>>> leSystemException: Could not replicate
>>>> "file:///tmp/import/somefile.zip" as it does not exist.
>>>>        at org.apache.servicemix.vfs.FileObjectResolver.resolveToFileObject(FileObjectResolver.java:66)
>>>>        at org.apache.servicemix.vfs.VFSPollingEndpoint.start(VFSPollingEndpoint.java:119)
>>>>        at org.apache.servicemix.common.DefaultServiceUnit.start(DefaultServiceUnit.java:78)
>>>>        at org.apache.servicemix.common.BaseServiceUnitManager.start(BaseServiceUnitManager.java:155)
>>>>        at org.apache.servicemix.jbi.framework.ServiceUnitLifeCycle.start(ServiceUnitLifeCycle.java:103)
>>>>        at org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.start(ServiceAssemblyLifeCycle.java:154)
>>>>        at org.apache.servicemix.jbi.framework.DeploymentService.start(DeploymentService.java:390)
>>>>        at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:351)
>>>>        at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:255)
>>>>        at org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:658)
>>>>        at org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:63)
>>>>        at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:622)
>>>>        at java.util.TimerThread.mainLoop(Timer.java:512)
>>>>        at java.util.TimerThread.run(Timer.java:462)
>>>> ]]></stack-trace>
>>>>
>>>>
>>>>
>>>> Any help truly appreciated. :)
>>>>
>>>>
>>>> Cheers,
>>>> - Jussi -
>>>>
>>>
>>>
>>>
>>> --
>>> http://lhein.blogspot.com
>>>
>>
>
>
>
> --
> http://lhein.blogspot.com
>

Re: VFS zip file problems

Posted by Lars Heinemann <lh...@apache.org>.
I think the problem is that you poll a single file out of a zip.
Have to check this again by time.

Lars



2009/10/1 Jussi Nummelin <ju...@gmail.com>:
> Hi,
>
> I build the 2009.02 version and tried the same use case. Now I get
> exception every 5 seconds (seems to be the default polling cycle)
>
> 17:29:58,068 | DEBUG | pool-component.servicemix-vfs-thread-14 |
> VFSPollingEndpoint       | vicemix.vfs.VFSPollingEndpoint  231 |
> Unable to resolve path: zip:file://c:/temp/inbox/poju.zip!/log/PM.xml
> java.io.IOException: Failed to create folder:
> org.apache.commons.vfs.FileSystemException: Could not create folder
> "zip:file:///c:/temp/inbox/poju.zip!/log/PM.xml" because it already
> exists and is a file.
>        at org.apache.servicemix.vfs.FileObjectResolver.resolveToFileObject(FileObjectResolver.java:62)
>        at org.apache.servicemix.vfs.VFSPollingEndpoint.poll(VFSPollingEndpoint.java:229)
>        at org.apache.servicemix.common.endpoints.PollingEndpoint$PollSchedulerTask$1.run(PollingEndpoint.java:202)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>        at java.lang.Thread.run(Thread.java:619)
>
> This seems to be because VFS component tries to create a folder
> instead of file. I changed this to create a file instead of folder and
> recompiled the code. After this change I can get the file contents
> passed into bus but deleting the file fails:
> org.apache.commons.vfs.FileSystemException: Could not delete
> "zip:file:///c:/temp/inbox/poju.zip!/log/PM.xml".
>        at org.apache.commons.vfs.provider.AbstractFileObject.deleteSelf(AbstractFileObject.java:709)
>        at org.apache.commons.vfs.provider.AbstractFileObject.delete(AbstractFileObject.java:761)
>        at org.apache.commons.vfs.provider.AbstractFileObject.delete(AbstractFileObject.java:724)
>        at org.apache.servicemix.vfs.VFSPollingEndpoint.process(VFSPollingEndpoint.java:170)
>        at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
>        at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:598)
>        at org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)
>        at org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>        at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)
>        at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>        at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>        at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>        at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.commons.vfs.FileSystemException: This file type
> does not support delete.
>        at org.apache.commons.vfs.provider.AbstractFileObject.doDelete(AbstractFileObject.java:190)
>        at org.apache.commons.vfs.provider.AbstractFileObject.deleteSelf(AbstractFileObject.java:698)
>
>
> The desired/expected behavior is to delete the whole zip file. Any
> ideas how to make this possible?
>
> Another oddity is that the output file (I'm using simple file "bridge"
> in my tests currently) name is exactly the same as the input file.
> This doesn't make sense to me since the normal file:sender endpoint is
> as follows:
> <file:sender service="test:receiver"
>               endpoint="endpoint"
>               directory="c:\Temp\outbox"
>                           overwrite="true"
>                           tempFilePrefix="pm_log-"
>                           tempFileSuffix=".xml">
>
>
>
> Cheers,
> - Jussi -
>
>
>
>
>
> On Tue, Sep 29, 2009 at 3:10 PM, Lars Heinemann <lh...@apache.org> wrote:
>> The snapshots are built periodically. I would suggest building those
>> from trunk because it's faster ;)
>>
>> Lars
>>
>>
>> 2009/9/29 Jussi Nummelin <ju...@gmail.com>:
>>> Hi Lars,
>>>
>>> Thanks for checking this so rapidly. I will check the fix asap.
>>>
>>> Are these packages in any maven repo, or should I build them locally from trunk?
>>>
>>>
>>> Cheers,
>>> - Jussi -
>>>
>>> On Tue, Sep 29, 2009 at 2:42 PM, Lars Heinemann <lh...@apache.org> wrote:
>>>> Jussin,
>>>>
>>>> seems you discovered a bug. I fixed it in the trunk
>>>> (2009.02-SNAPSHOT). You will probably need Servicemix-utils
>>>> 2009.02-SNAPSHOT and Servicemix-common 2009.02-SNAPSHOT as well to get
>>>> it running.
>>>>
>>>> Could you retry with that version?
>>>>
>>>> Regards
>>>> Lars
>>>>
>>>>
>>>>
>>>> 2009/9/28 Jussi Nummelin <ju...@gmail.com>:
>>>>> Hi all,
>>>>>
>>>>> We're trying to develop something on top of VFS component. The use
>>>>> case is following:
>>>>>
>>>>> An external service uploads a zip file into pre-defined directory.
>>>>> That zip file contains multiple files from which only one is of
>>>>> interest for us. So this file should be passed to the bus by VFS
>>>>> component.
>>>>>
>>>>> We tried this with following SU xbean:
>>>>> <vfs:poller service="test:file_poller"
>>>>>               endpoint="endpoint"
>>>>>               targetService="test:file_sender"
>>>>>               path="zip:file:///tmp/import/somefile.zip!/log/log.xml">
>>>>>
>>>>>  </vfs:poller>
>>>>>
>>>>> According to the VFS pages the file URL should be fine.
>>>>> http://commons.apache.org/vfs/filesystems.html
>>>>>
>>>>>
>>>>> With this we get following exception:
>>>>>
>>>>> INFO  - ServiceUnitLifeCycle           - Starting service unit: vfs-poller
>>>>> INFO  - DeploymentService              - Error in start
>>>>> java.lang.Exception: <?xml version="1.0" encoding="UTF-8"?>
>>>>> <jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message"
>>>>> version="1.0">
>>>>> <jbi-task-result>
>>>>> <frmwk-task-result>
>>>>> <frmwk-task-result-details>
>>>>> <task-result-details>
>>>>> <task-id>start</task-id>
>>>>> <task-result>FAILED</task-result>
>>>>> <message-type>ERROR</message-type>
>>>>> </task-result-details>
>>>>> </frmwk-task-result-details>
>>>>> </frmwk-task-result>
>>>>> <component-task-result
>>>>> xmlns="http://java.sun.com/xml/ns/jbi/management-message">
>>>>>        <component-name>servicemix-vfs</component-name>
>>>>>        <component-task-result-details>
>>>>>                <task-result-details>
>>>>>                        <task-id>start</task-id>
>>>>>                        <task-result>FAILED</task-result>
>>>>>                        <message-type>ERROR</message-type>
>>>>>                        <task-status-msg>
>>>>> <msg-loc-info>
>>>>> <loc-token/>
>>>>> <loc-message>Unable to start service unit</loc-message>
>>>>> </msg-loc-info>
>>>>> </task-status-msg>
>>>>>                        <exception-info>
>>>>>                                <nesting-level>1</nesting-level>
>>>>>                                <msg-loc-info>
>>>>>                                        <loc-token/>
>>>>>                                        <loc-message>Failed to
>>>>> initialize file system manager:
>>>>> org.apache.commons.vfs.FileSystemException: Could not r
>>>>> eplicate "file:///tmp/import/somefile.zip" as it does not exist.</loc-message>
>>>>>
>>>>> <stack-trace><![CDATA[java.io.IOException: Failed to initialize file
>>>>> system manager: org.apache.commons.vfs.Fi
>>>>> leSystemException: Could not replicate
>>>>> "file:///tmp/import/somefile.zip" as it does not exist.
>>>>>        at org.apache.servicemix.vfs.FileObjectResolver.resolveToFileObject(FileObjectResolver.java:66)
>>>>>        at org.apache.servicemix.vfs.VFSPollingEndpoint.start(VFSPollingEndpoint.java:119)
>>>>>        at org.apache.servicemix.common.DefaultServiceUnit.start(DefaultServiceUnit.java:78)
>>>>>        at org.apache.servicemix.common.BaseServiceUnitManager.start(BaseServiceUnitManager.java:155)
>>>>>        at org.apache.servicemix.jbi.framework.ServiceUnitLifeCycle.start(ServiceUnitLifeCycle.java:103)
>>>>>        at org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.start(ServiceAssemblyLifeCycle.java:154)
>>>>>        at org.apache.servicemix.jbi.framework.DeploymentService.start(DeploymentService.java:390)
>>>>>        at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:351)
>>>>>        at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:255)
>>>>>        at org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:658)
>>>>>        at org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:63)
>>>>>        at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:622)
>>>>>        at java.util.TimerThread.mainLoop(Timer.java:512)
>>>>>        at java.util.TimerThread.run(Timer.java:462)
>>>>> ]]></stack-trace>
>>>>>
>>>>>
>>>>>
>>>>> Any help truly appreciated. :)
>>>>>
>>>>>
>>>>> Cheers,
>>>>> - Jussi -
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> http://lhein.blogspot.com
>>>>
>>>
>>
>>
>>
>> --
>> http://lhein.blogspot.com
>>
>



-- 
http://lhein.blogspot.com