[jcifs] Random problems connecting to DFS server

Simon Weatherill simon-samba at weatherill.org
Mon Apr 16 13:53:15 MDT 2012


I've been seeing many errors that have a final stack trace of
jcifs.smb.Dfs.resolve(Dfs.java:169) (jCIFS 1.3.17):

java.lang.NullPointerException
        at jcifs.smb.Dfs.resolve(Dfs.java:169)
        at jcifs.smb.SmbFile.resolveDfs(SmbFile.java:671)
        at jcifs.smb.SmbFile.getDfsPath(SmbFile.java:1536)
        at ListFiles.main(ListFiles.java:45)

I'm using a slightly modified ListFiles.java to test this. I have a list
of 12608 directories, which all exist. If I invoke ListFiles for each
directory separately, it completes fine. If I invoke it once for all
directories, it will fail after reading about 3000 directories. If I add
a test to see if the path exists before calling listFiles(), the problem
goes away. I don't know if it is an issue of timing or whether the
exists() call does something that avoids the problem. Once the problem
starts all remaining  directories have the same problem.

I added a getDfsPath() call (and printed the result) thinking that might
point in a particular direction. When I add this, it fails on the
getDfsPath() before it gets to getFiles().

We're using jCIFS in an RMI server that is always running. We can clear
up the problem by restarting the server, but it comes back.

Any ideas?

Thanks,
Simon


More information about the jCIFS mailing list