[jcifs] Operation timed out: connect:could be due to invalid address with jcifs-1.3.3

Michael B Allen ioplex at gmail.com
Tue Jun 16 15:43:26 GMT 2009


On Tue, Jun 16, 2009 at 10:13 AM, jack Chen<ccc_007212 at 163.com> wrote:
>
>
>
> Michael B Allen wrote:
>>
>> On Mon, Jun 15, 2009 at 12:20 PM, jack Chen<ccc_007212 at 163.com> wrote:
>>> I'm running the following example Java class, with jcifs-1.3.2.jar in
>>> the classpath:
>>>  SmbFile file = new
>>> SmbFile("smb://user:123456@192.168.117.201/shar/temp/");
>> <snip>
>>> I get Exception:
>>> jcifs.util.transport.TransportException
>>> java.net.SocketException: Operation timed out: connect:could be due to
>>> invalid address
>>>        at java.net.PlainSocketImpl.socketConnect(Native Method)
>>>        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:336)
>>>        at
>>> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:201)
>>>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:188)
>>>        at java.net.Socket.connect(Socket.java:482)
>>>        at java.net.Socket.connect(Socket.java:432)
>>>        at java.net.Socket.<init>(Socket.java:339)
>>>        at java.net.Socket.<init>(Socket.java:150)
>>>        at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:249)
>>>        at jcifs.smb.SmbTransport.doConnect(SmbTransport.java:306)
>>>        at jcifs.util.transport.Transport.run(Transport.java:240)
>>>        at java.lang.Thread.run(Thread.java:570)
>>
>> This is a low-level socket error that is occurring when JCIFS is
>> simply trying to create a socket. If 1.1.11 worked, then the problem
>> is probably that this "Alx OS" whatever that is is only listening on
>> port 139 and dropping packets on port 445. Normally if a
>> ConnectException or NoRouteToHostException occurs, JCIFS will retry on
>> port 139 but since it's just a SocketException and a timeout there's
>> not much we can do about catching that and retrying.
>>
>> Try setting jcifs.netbios.hostname = WHATEVER. One artefact of setting
>> this property is that it forces the use of port 139. It's a bit of a
>> hack but it should work.
>
> than you Mike . I tried several times according to your method,as if it
> doesn't work!Would you please give me an example of unix .

You have to be more specific than "it doesn't work".

Try the examples/ListFiles.java example like:

$ cat user1.prp
jcifs.smb.client.domain=FOO
jcifs.smb.client.username=user1
jcifs.smb.client.password=pass1
jcifs.util.loglevel=4
jcifs.netbios.hostname=JCIFS139
$ java -Djcifs.properties=user1.prp ListFiles smb://192.168.117.201/shar/temp/

Then post the full output (minus sensitive information).

The server running on AIX probably doesn't support NTLMv2, port 445,
DFS, etc so you have to turn all of that stuff off.

Do you know what the server is on AIX? Is it Samba or something else?

Also, I assume you have tried the same credentials with a Windows
client or smbclient and it works ok?

Mike

-- 
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/


More information about the jcifs mailing list