Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 37918 invoked from network); 29 Jan 2008 15:49:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Jan 2008 15:49:46 -0000 Received: (qmail 22344 invoked by uid 500); 29 Jan 2008 15:49:33 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 22101 invoked by uid 500); 29 Jan 2008 15:49:32 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 22092 invoked by uid 99); 29 Jan 2008 15:49:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jan 2008 07:49:32 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.233.166.179] (HELO py-out-1112.google.com) (64.233.166.179) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jan 2008 15:49:01 +0000 Received: by py-out-1112.google.com with SMTP id p76so2561334pyb.6 for ; Tue, 29 Jan 2008 07:49:07 -0800 (PST) Received: by 10.35.79.3 with SMTP id g3mr8068039pyl.3.1201621747098; Tue, 29 Jan 2008 07:49:07 -0800 (PST) Received: by 10.35.116.15 with HTTP; Tue, 29 Jan 2008 07:49:07 -0800 (PST) Message-ID: Date: Tue, 29 Jan 2008 10:49:07 -0500 From: "James Carman" Sender: jcarman@carmanconsulting.com To: "Jakarta Commons Users List" Subject: Re: [vfs] Inconsistent Behavior... In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <479F2EDD.1050508@ops.co.at> <479F3426.30102@ops.co.at> <479F3BEF.3060809@ops.co.at> <25aac9fc0801290732l28d69ecev57aaa15edc158420@mail.gmail.com> X-Google-Sender-Auth: cee0097a584e428e X-Virus-Checked: Checked by ClamAV on apache.org Could there be some sort of race condition going on here? I see that there is a thread started by the SoftRefFilesCache (which is what it seems to be using here). On 1/29/08, James Carman wrote: > I compiled it from src into my local repository. I'll see if I can > figure it out via debugging. > > On 1/29/08, sebb wrote: > > Might be an idea to have a look at the code to see what conditions > > cause the Exception to be thrown ... which version of VFS are you > > using? > > > > I had a quick look at 1.0, and there is no Exception at > > AbstractFileObject.java:1149 as far as I can tell. > > > > On 29/01/2008, James Carman wrote: > > > I'm not very well versed with Wireshark and the like. Any pointers o= n > > > what I should look for? > > > > > > On 1/29/08, Mario Ivankovits wrote: > > > > Hi! > > > > > > > > I think your only chance is to use tcpdump and/or wireshark to debu= g the > > > > network flow to see the real answers of the ftp server. > > > > Or debug into the VFS code ... somewhere in doAttach in FtpFileObje= ct > > > > and see whats going wrong in there. > > > > > > > > Sorry! > > > > > > > > Ciao, > > > > Mario > > > > > > > > > Well, I ran it once and it said "The file type is file" and it > > > > > succeeded, but then I ran it again and it says "The file type is > > > > > imaginary" and it failed. Here's the code: > > > > > > > > > > final FileSystemManager fsm =3D VFS.getManager(); > > > > > final FileObject remoteFile =3D > > > > > fsm.resolveFile("ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/ho= mologene.data"); > > > > > System.out.println("The file type is " + > > > > > remoteFile.getType().getName() + "."); > > > > > final File tmp =3D File.createTempFile("download", ".txt"= ); > > > > > tmp.deleteOnExit(); > > > > > final FileObject tempFile =3D fsm.toFileObject(tmp); > > > > > FileUtil.copyContent(remoteFile, tempFile); > > > > > > > > > > Here's the complete output: > > > > > > > > > > 01-29@09:18:11 INFO (DefaultFileReplicator) - Using > > > > > "C:\Users\jcarman\AppData\Local\Temp\vfs_cache" as temporary file= s > > > > > store. > > > > > 01-29@09:18:12 DEBUG (StandardFileSystemManager) - Skipping > > > > > provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider" > > > > > because required class "com.jcraft.jsch.JSch" is not available. > > > > > 01-29@09:18:12 DEBUG (StandardFileSystemManager) - Skipping > > > > > provider "org.apache.commons.vfs.provider.smb.SmbFileProvider" be= cause > > > > > required class "jcifs.smb.SmbFile" is not available. > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache) - putFile: > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache) - putFile: ftp://ftp= .ncbi.nih.gov/ > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache) - putFile: > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache) - putFile: > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache) - putFile: > > > > > ftp://ftp.ncbi.nih.gov/pub > > > > > The file type is imaginary. > > > > > 01-29@09:18:13 DEBUG (SoftRefFilesCache) - putFile: > > > > > file:///C:/Users/jcarman/AppData/Local/Temp/download14482.txt > > > > > Exception in thread "main" org.apache.commons.vfs.FileSystemExcep= tion: > > > > > Could not read from > > > > > "ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data" > > > > > because it is a not a file. > > > > > at org.apache.commons.vfs.provider.AbstractFileObject.getIn= putStream(AbstractFileObject.java:1149) > > > > > at org.apache.commons.vfs.provider.DefaultFileContent.getIn= putStream(DefaultFileContent.java:360) > > > > > at org.apache.commons.vfs.FileUtil.writeContent(FileUtil.ja= va:71) > > > > > at org.apache.commons.vfs.FileUtil.copyContent(FileUtil.jav= a:103) > > > > > > > > > > I left out the project-specific parts of the stack trace because = it's > > > > > not relevant, but there were no nested exceptions. > > > > > > > > > > On 1/29/08, Mario Ivankovits wrote: > > > > > > > > > >> Hi! > > > > >> > > > > >>> Did you get my second email? That's the entire output I got wh= en I ran it. > > > > >>> > > > > >>> > > > > >> Uh, oh, ok! > > > > >> > > > > >> So then, it seems that VFS thinks the file is either a directory= or non > > > > >> existent. > > > > >> > > > > >> Could you please: > > > > >> > > > > >> *) check the filetype of the FileObject see if its virtual or wh= atever > > > > >> *) try to connect to the ftp server using a commandline tool to = see if > > > > >> the ftp output is in a style which makes it impossible for commo= ns-net > > > > >> to parse the output, e.g. due to localized date format. > > > > >> > > > > >> Ciao, > > > > >> Mario > > > > >> > > > > >> > > > > >> ----------------------------------------------------------------= ----- > > > > >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > > > > >> For additional commands, e-mail: user-help@commons.apache.org > > > > >> > > > > >> > > > > >> > > > > > > > > > > -----------------------------------------------------------------= ---- > > > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > > > > > For additional commands, e-mail: user-help@commons.apache.org > > > > > > > > > > > > > > > > > > > > > > -- > > > > mit freundlichen Gr=FC=DFen > > > > > > > > Mario Ivankovits > > > > Software Engineering > > > > > > > > OPS EDV VertriebsgesmbH > > > > A-1120 Wien, Michael-Bernhard-Gasse 10 > > > > > > > > Firmenbuch Nr.: FN51233v, Handelsgericht Wien > > > > Tel.: +43-1-8938810; Fax: +43-1-8938810/3700 > > > > http://www.ops.co.at > > > > > > > > E-Mail: mario@ops.co.at > > > > Skype: mario_ivankovits > > > > > > > > > > > > -------------------------------------------------------------------= -- > > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > > > > For additional commands, e-mail: user-help@commons.apache.org > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > > > For additional commands, e-mail: user-help@commons.apache.org > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > > For additional commands, e-mail: user-help@commons.apache.org > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org