The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

daianacheng (3) [Avatar] Offline
#1
Hi there,

I was trying to run the file polling example from chapter 1 with Mule 2.1.1. I had to modify the file-config.xml a bit since it seems some schemas have changed. Now it looks as follows:

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.1" >
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:file="http://www.mulesource.org/schema/mule/file/2.1"
xmlnssmiliesi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.1.xsd
http://www.mulesource.org/schema/mule/core/2.1 http://www.mulesource.org/schema/mule/core/2.1/mule.xsd http://www.mulesource.org/schema/mule/file/2.1 http://www.mulesource.org/schema/mule/file/2.1/mule-file.xsd">

<model name="FileExample">
<service name="FileService">
<inbound>
<file:inbound-endpoint path="inbox" fileAge="500" pollingFrequency="100"></file:inbound-endpoint>
</inbound>
<outbound>
<pass-through-router>
<file:outbound-endpoint path="outbox" outputPattern="output.xml"/>
</pass-through-router>
</outbound>
</service>
</model>
</mule>

I had no problem running this from the command line, but when I tried running it from eclipse I got the following exception after pasting some file in the inbox directory:

[12-03 15:20:23] ERROR FileMessageReceiver [connector.file.0.receiver.10]: File being read disappeared!
java.io.FileNotFoundException: C:mule-workspacemule-book-fileinboxanyfile.txt (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at org.mule.transport.file.ReceiverFileInputStream.<init>(ReceiverFileInputStream.java:35)
at org.mule.transport.file.FileMessageReceiver.processFile(FileMessageReceiver.java:217)
at org.mule.transport.file.FileMessageReceiver.poll(FileMessageReceiver.java:145)
at org.mule.transport.PollingReceiverWorker.run(PollingReceiverWorker.java:47)
at org.mule.work.WorkerContext.run(WorkerContext.java:310)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Thread.java:619)

I guess this might be due to the classpath in my eclipse project. The problem is I don't really understand which jar files I need in my classpath in order to run mule from eclipse. I have included all the jar files in the directories under mule/lib plus some other dependencies from the maven repository (same ones included for the hello example of mule).

Any help would be much appreciated.

Cheers,
Diana.
tijs.rademakers (494) [Avatar] Offline
#2
Re: File Polling example in Mule 2.1.1
Hi Diana,

Maybe there's a problem due to the very short polling interval. Please try to run the example with the fileAge set to 5000 and the pollingFrequency set to 3000. Let me know if you still get the error mesage.

Best regards,

Tijs