-------Original Message-------
From: Wade Chandler
Date: 12/15/04 23:00:18
To: Jakarta Commons Users List
Subject: Re: [net] Some FTP servers causing ParserInitializationException.
Shaan wrote:
>
> Hi,
>
> I am new to this forum as well as to this software. I was
> trying my attached code with multiple of FTP servers. I don't know, after
> connecting to some of FTP servers, I receive following exception when i
use
> ftp.listFiles() method.
>
>
>
>
=============================================================================
>
>
> org.apache.commons.net.ftp.parser.ParserInitializationException: Error
> initializing parser
>
> at org.apache.commons.net.ftp.parser
> DefaultFTPFileEntryParserFactory
> createFileEntryParser(DefaultFTPFileEntryParserFactory.java:115)
>
> at org.apache.commons.net.ftp.FTPClient
> initiateListParsing(FTPClient.java:2306)
>
> at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient
> java:2055)
>
> at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient
> java:2106)
>
> at FTPTrial.main(FTPTrial.java:47)
>
> Error :org.apache.commons.net.ftp.parser.ParserInitializationException:
> Error initializing parser
>
>
=============================================================================
>
>
>
>
>
>
> I am attaching my code, its very simple.
>
>
>
> I have noticed one thing, if ftp.getSystemName() method returns "null",
then
> only i receive this error, otherwise my code works fine.
>
>
>
>
>
> Need to have pointer, where I am going wrong.
>
>
>
> Thanks and regards,
>
> Shahnaz Ali.
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
Are you trying to access the same type of ftp servers? It's been a
while since I had to change my code and read the docs, but you should
notice in the documentation a note about the listFiles method and using
globs (I think). It talks about differences between servers. Me, I had
an issue with Windows servers when I tried to use the NT parser. I
changed it to use the unix parser and it worked. Basically it boils
down to the formatting of the list information when you have issues with
that call and you use a glob or an * in your name. Is this what you are
doing?
Wade
>>
===============================
Thanks wade,
Today is my good day. I solved the problem. It
was two mistakes. In my sample code, i had to mentioned username as
anonymous" and for my actual FTP server, in my code in parselist, i had to
mention NTFTPEntryParser explicitly. Probably default was not able to detect
which FTP server it is.
thanks anyway.
Shahnaz Ali.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]