我的Web应用程序使用Weblogic 10.3.6,Javaee 5和LDAP身份验证。
身份验证成功后,我的过滤器尝试执行chain.doFilter(request, response);
并抛出此异常

    ####<Sep 25, 2015 11:34:54 AM BRT> <Error> <HTTP> <viniciusbrito-Vostro-230> <AdminServer> <[ACTIVE] ExecuteThread: '10' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1443191694402> <BEA-101020> <[ServletContext@1836230698[app:frente-loja-web module:frente-loja-web.war path:/frente-loja-web spec-version:2.5]] Servlet failed with Exception
java.lang.IllegalStateException: Cannot resize buffer - 315 bytes have already been written (Servlet 2.3, sec. 5.1)
    at weblogic.servlet.internal.ServletResponseImpl.setBufferSize(ServletResponseImpl.java:357)
    at weblogic.servlet.jsp.PageContextImpl.initialize(PageContextImpl.java:74)
    at weblogic.servlet.jsp.PageContextImpl.<init>(PageContextImpl.java:110)
    at weblogic.servlet.jsp.JspFactoryImpl.getPageContext(JspFactoryImpl.java:40)
    at jsp_servlet.__index._jspService(__index.java:60)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at br.com.pernambucanas.painelnfecomun.web.util.AutenticacaoFilter.doFilter(AutenticacaoFilter.java:48)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
>


但是,我的应用程序可以继续工作。

最佳答案

不知不觉,我无法给您确切的答案。

但最重要的是,在调用setBufferSize之前,正在写入响应缓冲区。您需要确定它是什么并反转逻辑。

只是为了澄清一下,如果您的身份验证代码正在写一些内容作为响应,例如重定向/转发,并且您随后调用chain.doFilter(request,response),则会收到该错误,因为doFilter在已经调用setBufferSize之后写了一些回应。

09-29 22:11