[jcifs] Problems when not connected to the network

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Fri Oct 12 10:04:39 EST 2001


> -----Original Message-----
> From:	Kammerloher Josef [SMTP:Josef.Kammerloher at softlab.de]
> 
> But when I use jCifs at home without network connection,
> I have two major problems:
> 
> 1) the QUERY request always times out ( 2 times 15 seconds).
> 
	Hmm, weird. This should be 2 time 3 seconds = 6 seconds.

> I only want to use local NT drives. Is there a way to make QUERY faster ?
> I changed already some retryCounts and Timeout values, the behaviour
> changed,
> but I had no success. Can I fill the query information through the API ?
> 
	What hostname are you using to connect to the local machine? If you use 'localhost' with the default resolveOrder=LMHOSTS,BCAST,DNS jCIFS will broadcast for the name LOCALHOST which is not a
NetBIOS name and therefore it will fail and timeout. The name 'localhost' is technically a DNS thing so the BCAST times out after 6 seconds and try's DNS which works. You have a couple of options. The
_right_ way would be to use the real name of the local machine. Another would be to switch to resolveOrder=LMHOSTS,DNS,BCAST so that DNS is _before_ BCAST. You can also use the hostname that jCIFS
uses as the local hostname. This is normally dynamically generated like JCIFS34_159_A6 but you can set it with the jcifs.netbios.hostname property. I think the second option is probably what you want
but it depends on whether or not you're also connecting to hosts other than the local host.

	See http://auditorymodels.org/jcifs/src/docs/resolver.html for details on name resolution.

> 2) On NT: When I'm not connected to PDC, I can logon as a domain user
> (only a warning comes up).
> 
	A warning? This is a normal operation so warning should not be generated unless something is not quite right (e.g. bad password).

> When I now use jCifs to access a local share (as domain user), I always
> get timeout (obviously the 'logon without PDC' information is not used).
> Is there a way to use jCifs without connection to the PDC ?
> 
	jCIFS doesn't connect to the PDC. The server connects to the PDC on behalf of jCIFS and does third party authentication.

	If the target machine (localhost in this case) does not use the PDC for client authentication, then a domain should simply not be specified. If the target machine does use a PDC for auth then
a correct domain must be specified. Just because the Java VM is running on the local machine does not mean it is not subject to the same security restrictions as other clients. I realize you may want
your product to work regardless of various settings that may be different but if the target requires a domain, one will have to be provided. There's no way around that.

> Thanks a lot,
> 
	You're welcome.

	Mike





More information about the jcifs mailing list