IO流异常:Stream closed

news/2024/7/6 5:57:19

tags: 解决错误


今天在做SSH项目的时候,出现了这个错误。百思不得其解,网上的答案都不能解决我的问题.....

后来,一气之下就重新写,写了之后发现在JSP遍历集合的时候出错了


        <s:iterator value="rolePrivilegeSet">
           <s:property value="#privilegeMap[compositeKey.code]"/>
        </s:iterator>
复制代码

最后发现是Hibernate懒加载的问题,在配置文件中设置不懒加载,就解决掉这个问题了。


Struts Problem Report

Struts has detected an unhandled exception:

Messages:	
Stream closed
File:	org/apache/jasper/runtime/JspWriterImpl.java
Line number:	210
Stacktraces

java.io.IOException: Stream closed
    org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:210)
    org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:115)
    org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:177)
    org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:915)
    org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:656)
    org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:132)
    org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:188)
    com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:369)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:273)
    org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
    org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564)
    org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81)
    org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
    org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:161)
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:550)
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:380)
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
    org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    java.lang.Thread.run(Thread.java:722)
    
复制代码

二次更新: 我把getContextMap()换成是getApplicatoin(),也会出现这样的错误....


ActionContext.getContext().getContextMap().put("privilegeMap", Constant.PRIVILEGE_MAP);


复制代码

留意域对象有没有错误!

如果您觉得这篇文章帮助到了您,可以给作者一点鼓励


http://www.niftyadmin.cn/n/4252445.html

相关文章

ubuntu16 黑主题_Ubuntu16.04更换漂亮绚丽flatabulous主题

Ubuntu16.04更换漂亮绚丽flatabulous主题更新sudo apt-get updatesudo apt-get upgrade安装unity-tweak-toolsudo apt-get install unity-tweak-tool安装 Flatabulous 主题sudo add-apt-repository ppa:noobslab/themessudo apt-get updatesudo apt-get install flatabulous-th…

python爬虫编辑软件_Python:爬虫和爬最好用的编辑器Pycharm最强使用技巧!

代码排版&#xff0c;自动PEP8pep8 是Python 语言的一个代码编写规范。如若你是新手&#xff0c;目前只想快速掌握基础&#xff0c;而不想过多去注重代码的的编写风格(虽然这很重要)&#xff0c;那你可以尝试一下这个工具 - autopep8首先在全局环境中(不要在虚拟环境中安装)&am…

玩转rocketMQ

下载地址https://github.com/alibaba/RocketMQ 安装环境需要jdk,maven,git http://maven.apache.org/download.html

在Ubuntu Trusty 14.04 (LTS) (64-bit)安装Docker的步骤

Ubuntu Trusty带来的是3.13.0 Linux kernel &#xff0c;需要准备所有ubuntu库的某些条件&#xff0c;docker安装包被称之为docker.io。(注&#xff1a;Ubuntu (和Debian)包含有一些比较旧的同样被称之为docker的KDE3/GNOME2安装包&#xff0c;因此此处的docker安装包被称之为d…

GIT无法自动忽略YellowRV1.1.uvgui.Administrator文件的解决方法

原来这个YellowRV1.1.uvgui.Administrator文件是在.gitignore之前被提交进服务器的&#xff0c;.gitignore对已经存在服务器里的文件是不起作用的。按照回答里投票最高的答案做了一下&#xff0c;问题解决 git rm --cachedYellowRV1.1.uvgui.Administrator git commit -m "…

关于网站文章分类和tag的思考

为什么80%的码农都做不了架构师&#xff1f;>>> 分类是无限分类&#xff0c;即每个分类必须属于一个父分类&#xff0c;最顶级的分类父分类id为0。 一篇文章&#xff0c;应该如何和分类进行关联&#xff1f;传统的做法就是在文章表中有一个category_id字段对应分类…

微软新浏览器Spartan曝光:不会完全取代IE

据国外媒体报道&#xff0c;疑似为微软新浏览器Spartan的第一张照片已经在网上公布了。该应用的一张截图已经被业内著名的爆料媒体BGR网站发布。 据报道&#xff0c;Spartan是微软新研发的浏览器&#xff0c;北京由于Win8中的IE浏览器以桌面版和触屏版发布&#xff0c;而这款新…

[LeetCode] Factorial Trailing Zeroes 阶乘末尾0

Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. Credits:Special thanks to ts for adding this problem and creating all test cases. Hide TagsMath这题应该是2014年年底修改该过测试样本…