[jcifs] Timeout problem

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Tue Nov 19 11:03:00 EST 2002


> -----Original Message-----
> From:	Nick Newman [SMTP:nnewman at mltech.com]
> Sent:	Monday, November 18, 2002 4:50 PM
> To:	jcifs at lists.samba.org
> Subject:	[jcifs] Timeout problem
> 
> Hi,
> 
> I am using jcifs to implement a simple method for arbitrary code to 
> authenticate users and passwords against an NT domain.  My code is 
> essentially just the following few lines, where "/FooBar" is a non-existent 
> file on the server.
> 
>          String url = 
> "smb://"+domain+";"+username+":"+password+"@"+server+"/FooBar";
>          SmbFile f = new SmbFile( url );
>          try {
>                  f.exists();
>                  // If we get here, the authentication succeeded
>          }
>          catch( SmbAuthException e ){
>                  // authentication failed
>          }
> 
> This seemed to work perfectly.
> 
> However, I eventually found that if I executed the snippet, then waited for 
> a while (using a "sleep") and then executed it again, the first attempt 
> succeeded (authenticated) while the second failed.  The important thing 
> seems to be the following message from the Log system:
> 
> Nov 18 14:31:15.164 - netbios socket closed
> NbtSocket[addr=0.0.0.0<00>/146.137.96.48,port=139,localport=3273]
> 
> If I make the "sleep" short enough that this message does not appear, then 
> all is well.
> 
> Does anyone have a suggestion for how I can work around this problem?
> 
> I am using release 0.7.0b3, and cannot move to the latest release because 
> that apparently requires Java 1.4 which my customer doesn't want to use (yet).
> 
	jcifs-0.7.0b4+ requires Java 1.2 not 1.4.

	Use jcifs-0.6.7. That does not exibit the problem you're seeing. Nor does jcifs-0.7.0b6 from my limited testing. The 0.6 series is what you should be using in production anyway. It should work
just as well for what you're doing.

	Otherwise I don't know off-hand what exactly is causing the problem.




More information about the jcifs mailing list