[jcifs] Name caching issue

Tony Thompson Tony.Thompson at stone-ware.com
Wed Mar 11 21:46:03 GMT 2009

I am having a weird name caching issue that I can't figure out how to
resolve.  I am using jcifs 1.2.19 but I have also tried 1.3.4 and still
see the same issue.  I am using jcifs in a java application that I start
once and then leave the JVM running through this whole test (restarting
the JVM fixes the issue which is why I think it is a caching thing).  I
am simply doing this to test the connection:
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(
domain, userName, password );
SmbFile file = new SmbFile( "smb://$", auth );

The machine that I am connecting to is a Windows machine.  The first
time I connect, everything is fine.  If I rename the windows machine and
reboot it, the next time I try the above code, I get an SmbException
with NT_STATUS_INVALID_PARAMETER = 0xC000000d.  A packet trace indicates
that the user ID is invalid (it is not since it worked the first time)
and a renegotiation doesn't happen, just the exception is thrown.
Third and subsequent attempts attempts throw an SmbException with
NT_STATUS_DUPLICATE_NAME = 0xC00000bd.  A packet trace indicates that
the authentication negotiation completed fine this time but the path in
the "Tree Connect" request is using the old machine name.  So, the path
is something like "\\TEST\C$" instead of using the new machine name

I have jcifs.resolveOrder=DNS and my JVM is configured so that the DNS
ttl is set to never cache.  In my test I can use java.net.InetAddress to
resolve to a host name and it always resolves to the new
name after I make the change but jcifs seems to be ignoring that.

Is there some other configuration option that I should be looking at?


More information about the jcifs mailing list