[jcifs] Java newbie- trying to access a windows public share

Smith, Mike Mike_Smith at RGCResources.com
Tue Mar 27 13:06:34 GMT 2007


I am confused about the credentials piece   
This is a public share and I don't use a user profile/pwd to access this
directory/file.  
DO I still need to pass credentials.   As I understand it, there are
none for this file.  

Michael Smith
iSeries.mySeries.


-----Original Message-----
From: Eric Glass [mailto:eric.glass at gmail.com] 
Sent: Monday, March 26, 2007 8:16 AM
To: Smith, Mike
Cc: jcifs at lists.samba.org
Subject: Re: [jcifs] Java newbie- trying to access a windows public
share


>         jcifs.Config.setProperty( "wins", "192.168.0.10" );

Here you probably want to do:

jcifs.Config.setProperty("jcifs.netbios.wins", "192.168.0.10");


>                         SmbFileInputStream in = new
>
> SmbFileInputStream("smb//ggc-ad/Public/IS/mike/020707P.txt"
> );
>

This should be "smb://ggc-ad/Public/IS/mike/020707P.txt" (needs a colon
in there).

>
> jcifs.smb.SmbAuthException: Logon failure: account currently disabled.
>
> The account is not disabled, I can get to this file via windows
> explorer easily.


You will need to specify the credentials used to access the file; you
probably want to add something like:

jcifs.Config.setProperty("jcifs.smb.client.domain", "NTDOMAIN");
jcifs.Config.setProperty("jcifs.smb.client.username", "myusername");
jcifs.Config.setProperty("jcifs.smb.client.password", "mypassword");


More information about the jcifs mailing list