Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Websphere 5, download file throw Outputstream already obtained exception

13 views
Skip to first unread message

AW

unread,
Jun 13, 2003, 12:20:56 AM6/13/03
to
I have a jsp which download a file

FileInputStream fis = new FileInputStream( reportFile );

int bytesRead = 0;
byte byteArray[] = new byte[4096];

while((bytesRead = fis.read(byteArray)) != -1) {
sos.write(byteArray, 0, bytesRead);
}

sos.flush();
sos.close();
//fos.flush();
//fos.close();
fis.close();

The file download okay. But it has an extra message attached to it
"Error 500 Outputstream already obtained"
The file size is bigger than the one on server b/c of that.

I found similar message was post related to this problem for WAS 3.5
or 4 two years ago but there was no solution.

Was it a bug ? Is there anyway to work around it?
The same code tried on 9ias and works fine

Thanks


The full stack trace of the exception found in WAS SystemOut log is as
follow

[6/10/03 20:21:54:395 CST] 355cd42c WebGroup I SRVE0180I:
[afm.war] [/afm_prod] [Servlet.LOG]:
/insufficient_fund/FormMainInF.jsp: init
[6/10/03 20:21:54:453 CST] 44fe1432 WebGroup I SRVE0180I:
[afm.war] [/afm_prod] [Servlet.LOG]:
/insufficient_fund/FormDetailsInF.jsp: init
[6/10/03 20:21:58:021 CST] 355cd42c SystemOut O type =
insufficient_fund
[6/10/03 20:21:58:021 CST] 355cd42c SystemOut O rpt_name =
f0013079.13.tmp
[6/10/03 20:21:58:022 CST] 355cd42c SystemOut O directory3 =
insufficient fund
[6/10/03 20:21:58:022 CST] 355cd42c SystemOut O directory =
/afm01/web/netscape/suitespot/docs/afm_prod/fc/
[6/10/03 20:21:58:022 CST] 355cd42c SystemOut O 1
[6/10/03 20:21:58:022 CST] 355cd42c SystemOut O 2
[6/10/03 20:21:58:022 CST] 355cd42c SystemOut O 3
[6/10/03 20:21:58:023 CST] 355cd42c WebGroup E SRVE0026E:
[Servlet Error]-[OutputStream already obtained]:
java.lang.IllegalStateException: OutputStream already obtained
at com.ibm.ws.webcontainer.srt.SRTServletResponse.getWriter(SRTServletResponse.java(Compiled
Code))
at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java(Inlined
Compiled Code))
at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java(Compiled
Code))
at org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java(Compiled
Code))
at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java(Compiled
Code))
at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java(Inlined
Compiled Code))
at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java(Compiled
Code))
at org.apache.jsp._Download._jspService(_Download.java(Compiled
Code))
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java(Compiled
Code))
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled
Code))
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java(Compiled
Code))
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java(Compiled
Code))
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java(Compiled
Code))
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled
Code))
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled
Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled
Code))
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled
Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined
Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled
Code))
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled
Code))
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined
Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled
Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled
Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled
Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled
Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled
Code))
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled
Code))
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java(Compiled
Code))
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled
Code))
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled
Code))
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled
Code))
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled
Code))
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled
Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)

0 new messages