camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Crickenberger" <aaron.crickenber...@intalgent.com>
Subject FileConsumer-to-FtpProducer bug
Date Fri, 10 Aug 2007 16:06:03 GMT
I'm trying to use Camel to poll an incoming directory for files, and 
then FTP them elsewhere.  I started with camel-example-spring, added 
camel-ftp as a dependency, and modified MyRouteBuilder to look like so:

public class MyRouteBuilder extends RouteBuilder {
    public void configure() {
        
from("file:/tmp/test/incoming/").to("ftp://admin@localhost:2021/?password=admin");
    }
}

Putting a file in the "incoming" directory gives the following stack trace:

SEVERE: On delivery attempt: 0 caught: java.lang.ClassCastException: 
org.apache.camel.component.file.remote.RemoteFileExchange
java.lang.ClassCastException: 
org.apache.camel.component.file.remote.RemoteFileExchange
        at 
org.apache.camel.component.file.FileMessage.getExchange(FileMessage.java:47)
        at 
org.apache.camel.component.file.FileMessage.getExchange(FileMessage.java:29)
        at 
org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:48)
        at 
org.apache.camel.component.file.remote.FtpProducer.process(FtpProducer.java:42)
        at 
org.apache.camel.component.file.remote.FtpProducer.process(FtpProducer.java:37)
        at 
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:65)
        at 
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:78)
        at 
org.apache.camel.component.file.FileConsumer.pollFile(FileConsumer.java:81)
        at 
org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:51)
        at 
org.apache.camel.component.file.FileConsumer.poll(FileConsumer.java:45)
        at 
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:63)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
        at 
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
        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:613)

Most of the other Producers appear to work fine with plain ol' 
Exchanges.  I tried modifying FtpProducer to do the same, and things 
started working.  Great!  However, I'm concerned this fixes the symptom, 
and not the underlying problem. 

Neither FtpProducer, SftpProducer nor FileProducer appear to really need 
their specific Exchanges (unit tests still pass anyway.)  However I 
suspect CxfProducer and CxfInvokerProducer might exhibit the "deeper" 
problem if I look further.  Thoughts?

- aaron

Mime
View raw message