[jcifs] Issues getting resources using "smb://" URL

Eric Newman eric at intapp.com
Fri Aug 12 18:19:28 GMT 2005



I am having issues trying to list all of the resources using the "smb:\\"
url.  I am doing something like the following:


SmbFile file = new SmbFile("smb:\\");

SmbFile[] files = null;

try {

    files = file.listFiles();

} catch (SmbAuthException e) {

    System.out.println("Permission denied to " + file.getPath());

} catch (SmbException e) {

     System.out.println("Exception attempting to list files on  " +
file.getPath() + ": " + e.getMessage());            



The strange thing that is happening is that I am getting different results
each time I run the program.  If I have not run the program in a while
(where a while is around 10 minutes), then the program works.


However, if I have recently run the program, I can get one of the following


Permission denied to smb://

Exception attempting to list files on  smb://: 0xC00000CB

Exception attempting to list files on  smb://: Logon failure: the user has
not been granted the requested logon type at this computer.


Also, as long as I specify a workgroup or server, then it seems to work all
of the time (i.e. smb://foo) will always work ok.


I am running the program on linux (although I have also seen strange
behavior running it from a windows as well).


Any ideas why I am seeing different results each time?  Or why it does not
work all of the time?





-------------- next part --------------
HTML attachment scrubbed and removed

More information about the jcifs mailing list