[jcifs] SmbFile.renameTo on DFS and ssnLimit=1

Michael B Allen mba2000 at ioplex.com
Mon May 15 17:50:27 GMT 2006

On Mon, 15 May 2006 14:37:41 +0200
Torben Wölm <torben.wolm at europe.lego.com> wrote:

> Hi all
> I've run into this problem:
> When renaming a file located on a DFS, I get an exception from line 1778 in SmbFile.java:
>         if( tree != dest.tree ) {
>             throw new SmbException( "Invalid operation for workgroups, servers, or shares" );
>         }
> I know this is caused by setting "jcifs.smb.client.ssnLimit" to "1". I run with this setting, since it is the only way I can get it to work from within an Oracle database (Java 1.3.something).
> My guess is, that there is created a new SmbTree object for each of the SmbFile's in the renameTo call, and that causes (tree != dest.tree) to be true.
> If I comment out the check, the rename works, so maybe there could be an overridden "equals"-method on SmbTree to check if the trees are equivalent instead of identical?
> Sorry that I cannot provide a patch, but I'm not 100% sure of what SmbTree does and why the two trees are compared in the renameTo method. But I hope someone can use this input as a pointer?

Yup. That's probably what's happening. Or something like that. We should
check to see if the source and destination reside on the same tree and
if so, not try to create a new one.

I'll add this to The List.


More information about the jcifs mailing list