[jcifs] SbmSession and webapp performance

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Wed Jul 2 08:54:04 EST 2003

> -----Original Message-----
> From:	Mark Orciuch [SMTP:mark_orciuch at ngsltd.com]
> Sent:	Tuesday, July 01, 2003 4:27 PM
> To:	jcifs at lists.samba.org
> Subject:	[jcifs] SbmSession and webapp performance
> I have implemented a form based NTLM authentication mechanism in my web
> application:
> 	  ...
>         jcifs.Config.setProperty("wins", "");
>         NtlmPasswordAuthentication ntlm = new
> NtlmPasswordAuthentication(ntdomain, username, password);
>         UniAddress dc;
>         try
>         {
>             dc = UniAddress.getByName(ntdomain, true);
>             SmbSession.logon(dc, ntlm);
>             return STATUS_OK;
>         }
>         catch (SmbException sae)
> 	  ...
> This does not make any sense but now my application performs slower after
> the user is authenticated (this is done only once per session).
	Yeah, that doesn't really make any sense. If you're tripping up jCIFS code
	somewhere the best thing to do would be to get an Ethereal packet capture.

>  If I unplug
> the login process, performance is back to normal. Is the SbmSession somehow
> bound to the user session?
	If you use the NtlmHttpFilter it will try to store the
	NtlmPasswordAuthentication object in the HttpSession and use it on the next
	request. This should work with a 2.3 servlet container and is of course quite
	fast. If you cannot use the filter or for whatever reason the
	NtlmPasswordAuthentication object cannot be cached in the user's session,
	it will be noticably slower but very usable.

>  Is there a way to do SbmSession.logoff (I noticed
> that method exists but is declared with package level access)?
	No. Why do you think that would help you?

> I initially started with NTLM HTTP Authentication but that really made my
> app run slow under Tomcat. I thought that form based authentication will do
> the trick. I'm buffled...
	If something doesn't do what you expect it is always a good idea to get an
	Ethereal packet capture. It's standard on Linux boxen. Use a capture filter of
	'port 139 || port 80' etc. Send the capture to me directly.

> BTW: I'm using Tomcat 3.3 and JDK 1.3.1_02.
> Best regards,
> Mark Orciuch - morciuch at apache.org
> Jakarta Jetspeed - Enterprise Portal in Java
> http://jakarta.apache.org/jetspeed/

More information about the jcifs mailing list