[jcifs] NtlmHttpFilter: Apparent Tomcat conflict with errorCode=401

Florian Kolbe Florian.Kolbe at in-gmbh.de
Wed Jun 15 16:25:48 GMT 2005


Hi,
  my setup is Tomcat-5.0.28/JBoss-3.2.6 with jcifs_1.1.2.

Although NTLM sso works fine, I keep getting the exception below.
My understanding is that the servlet container tries some error page
handling due to the status code 401 which is required for the NTLM
challenge.

I even looked up the Tomcat source
(org.apache.coyote.Response.reset(Response.java:296))
and the part that throws the exception is:

        // Reset the stream
        if (commited) {
            //String msg =
sm.getString("servletOutputStreamImpl.reset.ise"); 
            throw new IllegalStateException();
        }

This page (http://www.jguru.com/faq/view.jsp?EID=501393) states, that
calling flushBuffer() sets the commited flag.

1. Seems like the response is 'commited' in some way, the Tomcat does not
like that?
2. Might resp.flushBuffer() be a problem in NtlmHttpFilter ?
3. What is the purpose of resp.flushBuffer() and can it be omitted ?
4. Is there a way to disable the processing by tomcat ?

Thanks for any help on this issue,
  Florian

2005-06-15 17:12:55,241 ERROR [org.jboss.web.localhost.Engine]
org.apache.catalina.core.StandardHostValve at 104c58e: Exception Processing
ErrorPage[errorCode=401, location=/error.jsp]
java.lang.IllegalStateException
	at org.apache.coyote.Response.reset(Response.java:296)
	at
org.apache.coyote.tomcat5.CoyoteResponse.reset(CoyoteResponse.java:645)
	at
org.apache.coyote.tomcat5.CoyoteResponse.reset(CoyoteResponse.java:911)
	at
org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:389
)
	at
org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:301
)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:147
)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118
)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:102)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
	at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:705)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:683)
	at java.lang.Thread.run(Thread.java:534)



More information about the jcifs mailing list