数据库中的图片读不出来,(急)

水蜜桃 发布于 2011/09/26 14:22
阅读 658
收藏 0

数据库中的列的类型用的是:longblob

总是报这个错误:

ClientAbortException:  java.net.SocketException: Connection reset by peer: socket write error
 at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:319)
 at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:288)
 at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:98)
 at lzh.front.action.ShowUserPhoto.doexcute(ShowUserPhoto.java:57)
 at lzh.core.BackAction.execute(BackAction.java:28)
 at jbg.extend.JbgBaseAction.doAction(JbgBaseAction.java:62)
 at jbg.core.JbgActionServlet.doPost(JbgActionServlet.java:51)
 at jbg.core.JbgActionServlet.doGet(JbgActionServlet.java:73)
 at jbg.core.JbgServlet.doGet(JbgServlet.java:42)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at jbg.core.JbgFilter.doJbgFilter(JbgFilter.java:47)
 at jbg.core.JbgFilter.doFilter(JbgFilter.java:24)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
 at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.SocketException: Connection reset by peer: socket write error
 at java.net.SocketOutputStream.socketWrite0(Native Method)
 at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
 at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
 at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:760)
 at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:432)
 at org.apache.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.java:318)
 at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:985)
 at org.apache.coyote.Response.action(Response.java:183)
 at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:314)
 ... 26 more

以下是问题补充:

@水蜜桃:哪位高手快帮帮忙 (2011/09/26 14:55)
加载中
0
scl33
scl33

貌似你读之前先写入了是吗? 这里报的是写入错误啊! 这个应该还没到读那里, 是别的地方报错了.

另外, 这个和数据库有关的, 如果是oracle, 要加for update, 才能写入流.

返回顶部
顶部