file:poller -> Could not delete file

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

file:poller -> Could not delete file

Martin Kuhn
HI,

I'm as starter with Servicemix and I've a problem with file:poller (I use SM4)

I want to send a file to a servicemix-bean. The bean get the file but I get an exception

org.apache.servicemix.jbi.runtime.impl.InOnlyImpl@307ae3
java.io.IOException: Could not delete file \mesb\transactions_in\deploy_me-test.xml
        at org.apache.servicemix.file.FilePollerEndpoint.process(FilePollerEndpoint.java:295)
        at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:585)
        at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:558)
        at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchangeInTx(AsyncBaseLifeCycle.java:436)
        at org.apache.servicemix.common.AsyncBaseLifeCycle$2.run(AsyncBaseLifeCycle.java:334)
        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)

Could anybody give me a hint what's wrong.

Here my sources:
<beans xmlns:file="http://servicemix.apache.org/file/1.0"
        xmlns:mesb="urn:mxy:esb:host:transactions">
       
       
        <file:poller service="mesb:hostTransactionsReader"
                endpoint="poller" file="file:/mxy_esb/transactions_in"
                targetService="mesb:hostTransactionsProcessor"
                targetEndpoint="hostTransactionsEndpoint"
                deleteFile="true"
                autoCreateDirectory="true"
                period="20000"
                delay="20000"
               
                />

                 

</beans>

<beans xmlns:bean="http://servicemix.apache.org/bean/1.0"
        xmlns:mesb="urn:mxy:esb:host:transactions">
       
        <bean:endpoint service="mesb:hostTransactionsProcessor"
                endpoint="hostTransactionsEndpoint" bean="#hostTransactionsProcessorBean" />
               
        <bean id="hostTransactionsProcessorBean"
                class="at.mxy.esb.host.transactions.processor.ProcessorBean" />
</beans>


package at.mxy.esb.host.transactions.processor;

import org.apache.servicemix.MessageExchangeListener;

import javax.annotation.Resource;
import javax.jbi.messaging.DeliveryChannel;
import javax.jbi.messaging.ExchangeStatus;
import javax.jbi.messaging.MessageExchange;
import javax.jbi.messaging.MessagingException;

public class ProcessorBean implements MessageExchangeListener {

    @Resource
    private DeliveryChannel channel;

    public void onMessageExchange(MessageExchange exchange) throws MessagingException {
        System.out.println("==>>>>>>>>>>>>>>>>> Received exchange: " + exchange);
       
        exchange.setStatus(ExchangeStatus.DONE);
        channel.send(exchange);
    }

}

TIA
Martin
Reply | Threaded
Open this post in threaded view
|

Re: file:poller -> Could not delete file

Jean-Baptiste Onofré
Hi Martin,

do you have check permission on the file itself ? Is the user that has launched servicemix JVM has the permission to delete the file ?

Regards,
JB

 On Wed 24/09/08 10:06, "Martin Kuhn" [hidden email] wrote:
>
> HI,
>
> I'm as starter with Servicemix and I've a problem with file:poller (I
> use
SM4)
>
> I want to send a file to a servicemix-bean. The bean get the file but I
> get
an exception
>
> org.apache.servicemix.jbi.runtime.impl.InOnlyImpl@307ae3
java.io.IOException: Could not delete file
> \mesb\transactions_in\deploy_me-test.xml
> at
> org.apache.servicemix.file.FilePollerEndpoint.process(FilePollerEndpoint.ja
> va:295)
at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycl
> e.java:585)
at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLi
> feCycle.java:558)
at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchangeInTx(AsyncBa
> seLifeCycle.java:436)
at
> org.apache.servicemix.common.AsyncBaseLifeCycle$2.run(AsyncBaseLifeCycle.ja
> va:334)
at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.j
> ava:885)
at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:
> 907)
at java.lang.Thread.run(Thread.java:619)
>
> Could anybody give me a hint what's wrong.
>
> Here my sources:
> <beans xmlns:file="http://servicemix.apache.org/file/1.0"
xmlns:mesb="urn:mxy:esb:host:transactions">

>
>
> <file:poller service="mesb:hostTransactionsReader"
> endpoint="poller" file="file:/mxy_esb/transactions_in"
> targetService="mesb:hostTransactionsProcessor"
> targetEndpoint="hostTransactionsEndpoint"
> deleteFile="true"
> autoCreateDirectory="true"
> period="20000"
> delay="20000"
>
> />
>
> <!--
> autoCreateDirectory="true"
> archive="file:/mxy_esb/transactions_archive"
> -->
>
> </beans>
>
> <beans xmlns:bean="http://servicemix.apache.org/bean/1.0"
xmlns:mesb="urn:mxy:esb:host:transactions">
>
> <bean:endpoint service="mesb:hostTransactionsProcessor"
> endpoint="hostTransactionsEndpoint"
> bean="#hostTransactionsProcessorBean"
/>

