[jcifs] 401 and hanging threads after TransportException
Michael B Allen
miallen at ioplex.com
Mon Nov 5 18:17:24 GMT 2007
On Mon, 05 Nov 2007 08:26:56 +0100
Ronald Müller <ronald.mueller at infopark.de> wrote:
> I have a problem with jcifs 1.2.17 and up till now I couldn't find a
> solution in your list. I also tried to use jcifs 1.1.9 and jcifs 1.2.11
> but this didn't make any difference.
> Sometimes my client/application gets a
> jcifs.util.transport.TransportException: Transport29 timedout waiting
> for response to
> at jcifs.util.transport.Transport.sendrecv(Transport.java:76)
> at jcifs.smb.SmbTransport.send(SmbTransport.java:606)
> at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:277)
> at jcifs.smb.SmbSession.send(SmbSession.java:233)
> at jcifs.smb.SmbTree.treeConnect(SmbTree.java:154)
> at jcifs.smb.SmbSession.logon(SmbSession.java:169)
> at jcifs.smb.SmbSession.logon(SmbSession.java:162)
> at jcifs.http.NtlmHttpFilter.negotiate(NtlmHttpFilter.java:182)
> at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:114)
> First of all I've no idea why the client sometimes gets this exception.
> In my logfile I can see that shortly before and shortly after this
> exception my program can authenticate users at the domain controller
> without any problems. And after getting this error it works for hours
> without any problems. So why at just that moment it gets this exception?
> Neither the domain controller nor the server my application is running
> on have a high load at this time. Do you have an advice what to check?
Try increasing the timeout to something very large to eliminate the possiblity that it's a simple network fault.
> The second problem around this exception is the following behaviour: If
> one thread runs into this exception also all other threads - trying to
> get an authentication at the domain controller - hang until the first
> thread reaches the timeout (10 seconds). Ok, as far I learned within the
> last days reading your list this behaviour could be caused because jcifs
> is synchronizing all authentication requests so that if one hangs also
> all other requests hang (waiting for the timeout of the first request).
> Is my assumption correct?
If you're using one specific domain controller then yes. Sounds like the correct behavior to me.
> But more irritating: All of these hanging/waiting threads get an 401 the
> users are seeing in their browsers and they are asked (via basic auth
> promt) to enter login/password. Why even the other threads (not getting
> the exception) get an 401? Can it be that all these threads/requests use
> the same socket and after the first request gets the exception also the
> socket dies? Is there a way to force this threads to use another socket
> so they don't get an 401?
Not sure about the 401 (don't recall well enough how the filter works).
Never heard of a basic auth prompt popping up but if IE cannot authenticate successfully it will pop up the "Network Password" dialog.
Michael B Allen
PHP Active Directory SPNEGO SSO
More information about the jcifs