[jcifs] Exception when trying to connect
Mike Mercier
mmercier at gmail.com
Fri Apr 21 12:09:31 GMT 2006
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.
<start code>
package smbsharetest;
import jcifs.smb.SmbFile;
public class Main {
public Main() {
}
public static void main(String[] args) {
try {
SmbFile file = new SmbFile(args[0]);
String[] fileList = file.list();
for (int i = 0; i < fileList.length; i++) {
System.out.println(fileList[i]);
}
} catch (Exception e) {
System.out.println("Got an exception trying to list " + args[0]
+ ":\n" + e);
}
}
}
</end code>
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
When running the java application:
java -jar SmbShareTest.jar smb://192.168.1.10/
I get the following Exception thrown:
Got an exception trying to list smb://192.168.1.10/
jcifs.smb.SmbException:
jcifs.util.transport.TransportException: Transport1 timedout waiting for
respons
e to
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
XP,NATIVE_LANMAN=jCIFS
]
at jcifs.util.transport.Transport.sendrecv(Transport.java:76)
at jcifs.smb.SmbTransport.send(SmbTransport.java:602)
at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:269)
at jcifs.smb.SmbSession.send(SmbSession.java:225)
at jcifs.smb.SmbTree.treeConnect(SmbTree.java:147)
at jcifs.smb.SmbFile.connect(SmbFile.java:791)
at jcifs.smb.SmbFile.connect0(SmbFile.java:761)
at jcifs.smb.SmbFile.send(SmbFile.java:660)
at jcifs.smb.SmbFile.doNetEnum(SmbFile.java:1636)
at jcifs.smb.SmbFile.list(SmbFile.java:1559)
at jcifs.smb.SmbFile.list(SmbFile.java :1453)
at smbsharetest.Main.main(Main.java:20)
If I set the samba with a debuglevel = 5 (it may have been 10?) and check
the log for the jcifs connection, I see the following:
...
[2006/04/19 13:17:46, 3] smbd/process.c:switch_message(684)
switch message SMBsesssetupX (pid 17153)
[2006/04/19 13:17:46, 3] smbd/sec_ctx.c:set_sec_ctx(328)
setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2006/04/19 13:17:46, 5] smbd/uid.c:change_to_root_user(216)
change_to_root_user: now uid=(0,0) gid=(0,0)
[2006/04/19 13:17:46, 3] smbd/reply.c:reply_sesssetup_and_X(879)
Domain=[] NativeOS=[] NativeLanMan=[]
[2006/04/19 13:17:46, 3] smbd/reply.c:reply_sesssetup_and_X(890)
sesssetupX:name=[]
[2006/04/19 13:17:46, 3] smbd/process.c:chain_reply(990)
Chained message
[2006/04/19 13:17:46, 5] lib/util.c:show_msg(272)
size=79
smb_com=0x75
smb_rcls=0
smb_reh=0
smb_err=0
smb_flg=24
smb_flg2=16387
[2006/04/19 13:17:46, 5] lib/util.c:show_msg(280)
smb_tid=0
smb_pid=34079
smb_uid=0
smb_mid=2
smt_wct=4
[2006/04/19 13:17:46, 5] lib/util.c:show_msg(289)
smb_vwv[0]=255 (0xFF)
[2006/04/19 13:17:46, 5] lib/util.c:show_msg(289)
smb_vwv[1]=0 (0x0)
[2006/04/19 13:17:46, 5] lib/util.c:show_msg(289)
smb_vwv[2]=0 (0x0)
[2006/04/19 13:17:46, 5] lib/util.c:show_msg(289)
smb_vwv[3]=1 (0x1)
[2006/04/19 13:17:46, 5] lib/util.c:show_msg(295)
smb_bcc=7
[2006/04/19 13:17:46, 3] smbd/process.c:switch_message(684)
switch message SMBtconX (pid 17153)
[2006/04/19 13:17:46, 3] smbd/sec_ctx.c:set_sec_ctx(328)
setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2006/04/19 13:17:46, 5] smbd/uid.c:change_to_root_user(216)
change_to_root_user: now uid=(0,0) gid=(0,0)
[2006/04/19 13:17:46, 4] smbd/reply.c:reply_tcon_and_X(334)
Got device type
[2006/04/19 13:17:46, 3] smbd/service.c:find_service(140)
checking for home directory ????? gave (NULL)
[2006/04/19 13:17:46, 3] smbd/service.c:find_service(209)
find_service() failed to find service ?????
[2006/04/19 13:17:46, 0] smbd/service.c:make_connection(251)
jcifs129_4_c4 (192.168.1.10) couldn't find service ?????
[2006/04/19 13:17:46, 3] smbd/error.c:error_packet(94)
error string = No such file or directory
[2006/04/19 13:17:46, 3] smbd/error.c:error_packet(109)
error packet at smbd/reply.c(164) cmd=117 (SMBtconX)
NT_STATUS_BAD_NETWORK_NAME
...
When doing the net view command, the Domain= line is filled in with values:
Domain=[?] NativeOS=[Windows 2002 2600 Service Pack 1] NativeLanMan=[Windows
2002 5.1]
sesssetupX:name=[<username I am logged into workstation with>]
I was wondering if anyone can give me some insight into why this error
occurs?
Thanks,
Mike
-------------- next part --------------
HTML attachment scrubbed and removed
More information about the jcifs
mailing list