Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2006

Tip: Looking for answers? Try searching our database.

getOutputStream() has already been called for this response

Thread view: 
anashri@gmail.com - 17 Dec 2006 18:07 GMT
Hi,

I am getting getOutputStream() has already been called for this
response error in jdk1.4.2 environment.
We have upgraded the sun 6.0 to 6.1, jdk1.4.1 to 1.4.2 and jwsdp1.2 to
1.6. This error is not coming in old environment.

from GUI screen sidebar - servlet is called and from servlet jsp is
included using the requestDispatcher.

>From servlet requestdispatcher is called. Servlet has the
"ServletOutputStream out = res.getOutputStream();"

Is there other way to include the jsp??

servlet code :
P...InfoServlet.java : 366 and before lines ==
ServletOutputStream out = res.getOutputStream(); //at the top of do get
...............................
ServletContext sc;
RequestDispatcher rd;
req.setAttribute("ic", ic);
req.setAttribute("portObj", pobj);
sc = this.getServletContext();
errmsg = URLEncoder.encode(errmsg,"ISO-8859-1");
rd =
sc.getRequestDispatcher("/PortInfoPage.jsp?rc="+rc+"&errmsg="+errmsg);
rd.include(req, res);

_PortInfoPage_jsp.java:792 ==
out.write("\n<TR>\n<TD NOWRAP ALIGN=CENTER VALIGN=MIDDLE
COLSPAN=2>\n\n<TABLE BORDER=0 FRAME=NO_FRAME RULES=ALL_RULES
ALIGN=CENTER WIDTH=\"100%\" NOWRAP>\n<TR>\n<TD NOWRAP ALIGN=RIGHT
VALIGN=MIDDLE COLSPAN=3>\nTo get the current parameter values click
here:\n</TD>\n<TD NOWRAP ALIGN=LEFT ALIGN=MIDDLE>\n<INPUT TYPE =
\"BUTTON\" NAME = \"\" VALUE=\"Refresh\"
onClick=\"refresh()\">\n</TD>\n</TR>\n ");

Here is the stack
[15/Dec/2006:23:36:15] info (12185): CORE3282: stdout: list size=2
[15/Dec/2006:23:36:16] failure (12185): for host 135.210.81.182 trying
to GET /servlet/PortInfoServlet, service-j2ee reports:
ApplicationDispatcher[] WEB2649: Servlet.service() for servlet jsp
threw exception
java.lang.IllegalStateException: WEB3024: getOutputStream() has already
been called for this response
at
org.apache.catalina.connector.ResponseBase.getWriter(ResponseBase.java:880)
at
org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:165)
at
javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:146)
at
org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:184)
at
org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:176)
at
org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:389)
at
org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:401)
at _jsps._PortInfoPage_jsp._jspService(_PortInfoPage_jsp.java:792)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
at
com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:687)
at
com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:459)
at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:375)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:772)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:628)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:539)
at PortInfoServlet.doGet(PortInfoServlet.java:366)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:787)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
at
org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
at
com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:579)
anashri@gmail.com - 18 Dec 2006 16:47 GMT
Issue was compiled jsp was using automatically  getWriter.

Once servlet code used the getWriter, issue resolved.

> Hi,
>
[quoted text clipped - 91 lines]
> com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
> at com.iplanet.ias.web.WebContainer.service(WebContainer.java:579)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.