我的控制器中有这个方法。Whick 基本上呈现 pdf 文件。
def getUserInvoiceImage (GetInvoiceDataCommand form) {
byte[] pdf = invoiceImageService.getUserInvoiceImage(form.invoiceId)
response.setContentType('application/pdf')
response.outputStream << pdf;
response.outputStream.close()
return false;
}
当我双击它时,它工作正常。但是当我折叠并展开我的面板时,会发生以下异常。
Software caused connection abort: socket write error. Stacktrace follows:
java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at net.bull.javamelody.FilterServletOutputStream.write(FilterServletOutputStream.java:64)
at net.bull.javamelody.CounterResponseStream.write(CounterResponseStream.java:75)
at com.tieto.msi.InvoiceImageController.getUserInvoiceImage(InvoiceImageController.groovy:13)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at net.bull.javamelody.JspWrapper.invoke(JspWrapper.java:151)
at net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:271)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179)
at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:154)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
2013-08-19 12:43:15,636 ERROR KULDARIM org.codehaus.groovy.grails.web.errors.GrailsExceptionResolver: IllegalStateException occurred when processing request: [GET] /MySupplierInvoices/invoiceImage/getUserInvoiceImage - parameters:
invoiceId: 5274216
getOutputStream() has already been called for this response. Stacktrace follows:
org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: getOutputStream() has already been called for this response
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at net.bull.javamelody.JspWrapper.invoke(JspWrapper.java:151)
at net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:271)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179)
at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:154)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.IllegalStateException: getOutputStream() has already been called for this response
at net.bull.javamelody.FilterServletResponseWrapper.getWriter(FilterServletResponseWrapper.java:121)
at C__Dev_MyApps_MySupplierInvoices_grails_app_views_error500_gsp.run(error500.gsp:1)
... 10 more
2013-08-19 12:43:15,639 WARN grails.plugin.cache.web.filter.simple.MemoryPageFragmentCachingFilter: Throwable thrown during doFilter on request with URI: /MySupplierInvoices/grails/invoiceImage/getUserInvoiceImage.dispatch and Query: invoiceId=5274216 : Request processing failed; nested exception is org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: getOutputStream() has already been called for this response
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: getOutputStream() has already been called for this response
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at net.bull.javamelody.JspWrapper.invoke(JspWrapper.java:151)
at net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:271)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179)
at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:154)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: getOutputStream() has already been called for this response
... 10 more
Caused by: java.lang.IllegalStateException: getOutputStream() has already been called for this response
at net.bull.javamelody.FilterServletResponseWrapper.getWriter(FilterServletResponseWrapper.java:121)
at C__Dev_MyApps_MySupplierInvoices_grails_app_views_error500_gsp.run(error500.gsp:1)
... 10 more
2013-08-19 12:43:15,640 ERROR org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/MySupplierInvoices].[grails]: Servlet.service() for servlet grails threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at net.bull.javamelody.FilterServletResponseWrapper.getWriter(FilterServletResponseWrapper.java:121)
at C__Dev_MyApps_MySupplierInvoices_grails_app_views_error500_gsp.run(error500.gsp:1)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at net.bull.javamelody.JspWrapper.invoke(JspWrapper.java:151)
at net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:271)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179)
at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:154)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
2013-08-19 12:43:15,642 ERROR org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/MySupplierInvoices].[default]: Servlet.service() for servlet [default] in context with path [/MySupplierInvoices] threw exception [org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: getOutputStream() has already been called for this response] with root cause
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at net.bull.javamelody.FilterServletResponseWrapper.getWriter(FilterServletResponseWrapper.java:121)
at C__Dev_MyApps_MySupplierInvoices_grails_app_views_error500_gsp.run(error500.gsp:1)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at net.bull.javamelody.JspWrapper.invoke(JspWrapper.java:151)
at net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:271)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179)
at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:154)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
我已经阅读了很多关于这个问题的内容,但没有一个解决方案对我有帮助。所以如果我做错了什么或者我想要达到的这种行为是不可能的,我会有点困惑。