[jcifs] jCifs unusable if Win2K laptop is unplugged
teilo at teilo.net
Wed Nov 14 06:16:57 EST 2001
Depending on your network card you may see a option "cable link detect"
in the adapter configuration settings.
If you set this to no you should be ok.
Otherwise when the card is unplugged it detects it and takes it offline.
Kammerloher Josef wrote:
>Hello Mike !
>I threw a little bit more light on the problem and detected a big problem.
>As long as the network is plugged to a Win2000 laptop, everything is okay
>('netstat -a' shows netbios services on ports 137-139,
>'route print' shows the routing table).
>When I unplug the network, after some seconds the netbios services are gone
>and the routing table is empty !
>When plugging again to the network, the netbios services are started again
>the the routing
>table is filled correctly.
>In other words: netbios services are stopped/started automatically.
>As long as the laptop is unplugged, jCifs does not work !
>I found similar problems in the net:
>http://www.smotricz.com/kabutz/Issue028.html (search for 'unplug')
>I searched the Win2000 service who is responsable for this behaviour, but
>(DO not switch off the plug-and-play service !)
>Do you have any idea how to surround this problem ?
>>From: Michael B. Allen [SMTP:mballen at erols.com]
>>Sent: Friday, November 09, 2001 11:39 PM
>>To: Kammerloher Josef
>>Cc: jcifs at samba.org
>>Subject: Re: problem if Win2K laptop is not connected to the network
>>I don't know Josef. Didn't we go over this before? It doesn't look like
>>this is jcifs more than just underlying networking issues. You're
>>getting NoRouteToHostException, NodeStatusRequests going unanswered, and
>>Connection refused all in one trace. It seems like some network services
>>are just off maybe? I think you can get netmon working if you specify
>>the loopback device. You might also mess with the laddr, baddr, hostname
>>properties etc. Try using an IP. These are all things that would
>>eliminate intermediate steps that might be failing in a loopback env.
>>Kammerloher Josef wrote:
>>>Hi Mike !
>>>I have a big problem with one laptop win Win2K installed and not plugged
>>>into the network.
>>>I call the following lines:
>>> jcifs.util.Log.setMask( jcifs.util.Log.ALL );
>>> String smbFileName =
>>> "smb://" + domain + ";" + user + ":" + password
>>> + "@" + server + "/enabler/omsbroker";
>>> SmbFile smbFile = new SmbFile( smbFileName );
>>> SmbFileInputStream is = new SmbFileInputStream( smbFile );
>>>The smbFileName is okay (it works, if connected to the network).
>>>Everything runs fine, if the laptop is connected to the network.
>>>The problem does not occur, when a PC (not a laptop) with the same Win2K
>>>not plugged to the network.
>>>I used the newest jcifs-0.5.1.jar
>>>I tried to get a trace via the MS-network monitor, but local things are
>>>Here is the complete output.
>>>Any ideas ?
>>>Thanks a lot,
>>>Nov 9 11:34:47.129 - name service address cache
>>>Nov 9 11:34:47.169 - nbt name service send:
>>>java.net.NoRouteToHostException: Host unreachable: Datagram send failed
>>> at java.net.PlainDatagramSocketImpl.send(Native Method)
>>> at java.net.DatagramSocket.send(DatagramSocket.java:321)
>>> at jcifs.netbios.NameServiceClient.send(NameServiceClient.java:244)
>>> at jcifs.netbios.NbtAddress.doNameQuery(NbtAddress.java:479)
>>> at jcifs.netbios.NbtAddress.getByName(NbtAddress.java:530)
>>> at jcifs.smb.SmbFile.<init>(SmbFile.java:361)
>>> at jcifs.smb.SmbFile.<init>(SmbFile.java:304)
>>> at enabler.jcifsTest.test(jcifsTest.java:40)
>>> at enabler.jcifsTest.main(jcifsTest.java:58)
>>>Nov 9 11:34:47.529 - name service address cache
>>>Nov 9 11:34:47.589 - nbt name service packet sent
>>>recordClass=0x0000,ttl=0,rDataLength=0] Nov 9 11:34:50.794 - datagram
>>>sent to: TMATTY2/127.0.0.1 00000: 00 03 01 10 00 01 00 00 00 00 00 00 20
>>>4B 41 |............ CKA| 00010: 41 41 41 41 41 41 41 41 41 41 41 41 41
>>>41 41 |AAAAAAAAAAAAAAAA| 00020: 41 41 41 41 41 41 41 41 41 41 41 41 41
>>>00 21 |AAAAAAAAAAAAA..!| 00030: 00 01
>>>|.. | Nov 9 11:34:54.079 - smb open warning
>>>Nov 9 11:34:54.079 - smb negotiation warning requesting negotiation with
>>>Authorization failed: java.net.ConnectException: Connection refused:
>>>connect:::Connection refused: connect
More information about the jcifs