[jcifs] ListFiles example causes jcifs.smb.SmbException: The system cannot find the path specified.

Michael B Allen ioplex at gmail.com
Tue May 27 18:46:14 GMT 2008

On Tue, May 27, 2008 at 2:24 PM, rosed <rosed at lexmark.com> wrote:
> I'm getting the following exception when executing the ListFiles example to a
> domain based DFS share when using jcifs-1.2.20c.jar or jcifs-1.2.19.jar:
> D:\eclipse\workspace\jcifs_1.2.20c\examples>java -classpath
> D:\eclipse\workspace
> \Test\thirdParty\jcifs\jcifs-1.2.20c.jar;. ListFiles smb://administrator
> :les at
> jcifs.smb.SmbException: The system cannot find the path specified.
>        at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:522)
>        at jcifs.smb.SmbTransport.send(SmbTransport.java:599)
>        at jcifs.smb.SmbSession.send(SmbSession.java:239)
>        at jcifs.smb.SmbTree.send(SmbTree.java:109)
>        at jcifs.smb.SmbFile.send(SmbFile.java:718)
>        at jcifs.smb.SmbFile.doFindFirstNext(SmbFile.java:1920)
>        at jcifs.smb.SmbFile.doEnum(SmbFile.java:1672)
>        at jcifs.smb.SmbFile.listFiles(SmbFile.java:1649)
>        at jcifs.smb.SmbFile.listFiles(SmbFile.java:1638)
>        at ListFiles.main(ListFiles.java:21)
> 0 files in 8406ms

Is that a domain based or stand-alone DFS?

If it's domain based, you cannot use an IP address for a hostname.

Previous versions of JCIFS did not correctly implement the full
complement of DFS referrals and used a trial and error search
technique instead. That search technique has been disabled now that we
have the proper DFS referrals in place. But for the DFS referrals to
work, you need to use a proper domain name for the hostname.


Michael B Allen
PHP Active Directory SPNEGO SSO

More information about the jcifs mailing list