[jcifs] Exception when connecting to DFS share

Markus Emmrich marqus_e at web.de
Tue May 5 14:01:24 GMT 2009


Hi, 

I got a problem with a domain-based DFS share connection using JCifs 1.3.7. 
In the application there’re files send to a DFS-Namespace file system (with Active Directory). I actually use JCifs as a kind of URL Builder. 

The code looks that way:
    smbURL = new URL(url + filename);
    URLConnection conn = smbURL.openConnection();
    conn.setDoOutput(true);
    targetStream = conn.getOutputStream();

Up to now I build the URL using a fully qualified servername to get the referral: 
smb://<domain>;<user>:<pwd>@<servername (FQDN, e.g. server.company.com)>/<sharename>/<path>/<filename>

This works very well.
Now I want to replace this path with a domainbased DFS-link to make it more flexible. 
smb://<domain>;<user>:<pwd>@<domain>/<dfslink>/<path>/<filename>

When I run the function with this DFS-link the method getOutputStream() returns a “jcifs.smb.SmbException: The system cannot find the file specified.”  

The stack trace looks like that:

jcifs.smb.SmbException: The system cannot find the file specified.
       jcifs.smb.SmbException: The system cannot find the file specified.
       	at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:542)
       	at jcifs.smb.SmbTransport.send(SmbTransport.java:619)
       	at jcifs.smb.SmbSession.send(SmbSession.java:242)
       	at jcifs.smb.SmbTree.send(SmbTree.java:111)
       	at jcifs.smb.SmbTransport.getDfsReferrals(SmbTransport.java:684)
       	at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:528)
       	at jcifs.smb.SmbTransport.send(SmbTransport.java:644)
       	at jcifs.smb.SmbSession.send(SmbSession.java:242)
       	at jcifs.smb.SmbTree.send(SmbTree.java:111)
       	at jcifs.smb.SmbFile.send(SmbFile.java:729)
       	at jcifs.smb.SmbFile.open0(SmbFile.java:934)
       	at jcifs.smb.SmbFile.open(SmbFile.java:951)
       	at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:142)
       	at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:97)
       	at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:67)
       	at jcifs.smb.SmbFile.getOutputStream(SmbFile.java:2793) 

It seems at first attempt the server sends a PATH_NOT_COVERED errorcode and following by trying the referral a NO_SUCH_DEVICE (0xC000000E) error. 
In Windows Explorer I reach the file system over that DFS-link without any problem. 

The domain controller is Windows. The Fileserver is a NetApp-Filer.

After reviewing a lot of mailings I don’t get any help on it. 
I have no clue why the previous URL works but the new one doesn’t. Where’s the difference in using domainbased link?

Kind regards,
Markus.

__________________________________________________________________________
Verschicken Sie SMS direkt vom Postfach aus - in alle deutschen und viele 
ausländische Netze zum gleichen Preis! 
https://produkte.web.de/webde_sms/sms





More information about the jcifs mailing list