[jcifs] Timeout problem

Nick Newman nnewman at mltech.com
Tue Nov 19 08:50:17 EST 2002


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 = 
         SmbFile f = new SmbFile( url );
         try {
                 // 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

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).

Thanks in advance,

More information about the jcifs mailing list