[jcifs] Problems accessing DFS share

Michael B Allen ioplex at gmail.com
Tue Sep 28 10:19:04 MDT 2010


Hi Johannes,

There are two types of DFS. There is "domain-based DFS" which allows
you to use a path with a domain name. Then there's "stand-alone DFS"
which requires a full hostname but the DFS mapping point can be deep
within the share. And then you can combine the two such as having a
stand-alone DFS mapping point within a domain-based DFS volume. Then
you also have to consider that the domain name can resolve as though
it were a hostname in which case it might look like you're using
domain-base DFS when in reality you're using stand-alone DFS.

Anyway, the moral of this story is that I have no idea what the
problem is and that the only way to really figure out a DFS problem is
to get a network packet capture as described on this page:

  http://jcifs.samba.org/capture.html

and send it to me (not to the list) as an attachment. If you get a
proper capture, I can tell you what the problem is in 5 minutes. Note
that the above page is a bit dated. If you're using Windows, the
easiest way to get a capture is using a program called Netcap.exe
which comes with some resource kit from Microsoft.

Mike

-- 
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/


On Tue, Sep 28, 2010 at 2:18 AM, Johannes Martin
<johannes.martin at itc.deurag.de> wrote:
> Hi,
>
> I've got a problem accessing a DFS share in our network using jcifs.
>
> Here's a sample program to illustrate the problem:
> ---
> import jcifs.smb.SmbFile;
>
> public class TestSmbFile {
>    public static void main(String args[]) throws Exception {
>        SmbFile[] files = new SmbFile(args[0]).listFiles();
>        for (SmbFile file : files) {
>            System.out.println(file.getPath());
>        }
>    }
> }
> ---
>
> In Windows, I can list the available shares by connecting to
>  \\my.domain.name\dfs
>
> java TestSmbFile 'smb://<domain>;<user>:<pass>@my.domain.name/dfs/
> gives me the following exception:
> ---
> Exception in thread "main" jcifs.smb.SmbException: The network name cannot be
> found.
>        at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:545)
>        at jcifs.smb.SmbTransport.send(SmbTransport.java:645)
>        at jcifs.smb.SmbSession.send(SmbSession.java:244)
>        at jcifs.smb.SmbTree.treeConnect(SmbTree.java:176)
>        at jcifs.smb.SmbFile.doConnect(SmbFile.java:906)
>        at jcifs.smb.SmbFile.connect(SmbFile.java:949)
>        at jcifs.smb.SmbFile.connect0(SmbFile.java:875)
>        at jcifs.smb.SmbFile.getType(SmbFile.java:1275)
>        at jcifs.smb.SmbFile.doEnum(SmbFile.java:1726)
>        at jcifs.smb.SmbFile.listFiles(SmbFile.java:1708)
>        at jcifs.smb.SmbFile.listFiles(SmbFile.java:1641)
>        at TestSmbFile.main(TestSmbFile.java:5)
> ---
>
> If I access the file server directly using
> java TestSmbFile 'smb://<domain>;<user>:<pass>@server.my.domain.name/dfs/
> I get the listing I expect.
>
> java TestSmbFile 'smb://<domain>;<user>:<pass>@my.domain.name/
> seems to list only the local shares of whatever server my.domain.name maps to
> (my.domain.name has multiple DNS entries, so I get one of three distinct
> servers), but not "dfs".
>
> Is this a known limitation of jcifs or am I doing something wrong?
>
> Regards
>        Johannes
>
>


More information about the jCIFS mailing list