[jcifs] Exception when trying to connect

Michael B Allen mba2000 at ioplex.com
Fri Apr 21 14:44:38 GMT 2006


On Fri, 21 Apr 2006 08:09:31 -0400
"Mike Mercier" <mmercier at gmail.com> wrote:

> Hello,
> 
> Sorry if this is a repost, but I didn't seem to recieve it from the list the
> first time I tried to send... also it does not appear in the mailing list
> history.
> 
> I am trying to use jcifs for copying files to a smb share and I am running
> into timeout exceptions.  In order to resolve them, I wrote the following
> simple application to just test for available shares.
<snip>
> 
> The client is running windows xp SP2
> 
> The server is running samba v 2.2.12 (RedHat 2.1 ES)
> The server is configured with security = share
> I have one share available with the following configuration in smb.conf
> [TESTSHARE]
>    comment = SDP Share
>    guest ok = yes
>    path = /home/testshare
>    writeable = yes
> 
> 
> >From the client I can run the following command succesfully (with immediate
> responce)
> net view \\192.168.1.10
> I get the results expected
> Share name   Type         Used as  Comment
> 
> -------------------------------------------------------------------------------
> TESTSHARE     Disk                  All groups

net view uses RPC which we don't do. We use the older RAP protocol for
listing shares. Doing smbclient -L would be more comparable. But a timeout
sounds like there's a protocol error somewhere. I suspect it is because
you're using security = share. I don't recall seeing anyone use that in
several years. To get a difinitive answer you would have to get a packet
capture of smbclient -L working and the jcifs ListFiles.java example
failing. Otherwise, I'll add this to TheList for future investigation
(security = share is not a high priority - Samba4 doesn't even support
it IIRC).

> SmbComSessionSetupAndX[command=SMB_COM_SESSION_SETUP_ANDX,received=false,er
> rorCode=0,flags=0x0018,flags2=0x4003,signSeq=0,tid=0,pid=9216,uid=0,mid=2,wordCo
> unt=13,byteCount=0,andxCommand=0x75,andxOffset=61,snd_buf_size=16644,maxMpxCount
> =10,VC_NUMBER=1,sessionKey=0,passwordLength=0,unicodePasswordLength=0,capabiliti
> es=80,accountName=GUEST,primaryDomain=?,NATIVE_OS=Windows

Actually from accountName above it doesn't look like you're successfully
setting credentials either. See the Overview page of the API documentation
for instructions on how to set jcifs properties.

Mike


More information about the jcifs mailing list