Hi

Do you mind creating a ticket in JIRA and linking to this thread from,
eg nabble?

I will see what I can do. If you can then you are most welcome to dig
into the camel-ftp codebase in 2.0 and see the bug.
SftpRemoteFileOperations.java:258, is a good place to start

BTW: Have you tried with TRACE logging? Camel will output a lot about
dir paths etc that can help find what is wrong.

You can try from log4j
org.apache.camel.component=TRACE



On Mon, Jan 12, 2009 at 12:59 PM, watcher <patr...@daly.ws> wrote:
>
> Hi
>
> I have set up an Openssh SFTP server as described here
> http://www.xenocafe.com/tutorials/windows/openssh_sftp_server/index.php
>
> However, I'm getting a error when trying to poll the server.
>
> INFO: Connected and logged in to sftp://unix...@127.0.0.1:22
> 12-Jan-2009 11:44:10 org.apache.camel.impl.ScheduledPollConsumer run
> WARNING: An exception occured while polling:
> Endpoint[sftp://unix...@127.0.0.1]: Cannot list directo
> ry:
> org.apache.camel.component.file.remote.RemoteFileOperationFailedException:
> Cannot list directory:
>        at
> org.apache.camel.component.file.remote.SftpRemoteFileOperations.listFiles(SftpRemoteFileO
> perations.java:264)
>        at
> org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:45)
>        at
> org.apache.camel.component.file.remote.RemoteFileConsumer.poll(RemoteFileConsumer.java:65
> )
>        at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:66)
>        at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
>        at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
>        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Scheduled
> ThreadPoolExecutor.java:98)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Schedule
> dThreadPoolExecutor.java:181)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadP
> oolExecutor.java:205)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>        at java.lang.Thread.run(Thread.java:619)
> Caused by: 4:
>        at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1344)
>        at
> org.apache.camel.component.file.remote.SftpRemoteFileOperations.listFiles(SftpRemoteFileO
> perations.java:258)
>        ... 12 more
> Caused by: java.lang.StringIndexOutOfBoundsException: String index out of
> range: 0
>        at java.lang.String.charAt(String.java:687)
>        at
> com.jcraft.jsch.ChannelSftp.remoteAbsolutePath(ChannelSftp.java:2359)
>        at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1176)
>        ... 13 more
> 12-Jan-2009 11:44:19 org.apache.camel.impl.ScheduledPollConsumer run
>
>
> Here's some of my camel-context.xml file
>
>
>         <camelContext xmlns="http://activemq.apache.org/camel/schema/spring";>
>            <package>com.mycompany.router</package>
>            <!-- use myFilter as filter to allow setting ANT paths for which 
> files
> to scan for -->
>            <endpoint id="printerSFTP"
> uri="sftp://unix...@127.0.0.1?password=password&amp;binary=true&amp;expression=done/${file:name}&amp;recursive=true&amp;delay=10000&amp;initialDelay=2000&amp;filter=#myAntFilter&amp;readLock=rename&amp;knownHostsFile=c://known_host"/>
>            <endpoint id="fileRepository" uri="file://c://fileserver"/>
>         </camelContext>
>
>        <!-- we use the AntPathMatcherRemoteFileFilter to use ant paths for
> includes and exlucde -->
>        <bean id="myAntFilter"
> class="org.apache.camel.component.file.remote.AntPathMatcherRemoteFileFilter">
>
>            <property name="includes" value="**/incoming/*"/>
>            <property name="excludes" value="**/outgoing/*"/>
>        </bean>
>
>
> Things I've tried so far.
> I believe I setup the correct premission on the folder
> I running the SFTP locally with the firewall turned off.
> I've tried another SFTP server ( Winsshd ) also
> Upgraded jsch to 0.1.41
>
> Windows xp
> apache camel-2.0-Snapshot
>
> Any ideas on why it can't list the directories?
>
>
>
>
> --
> View this message in context: 
> http://www.nabble.com/SFTP-%3A-Polling---Cannot-list-directory-tp21413159s22882p21413159.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 

/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/

Reply via email to