>
> <bean id="hostTransactionsProcessorBean"
> class="at.mxy.esb.host.transactions.processor.ProcessorBean" />
> </beans>
>
>
> package at.mxy.esb.host.transactions.processor;
>
> import org.apache.servicemix.MessageExchangeListener;
>
> import javax.annotation.Resource;
> import javax.jbi.messaging.DeliveryChannel;
> import javax.jbi.messaging.ExchangeStatus;
> import javax.jbi.messaging.MessageExchange;
> import javax.jbi.messaging.MessagingException;
>
> public class ProcessorBean implements MessageExchangeListener {
>
> @Resource
> private DeliveryChannel channel;
>
> public void onMessageExchange(MessageExchange exchange) throws
> MessagingException {
> System.out.println("==>>>>>>>>>>>>>&
> gt;>>> Received exchange: " +
exchange);

>
> exchange.setStatus(ExchangeStatus.DONE);
> channel.send(exchange);
> }
>
> }
>
> TIA
> Martin
> --
> View this message in context: http://www.nabble.com/file%3Apoller--%3E-Could-not-delete-file-
> tp19643952p19643952.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: file:poller -> Could not delete file

Martin Kuhn
Jean-Baptiste Onofré wrote
Hi Martin,

do you have check permission on the file itself ? Is the user that has launched servicemix JVM has the permission to delete the file ?

Regards,
JB
I'm on a windows XP system and the user (me) has administrator privileges. I think this can not be the problem.
Reply | Threaded
Open this post in threaded view
|

Re: file:poller -> Could not delete file

Martin Kuhn
In reply to this post by Martin Kuhn
I use the servicemix distribution from FUSE (fuse-esb-4.0.0.0-preview1) with Windows XP.

After debugging it seems that the file is locked when the file should be deleted (FilePollerEndpoint -> in ServiceMix4 -> line 294)

This seems to be an error :-(
Reply | Threaded
Open this post in threaded view
|

Re: file:poller -> Could not delete file

Edell Nolan
Hi,

Did you attempt to run this twice on the same file. I have seen issues
before where I had a previous error and this was causing the lock on the
file.
Once I cleaned things up and started servicemix again and then put the file
into the directory that was being polled it worked fine.

Edell.

On Wed, Sep 24, 2008 at 10:37 AM, Martin Kuhn <[hidden email]> wrote:

>
> I use the servicemix distribution from FUSE (fuse-esb-4.0.0.0-preview1)
> with
> Windows XP.
>
> After debugging it seems that the file is locked when the file should be
> deleted (FilePollerEndpoint -> in ServiceMix4 -> line 294)
>
> This seems to be an error :-(
> --
> View this message in context:
> http://www.nabble.com/file%3Apoller--%3E-Could-not-delete-file-tp19643952p19645282.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: file:poller -> Could not delete file

Martin Kuhn
Edell Nolan wrote
Hi,

Did you attempt to run this twice on the same file. I have seen issues
before where I had a previous error and this was causing the lock on the
file.
Once I cleaned things up and started servicemix again and then put the file
into the directory that was being polled it worked fine.

Edell.
Hi,
from my point of view it is a problem with locking but only with SM4 (I tried the same example with SM3 successfully with no exception).

I reported an error under https://issues.apache.org/activemq/browse/SMX4-121 

It would be nice to know what's really going on because I'm a really frustrated to spend so much time with such a simple use case :-(((
Reply | Threaded
Open this post in threaded view
|

Re: file:poller -> Could not delete file

gertv
Martin,

Could you try to enable DEBUG logging to see what's going on?  For SMX4,
the servicemix-file component now uses asynchronous messaging.  Perhaps
there's a problem with the locking mechanism we use internally to
determine if a file is already being processed.  If this is the case, we
should be able to see this from the DEBUG log, where the same file gets
tried again before the previous MessageExchange for it has ended.

Regards,

Gert

Martin Kuhn wrote:

> Edell Nolan wrote:
>  
>> Hi,
>>
>> Did you attempt to run this twice on the same file. I have seen issues
>> before where I had a previous error and this was causing the lock on the
>> file.
>> Once I cleaned things up and started servicemix again and then put the
>> file
>> into the directory that was being polled it worked fine.
>>
>> Edell.
>>
>>    
>
> Hi,
> from my point of view it is a problem with locking but only with SM4 (I
> tried the same example with SM3 successfully with no exception).
>
> I reported an error under https://issues.apache.org/activemq/browse/SMX4-121 
>
> It would be nice to know what's really going on because I'm a really
> frustrated to spend so much time with such a simple use case :-(((
>  

Reply | Threaded
Open this post in threaded view
|

Re: file:poller -> Could not delete file

Martin Kuhn
Gert Vanthienen wrote
Martin,

Could you try to enable DEBUG logging to see what's going on?  For SMX4,
the servicemix-file component now uses asynchronous messaging.  Perhaps
there's a problem with the locking mechanism we use internally to
determine if a file is already being processed.  If this is the case, we
should be able to see this from the DEBUG log, where the same file gets
tried again before the previous MessageExchange for it has ended.

Regards,

Gert
Gert,

thank you for responding.
Yes I'll try it with DEBUG logging. Unfortunately I'm not able to do it before monday because I've no access to the infrastructure.

Regards,
Martin


Reply | Threaded
Open this post in threaded view
|

Re: file:poller -> Could not delete file

Martin Kuhn
In reply to this post by gertv
Gert Vanthienen wrote
Martin,

Could you try to enable DEBUG logging to see what's going on?  For SMX4,
the servicemix-file component now uses asynchronous messaging.  Perhaps
there's a problem with the locking mechanism we use internally to
determine if a file is already being processed.  If this is the case, we
should be able to see this from the DEBUG log, where the same file gets
tried again before the previous MessageExchange for it has ended.

Regards,

Gert
Gert,

I executed SMX4 with DEBUG logging. The correspondig log file is in uploaded file ("servicemix.zip").
(Exception on line 980)

Regards,
Martin

servicemix.zip