AW: [jcifs] Weird behaviour with NTLMHttpFilter

Stefan Müller stefan.mueller at
Wed Dec 31 16:24:16 GMT 2008


I experienced similar issues at the end of 2007 with jCIFS build 1.2.17. The first user went fine, the second user (different user account, different host) received a 403 HTTP error. After a certain time period (I think it was suspiciously close to the SO_TIMEOUT value I had defined) or when restarting Tomcat (5.5) it started working again for the next "first user" that had been the second one in the initial call.

When implementing the NTLM handshake directly (without the filter class and with the motivation to cover multiple domains without trusts in this effort) I eventually ended up with the "solution" to mod the SmbSession in that way that it forcefully called the disconnect method of the underlying transport as soon as the logoff method was being called. So I gave up the benefit of impersonation but it did work that way. Without the modification the handshake apparently failed at the logon method of the SmbSession class. Unfortunately, I did not backup the exception.


Stefan Müller

ISSP Software und Service GmbH
Eichenweg 6
A-4048 Puchenau/Linz
Mob.: +43 664 39 59 518
Fax.: +43 732 221705-28
Mail: stefan.mueller at
Firmenbuchgericht: LG Linz
Firmenbuchnummer: 218098 h

-----Ursprüngliche Nachricht-----
Von: at [ at] Im Auftrag von Swapnil Patil
Gesendet: Mittwoch, 31. Dezember 2008 16:07
An: jcifs at
Betreff: [jcifs] Weird behaviour with NTLMHttpFilter

I am using NTLMHttpFilter.
Server : Tomcat 5.0. On machine
After starting tomcat if test my application from
in same domain where my apllication is deployed) NTLM works fine.
After this if I test my application from server itself i.e it ask for user name password to connect !
I can login if click url 3 times !.  vice-versa of this is true i.e.
afteer server restart if strat testing from then I
encounter problem at
web.xml is as follows

--- index.jsp
I am getting user name from session.getAttribute("NtlmHttpAuth");. And
then puting that user in request. and then I am submiting page to
I am hiting index.jsp to test my application.
I am newbie in NTLM so this may be as per design behaviour.
Does any know about such behavior ?
Thanks & Regards
Swapnil Patil.

More information about the jcifs mailing list