Hi

Odd about the logger. It should use the classname as logname

I was wondering the problem is that you dont have any path in the URI
so the list files cant handle (".")

Could you test by setting a subfolder for the FTP, just to see if we
avoid the IndexOutOfBoundsException?

sftp://unix...@127.0.0.1/myfolder?


On Mon, Jan 12, 2009 at 1:22 PM, watcher <patr...@daly.ws> wrote:
>
> I've raised the issue in jira here
> https://issues.apache.org/activemq/browse/CAMEL-1247
>
>  I having a problem turning on trace logging, I created a project using the
> maven camel-archetype-spring.
>  I've update the log4j.properties to
>
> #
> # The logging properties used for eclipse testing, We want to see debug
> output on the console.
> #
> log4j.rootLogger=TRACE, out
>
> # uncomment the following line to turn on Camel debugging
> #log4j.logger.org.apache.camel=DEBUG
> #log4j.logger.com.jcraft.jsch=DEBUG
> #log4j.logger.org.apache.camel.component.file=TRACE
> log4j.logger.org.apache.camel.component=TRACE
>
> # uncomment the following line to turn on ActiveMQ debugging
> #log4j.logger.org.apache.activemq=DEBUG
>
> #log4j.logger.org.springframework=DEBUG
>
>
> # CONSOLE appender not used by default
> log4j.appender.out=org.apache.log4j.ConsoleAppender
> log4j.appender.out.layout=org.apache.log4j.PatternLayout
> log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n
> #log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1}
> - %m%n
>
>
> but I still dont get any TRace logs in my console
>
>
>
> Claus Ibsen-2 wrote:
>>
>> 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/
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/SFTP-%3A-Polling---Cannot-list-directory-tp21413159s22882p21413428.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