Results 1 to 13 of 13
- 09-13-2010, 03:50 AM #1
Member
- Join Date
- Sep 2010
- Posts
- 5
- Rep Power
- 0
java.lang.IllegalStateException: OutputStream already retrieved
Hi,
After a series of transactions, I get this error message:
500 Internal Server Error
java.lang.IllegalStateException: OutputStream already retrieved at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.EvermindHttpServletResponse.getWriter (EvermindHttpServletResponse.java:1008) at pckgRefund.servlets.tableMaintenance.userServ.doPo st(userServ.java:1060) at javax.servlet.http.HttpServlet.service(HttpServlet .java:760) at javax.servlet.http.HttpServlet.service(HttpServlet .java:853) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.ResourceFilterChain.doFilter(Resource FilterChain.java:65) at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unkn own Source) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.ServletRequestDispatcher.invoke(Servl etRequestDispatcher.java:673) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.ServletRequestDispatcher.forwardInter nal(ServletRequestDispatcher.java:340) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.HttpRequestHandler.processRequest(Htt pRequestHandler.java:830) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.HttpRequestHandler.run(HttpRequestHan dler.java:285) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.HttpRequestHandler.run(HttpRequestHan dler.java:126) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].util.ReleasableResourcePooledExecutor$MyWorker.ru n(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)
In Oracle JDev, this error message is displayed:
10/09/13 10:37:35 javax.servlet.ServletException
10/09/13 10:37:35 at com.evermind.server.http.EvermindPageContext.handl ePageThrowable(EvermindPageContext.java:595)
10/09/13 10:37:35 at com.evermind.server.http.EvermindPageContext.handl ePageException(EvermindPageContext.java:537)
10/09/13 10:37:35 at _body._table_20_maintenance._user._jspService(user .jsp:1317)
10/09/13 10:37:35 at com.orionserver.http.OrionHttpJspPage.service(Orio nHttpJspPage.java:57)
10/09/13 10:37:35 at oracle.jsp.runtimev2.JspPageTable.service(JspPageT able.java:356)
10/09/13 10:37:35 at oracle.jsp.runtimev2.JspServlet.internalService(Js pServlet.java:498)
10/09/13 10:37:35 at oracle.jsp.runtimev2.JspServlet.service(JspServlet .java:402)
10/09/13 10:37:35 at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
10/09/13 10:37:35 at com.evermind.server.http.ResourceFilterChain.doFil ter(ResourceFilterChain.java:65)
10/09/13 10:37:35 at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unkn own Source)
10/09/13 10:37:35 at com.evermind.server.http.ServletRequestDispatcher. invoke(ServletRequestDispatcher.java:673)
10/09/13 10:37:35 at com.evermind.server.http.ServletRequestDispatcher. forwardInternal(ServletRequestDispatcher.java:340)
10/09/13 10:37:35 at com.evermind.server.http.ServletRequestDispatcher. forward(ServletRequestDispatcher.java:229)
10/09/13 10:37:35 at pckgRefund.servlets.tableMaintenance.userServ.doPo st(userServ.java:1044)
10/09/13 10:37:35 at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
10/09/13 10:37:35 at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
10/09/13 10:37:35 at com.evermind.server.http.ResourceFilterChain.doFil ter(ResourceFilterChain.java:65)
10/09/13 10:37:35 at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unkn own Source)
10/09/13 10:37:35 at com.evermind.server.http.ServletRequestDispatcher. invoke(ServletRequestDispatcher.java:673)
10/09/13 10:37:35 at com.evermind.server.http.ServletRequestDispatcher. forwardInternal(ServletRequestDispatcher.java:340)
10/09/13 10:37:35 at com.evermind.server.http.HttpRequestHandler.proces sRequest(HttpRequestHandler.java:830)
10/09/13 10:37:35 at com.evermind.server.http.HttpRequestHandler.run(Ht tpRequestHandler.java:285)
10/09/13 10:37:35 at com.evermind.server.http.HttpRequestHandler.run(Ht tpRequestHandler.java:126)
10/09/13 10:37:35 at com.evermind.util.ReleasableResourcePooledExecutor $MyWorker.run(ReleasableResourcePooledExecutor.jav a:192)
10/09/13 10:37:35 at java.lang.Thread.run(Thread.java:534)
This is the line where the error occurs in my servlet:
getServletConfig().getServletContext().getRequestD ispatcher("/Body/Table Maintenance/user.jsp").forward(request,response);
My user.jsp page has a lot of out.println statements.
I hope somebody can help me with this.
Thanks in advance!
- 09-13-2010, 10:03 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Looks to me like you've already started writing to the response stream by the time you get to this forward.
- 09-13-2010, 10:23 AM #3
Member
- Join Date
- Sep 2010
- Posts
- 5
- Rep Power
- 0
Thanks Tolls for taking time to answer my query.
How do I know if I'm already writing to the response stream?
My code has always been like this and I never had a problem until recently, after an enhancement.
And this only happens after a series of server-side form validation
- 09-13-2010, 11:02 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Well, you get that error for a start.
That's no joke actually...
Well, that enhancement seems to have resulted in the response being started (or grabbed anyway). You avoid this by handling responses in one place.
You may not even be writing at this point, you (or part of your framework) may simply have done the getResponseStream() call, and not yet sent anything.
- 09-13-2010, 11:06 AM #5
Member
- Join Date
- Sep 2010
- Posts
- 5
- Rep Power
- 0
Does this mean I will not be able to find any solution for my problem? :(
- 09-13-2010, 11:13 AM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Well, you should be able to.
Look at what the enhancement was, and debug around that.
Debug your code...
- 09-13-2010, 11:23 AM #7
Member
- Join Date
- Sep 2010
- Posts
- 5
- Rep Power
- 0
Is there anything I should watch out for? I'm sorry if i sound so ignorant. This error is so new to me :o
- 09-13-2010, 11:31 AM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Something opening an error stream?
Something sending html strings using an output stream?
Another forward prior to this one?
Possibly a redirect (not sure how that would work, to be fair)?
Basically anything which could have started sending stuff back to the browser.
- 09-13-2010, 03:40 PM #9
Just check before or after the below line you have println statements.
getServletConfig().getServletContext().getRequestD ispatcher("/Body/Table Maintenance/user.jsp").forward(request,response);
If yes then try to comment out the print statement and try.Ramya:cool:
- 09-13-2010, 03:47 PM #10
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
I think you need to point out that any println() calls have to be for the response stream, not just any old stream.
- 09-14-2010, 07:42 AM #11
Member
- Join Date
- Sep 2010
- Posts
- 5
- Rep Power
- 0
Thank you, RamyaSivakanth, for taking time to answer :)
Is there a maximum number of out.println allowed? I tried using the old version of the jsp and I did not encounter the error. Then, I tried adding bits and pieces of the enhancement and it seems to work until I have added half of the additional codes. Even a single line of space added would cause the error. I'm really going out of my mind now :eek:
- 09-14-2010, 08:52 AM #12
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
The thing is it isn't getting to the jsp if the root of the exception is from that forward call that you showed earlier.
Either that or whatever you're using gives rubbish exceptions (which is always a possibility).
- 09-17-2010, 12:40 AM #13
Member
- Join Date
- Jun 2010
- Posts
- 5
- Rep Power
- 0
Similar Threads
-
java.lang.NoSuchMethodError: org.apache.log4j.Logger.log(Ljava/lang/String;Lorg/apach
By rameshraj in forum JDBCReplies: 5Last Post: 03-17-2011, 02:26 PM -
GUI with java.lang.IllegalStateException
By eckt in forum AWT / SwingReplies: 4Last Post: 06-14-2010, 10:32 AM -
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException:
By satishkumar_lskin in forum AWT / SwingReplies: 2Last Post: 12-14-2009, 01:46 AM -
java.lang.IllegalStateException: Cannot forward after response has been committed
By saran87 in forum New To JavaReplies: 13Last Post: 09-07-2009, 04:32 PM -
whether this will throw 'InterruptedException' or 'IllegalStateException'
By vysh in forum New To JavaReplies: 2Last Post: 05-28-2009, 05:09 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks