admin 发表于 2014-9-24 15:13

缓存error while trying to flush writer 报错解决方法

这个是07年的老问题了、百度基本没有类似的解决方法。
请教!
   本人正用spring2.0+webwork+hibernate3开发
   现在想在原有基础上使用         oscache提高性能,使用中发现问题
例如:
<cache:cache time="60" scope="session">
< s:action id="myAction" namespace="/reuse" name="deptTree" executeResult="false"/>
< /cache:cache>
其中 这个action功能是从数据库读取数据

第一次执行该页的时候 出现异常:
13:25:11,593WARN ActionComponent:122 - Error while trying to flush writer
java.io.IOException: Illegal to flush within a custom tag
at javax.servlet.jsp.tagext.BodyContent.flush(BodyContent.java:79)
at com.opensymphony.webwork.components.ActionComponent.end(ActionComponent.java:120)
at com.opensymphony.webwork.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:21)
at org.apache.jsp.oscacheDemo_jsp._jspx_meth_ww_action_0(org.apache.jsp.oscacheDemo_jsp:232)
at org.apache.jsp.oscacheDemo_jsp._jspx_meth_cache_cache_0(org.apache.jsp.oscacheDemo_jsp:178)
at org.apache.jsp.oscacheDemo_jsp._jspService(org.apache.jsp.oscacheDemo_jsp:95)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
但是数据一样能取出来
在一分钟内 刷新该页面 cache包含的部分不再执行。

其实只需要设置下 flush 属性为false 就ok默认为true
<cache:cache time="60" scope="session" >
< s:action id="myAction" namespace="/reuse" name="deptTree" flush="false" executeResult="false"/>
< /cache:cache>

admin 发表于 2014-9-24 15:20


页: [1]
查看完整版本: 缓存error while trying to flush writer 报错解决方法