[jcifs] SmbFile: logon to Workgroup PC share fails

Jean-Marc Autexier jmau2002 at web.de
Wed Dec 16 09:13:19 MST 2009


> I'm trying to access a share on a workgroup PC which is NOT in my domain. The logon fails.
> 
> Sample code:
> 
> NtlmPasswordAuthentication ntlmauth = new NtlmPasswordAuthentication("MYWORKGROUP","MyUser","password");
> SmbFile to1 = new SmbFile( "smb://serverIP/share/filename.txt", ntlmauth);
> System.out.println("Exist: "+to1.exists());
> 
> In exist() I get the following error:
> 
> Exception in thread "main" jcifs.smb.SmbAuthException: Logon failure: unknown user name or bad password.
> 	at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:375)
> 	at jcifs.smb.SmbSession.send(SmbSession.java:217)
> 	at jcifs.smb.SmbTree.treeConnect(SmbTree.java:161)
> 	at jcifs.smb.SmbFile.doConnect(SmbFile.java:899)
> 	at jcifs.smb.SmbFile.connect(SmbFile.java:942)
> 	at jcifs.smb.SmbFile.connect0(SmbFile.java:868)
> 	at jcifs.smb.SmbFile.exists(SmbFile.java:1401)
> 	

Please forget this request, it seems to work now (still I don't know why).

Jean-Marc

______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de



More information about the jCIFS mailing list