[jcifs] Problems accessing DFS share

Michael B Allen ioplex at gmail.com
Thu Sep 30 18:42:16 MDT 2010


Hi Johannes,

Your capture shows a GET_DFS_REFERRAL for the name "" which is used to
ask the domain controller for all servers hosting domain based DFS
volumes. However, this query is simply ignored by the server. This
suggests that either no domain-based DFS is setup on the Windows side
or your DNS is mixed up and JCIFS is trying to query a server that is
not a DC or DFS host.

Also, I see you are using NetBIOS names in your paths. That could
cause problems even if you really are still using NetBIOS because the
names can be combined with a DNS search suffix to resolve to something
totally unrelated to NetBIOS. I recommend trying again with a fully
qualified domain name (like supercorp.local) or if you really don't
have domain-based DFS, use a fully qualified DNS hostname (like
fs1supercorp.local). That might yield a different result.

You could send me a capture of Windows successfully accessing the DFS
share. Ultimately we want JCIFS to emulate what Windows is doing so if
Windows is successful, JCIFS should be to. But note that getting this
type of capture can be very tricky to get because DFS referrals are
cached. I'm not sure that trying to access the DFS point immediately
after a reboot would even work. But you could try.

Mike

On Tue, Sep 28, 2010 at 12:19 PM, Michael B Allen <ioplex at gmail.com> wrote:
> 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
>>
>>
>



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


More information about the jCIFS mailing list