[jcifs] jcifs v 1.2.6 cant connect to samba 2.0.7 again

Michael B Allen mba2000 at ioplex.com
Sat Oct 29 01:36:33 GMT 2005


On Fri, 28 Oct 2005 13:41:20 -0700
Mike Mercier <mmercier at gmail.com> wrote:

> Hi Michael,
> 
> Is this sufficient, or is there something else I should do?
> 
> Added e.printStackTrace() to the catch SmbException
> 
> Here is the stack trace:
> 
> Run #1:
> 
> java.net.SocketTimeoutException: Receive timed out
> at java.net.PlainDatagramSocketImpl.receive0(Native Method)
> at java.net.PlainDatagramSocketImpl.receive(Unknown Source)
> at java.net.DatagramSocket.receive(Unknown Source)
> at jcifs.netbios.NameServiceClient.run(NameServiceClient.java:184)
> at java.lang.Thread.run(Unknown Source)
> Transport1: connect: state=0
> class jcifs.smb.SmbException
> jcifs.smb.SmbException:
> jcifs.util.transport.TransportException: Connection timeout
> at jcifs.util.transport.Transport.connect(Transport.java:175)
> at jcifs.smb.SmbTransport.connect(SmbTransport.java:271)
> at jcifs.smb.SmbTree.treeConnect(SmbTree.java:129)
> at jcifs.smb.SmbFile.connect(SmbFile.java:792)
> at jcifs.smb.SmbFile.connect0(SmbFile.java:762)
> at jcifs.smb.SmbFile.exists(SmbFile.java:1248)
> at cifstest.Main.main(Main.java:34)
> 
> at jcifs.smb.SmbTransport.connect(SmbTransport.java:273)
> at jcifs.smb.SmbTree.treeConnect(SmbTree.java:129)
> at jcifs.smb.SmbFile.connect(SmbFile.java:792)
> at jcifs.smb.SmbFile.connect0(SmbFile.java:762)
> at jcifs.smb.SmbFile.exists(SmbFile.java:1248)
> at cifstest.Main.main(Main.java:34)
> session established ok with xxxxxxxx/xxx.xxx.xxx.xxx
> New data read: Transport1[xxxxxxxx/xxx.xxx.xxx.xxx:139]
> 00000: FF 53 4D 42 72 00 00 00 00 88 01 00 00 00 00 00 | SMBr...........|
> 00010: 00 00 00 00 00 00 00 00 00 00 BD E5 00 00 01 00 |.........._____....|
> 
> Run #2:
> 
> java.net.SocketTimeoutException: Receive timed out
> at java.net.PlainDatagramSocketImpl.receive0(Native Method)
> at java.net.PlainDatagramSocketImpl.receive(Unknown Source)
> at java.net.DatagramSocket.receive(Unknown Source)
> at jcifs.netbios.NameServiceClient.run(NameServiceClient.java:184)
> at java.lang.Thread.run(Unknown Source)
> Transport1: connect: state=0
> class jcifs.smb.SmbException
> jcifs.smb.SmbException:
> jcifs.util.transport.TransportException: Connection timeout
> at jcifs.util.transport.Transport.connect(Transport.java:175)
> at jcifs.smb.SmbTransport.connect(SmbTransport.java:271)
> at jcifs.smb.SmbTree.treeConnect(SmbTree.java:129)
> at jcifs.smb.SmbFile.connect(SmbFile.java:792)
> at jcifs.smb.SmbFile.connect0(SmbFile.java:762)
> at jcifs.smb.SmbFile.exists(SmbFile.java:1248)
> at cifstest.Main.main(Main.java:34)
> 
> at jcifs.smb.SmbTransport.connect(SmbTransport.java:273)
> at jcifs.smb.SmbTree.treeConnect(SmbTree.java:129)
> at jcifs.smb.SmbFile.connect(SmbFile.java:792)
> at jcifs.smb.SmbFile.connect0(SmbFile.java:762)
> at jcifs.smb.SmbFile.exists(SmbFile.java:1248)
> at cifstest.Main.main(Main.java:34)
> session established ok with xxxxxxxx/xxx.xxx.xxx.xxx
> New data read: Transport1[xxxxxxxx/xxx.xxx.xxx.xxx:139]
> 00000: FF 53 4D 42 72 00 00 00 00 88 01 00 00 00 00 00 | SMBr...........|
> 00010: 00 00 00 00 00 00 00 00 00 00 AE BE 00 00 01 00 |..........«___....|
> 
> byteCount=10 but readBytesWireFormat returned 9
> 
> The output will change on different runs, in run 2 it output byteCount=....,
> but it did not in run 1
> 
> This was done with 1.2.6 and samba 2.0.7 but I also see the error on
> 2.2.12on RedHat Enterprise Linux

Looks like connecting to port 445 is timing out but falling back
successfully to port 139. So what exactly is the problem? Does the program
not do what you expect? Could it be that because you have the loglevel
set high, you're getting some exceptions that are confusing you?

To prevent trying and failing to connect to port 445 (do you have a
firewall?), use :139 in your URLs [1].

Otherwise, from what you have shown me and the "session established ok"
and subsequent SMB I can't see anything actually wrong aside from the
port timeout due to being blocked.

Mike

[1] You can also set jcifs.netbios.hostname (see the 1.2.5 release notes).


More information about the jcifs mailing list