[jcifs] Issues connecting with DFS server

Michael B Allen ioplex at gmail.com
Fri Oct 10 23:32:09 MDT 2014

On Fri, Oct 10, 2014 at 7:50 AM, M. D. <moder at abv.bg> wrote:
>  Hello,
> Another exception in the logs that is randomly occuring after a few successful pollings on the same DFS share:
> Caused by: jcifs.smb.SmbException: The network name cannot be found.
>         at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:566)
>         at jcifs.smb.SmbTransport.send(SmbTransport.java:667)
>         at jcifs.smb.SmbSession.send(SmbSession.java:238)
>         at jcifs.smb.SmbTree.treeConnect(SmbTree.java:176)
>         at jcifs.smb.SmbFile.doConnect(SmbFile.java:911)
>         at jcifs.smb.SmbFile.connect(SmbFile.java:954)
>         at jcifs.smb.SmbFile.connect0(SmbFile.java:880)
>         at jcifs.smb.SmbFile.queryPath(SmbFile.java:1335)
>         at jcifs.smb.SmbFile.exists(SmbFile.java:1417)
> I'm starting to think that these exceptions are occuring due to a high load on the system.
> Although, I have configured soTimeout to be 120sec...

Hi M. D.,

That means the share is missing.

DFS support in JCIFS is not perfect. One issue with DFS in JCIFS is
that if DFS claims a server hosts a DFS volume and the share or file
or directory is actually missing, JCIFS will just quit with the error
you're getting. A Windows client OTOH will retry with the other hosts
until if finds what it's looking for. So this is a bug basically. It's
been on the TODO list for a looooong time. Unfortunately there's no
good work-around. I don't recall if / how JCIFS rotates through the
list of hosts for a DFS volume but simply retrying on this particular
exception might work.

But technically this is (probably) also an invalid DFS config. You
might look at the log to identify the IP and share name and then try
to compel your customer's admins to fix the missing share.

Unfortunately this type of invalid DFS config is quite common. I can
imagine someone rebuilding a machine and then forgetting to rebuild
the share. Actually a more common error condition is probably that the
share is there, but replication is broken. That results in the same
type of error. And because Windows client's can still find the DFS
content (because Windows clients retry with other hosts for that DFS
node) they probably think everything is fine but their DFS is actually


Michael B Allen
Java Active Directory Integration

More information about the jCIFS mailing list