[ 
https://issues.apache.org/jira/browse/VFS-454?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bernd Eckenfels reopened VFS-454:
---------------------------------

      Assignee: Bernd Eckenfels

Yes, you are right. The lifecycle needs to be docmented a bit better. Without 
looking too deep into the issue my answer is:

- if you use the VFS.getManager() singleton only close it on shutdown
- if you use your own FileSystemManager instances dont use them after close
- close your FSM as soon as you dont need them

I typically direclty instantiate DefaultFileSystemManager (and not use the XML 
config). In your case however I think you can "just" use the createManager(). I 
will check if it makes sense to have a no-argument version of it until then, 
you can use the hardcoded name, it wont change so quickly :) 

> SFTP: first access OK, second access: Unknown scheme "sftp" in URI 
> "sftp://...";
> -------------------------------------------------------------------------------
>
>                 Key: VFS-454
>                 URL: https://issues.apache.org/jira/browse/VFS-454
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Java 1.7.0_13 64 Bit
>            Reporter: MH
>            Assignee: Bernd Eckenfels
>            Priority: Critical
>
> I access files from an SFTP server and accesm them roughly via
> -----------------
> vfs.resolveFile(uri, opts);
> ...
> vfs.resolveFile(cwd, directory);
> ...
> cwd.getChildren();
> ...
> vfs.resolveFile(fn);
> ...
> ((DefaultFileSystemManager) vfs).close();
> --------------------------
> If the same code runs a second time, the first call to resolveFile() throws
>     Unknown scheme "sftp" in URI "sftp://...";
> I tried 
>   vfs.closeFileSystem(children[0].getFileSystem());
> like stated in http://wiki.apache.org/commons/SimpleSftpFileDownload, but 
> this doesn't help!



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to