Results 1 to 14 of 14
  1. #1
    raghu88 is offline Member
    Join Date
    Sep 2012
    Posts
    7
    Rep Power
    0

    Default Cannot forward after response has been committed...jboss 6.1

    Hi to all,

    i want to export some data to an excel file all when downloading the file it gives the following exception ...... after downloading the excel file i am trying to open it is saying like "the file you are trying to open .xls is in a different format than specified by the file extension"but data is not displaying in the file please any one help me how to solve this one..... this error occurs in jboss 6.1 version it is working in jboss 4.2.2 ...


    this is my error log...........

    Servlet.service() for servlet action threw exception: java.lang.IllegalStateException: Cannot forward after response has been committed
    at org.apache.catalina.core.ApplicationDispatcher.doF orward(ApplicationDispatcher.java:417) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationDispatcher.for ward(ApplicationDispatcher.java:407) [:6.1.0.Final]
    at org.apache.struts.action.RequestProcessor.doForwar d(RequestProcessor.java:1063) [:1.2.7]
    at org.apache.struts.action.RequestProcessor.processF orwardConfig(RequestProcessor.java:386) [:1.2.7]
    at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:229) [:1.2.7]
    at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1194) [:1.2.7]
    at org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:432) [:1.2.7]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:754) [:1.0.0.Final]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:847) [:1.0.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:324) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:242) [:6.1.0.Final]
    at com.zyom.security.LoginMonitorFilter.doFilter(Logi nMonitorFilter.java:67) [:]
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:274) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:242) [:6.1.0.Final]
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:275) [:6.1.0.Final]
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:161) [:6.1.0.Final]
    at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:181) [:6.1.0.Final]
    at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
    at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
    at org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:88) [:6.1.0.Final]
    at org.jboss.web.tomcat.security.SecurityContextEstab lishmentValve.invoke(SecurityContextEstablishmentV alve.java:100) [:6.1.0.Final]
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:159) [:6.1.0.Final]
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102) [:6.1.0.Final]
    at org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:158) [:6.1.0.Final]
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109) [:6.1.0.Final]
    at org.jboss.web.tomcat.service.request.ActiveRequest ResponseCacheValve.invoke(ActiveRequestResponseCac heValve.java:53) [:6.1.0.Final]
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:362) [:6.1.0.Final]
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:877) [:6.1.0.Final]
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:654) [:6.1.0.Final]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:951) [:6.1.0.Final]
    at java.lang.Thread.run(Thread.java:619) [:1.6.0_13]

    Code:
    <%@ page import="com.zyom.webclient.util.MozartCostUtils,java.util.*,com.zyom.struts.form.AtsRegionsForm,com.zyom.struts.form.MapCustomerForm,com.zyom.reuse.util.DateHandler,com.zyom.webclient.util.MozartConstants"%>
    <%@ page language="java" pageEncoding="ISO-8859-1"%>
    
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"
    	prefix="bean"%>
     
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-html"
    	prefix="html"%>
    
    
    
    		<title>JSP for UserLoginForm form</title>
    		
    		
    
    
    <script type="text/javascript">
    function filter_region(){
       var region_id=document.getElementById("regid").value;
    
       window.location="regionCustUserMap.do?method=Select&r="+region_id;
       
    }
    function popHelp(fname)
    {
    
    	window.open(fname,"TopAssblyFileformat","width=400,height=250,top=20,left=40,menubar=0,toolbar=0,status=0,location=0,scrollbars=1,resizable=1,dependent=1");
    }
    
    </script>
    	</head>
    	<body>
    	<table>
    		<tr>
    			<td  nowrap="nowrap" class="loggedinlabel"><bean:message key="ats.channeldemand" />&rarr;<bean:message key="ats.customersetup" />&rarr;RegionCustomerUserMap&rarr;</td>
    			</tr>
    			</table>
    	
    	<% if ((MozartCostUtils.isFirefox(request))) 
    	{
    	%>
    		<br>
    		<%} %>	
    		 <%
    		  String finditem="";
    		  
    		  if(request.getAttribute("finditem")!=null)
    		    finditem=request.getAttribute("finditem").toString();
    		 String finditem1="";
    		  
    		  if(request.getAttribute("finditem1")!=null)
    		    finditem1=request.getAttribute("finditem1").toString();
    		 %>
    			<table>
    			
    				<tr>
    					<td nowrap="nowrap"  valign="top" class="loggedinlabel"  >
    						Review Sales Regions, Roles Mapped to Regions (Exec, Cust User, ApAdm), Customer related data&nbsp;&nbsp;&nbsp;&nbsp; <a href="#" onclick="popHelp('ats-form/AtsRegionCustUserMapHelp.jsp')"  title="click to get Help" ONMOUSEOVER="this._tip='click to get Help'" >Help</a>  <br>
    					</td>
    					</tr>
    					<tr><td>&nbsp;</td></tr>
    			</table>
    			<table>
    			<tr>
    			<td nowrap="nowrap" class="loggedinlabel"  valign="bottom" nowrap="nowrap">					
    					<form  method="post" action="regionCustUserMap.do">
    					 <input type="text"  class="loggedin"  value="<%=finditem %>" name="search">  &nbsp;&nbsp;&nbsp;&nbsp;<input type="hidden" name="method"   value="FindCustomer"> <input type="submit"  class="loggedinlabel" title="Find By Customer" value="Find Customer">
    					</form>
    					</td>
    			<td nowrap="nowrap" class="loggedinlabel"  valign="bottom" nowrap="nowrap">					
    					<form  method="post" action="regionCustUserMap.do">
    					 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text"  class="loggedin"  value="<%=finditem1%>" name="search1">  &nbsp;&nbsp;&nbsp;&nbsp;<input type="hidden" name="method"   value="Find"> <input type="submit"  class="loggedinlabel" title="Find By SalesID" value="Find SalesID">
    					</form>
    					</td>
    			</tr></table>
    			<table>
    			<html:form action="regionCustUserMap.do">
    				<tr>
    				<td nowrap="nowrap" class="loggedinlabel" nowrap="nowrap">
    					<bean:message key="gloabl.asof" />
    				</td>
    				<td nowrap="nowrap"  align="left" class="loggedin" nowrap="nowrap">
    					<%=(DateHandler.getDateInSpecifiedFormat(
    							new java.util.Date(),
    							MozartConstants.MOZART_DATE_FORMAT))%>
    				</td>
    				<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
    				<td nowrap="nowrap" class="loggedinlabel" >Select SalesRegion:</td>
    				<td nowrap="nowrap" class="loggedinlabel" nowrap="nowrap">
    		 			 <html:select  styleClass="loggedin"  onchange="filter_region()" styleId="regid" property="regid">
    		 			 <html:option value="0">ALL</html:option>
    					  <html:options collection="regions_list"  property="id"  labelProperty="name"  ></html:options>	 
    					  </html:select>
    					&nbsp;&nbsp;&nbsp;  
    				</td>
    				</tr>
    		</html:form>
    				</table>
    				<%
    	    		String divStyle = "style=\"overflow:auto;height:550;width:1030;\"";
    				String tBodyStyle = "style=\"overflow:auto;overflow-x:hidden;\"";
    				if ((MozartCostUtils.isFirefox(request))) {
    				  
    					divStyle = "style=\"overflow:auto;height:550;width:1030;\"";
    					tBodyStyle = "style=\"overflow:auto;overflow-x:hidden;height:200;\"";
    				}
    			%>
    <hr size="1" width="100%" noshade>
    <table width="100%"   height="10">
    			<tr>
    			 <html:form   action="regionCustUserMapXl.do">
    			 <td>
    								<input alt="Press GO, Then click Export to Excel" name="CVS" class="loggedinlabel"
    									type="image" value="Export Excel" src="http://www.java-forums.org/images/xls.gif"
    									onmouseover="Tip('Press Click Export to Excel')" />		
    		</td>		
    		<td      class="loggedinlabel"	 >
    		 	 
    		</td>
    		</html:form>			 
    			</tr>
    		</table> 
    <html:form action="regionCustUserMap.do">
    <div class="autoHeight" style="width:900px;height:1515px;margin-top:10px; margin-bottom:10px;">
    <table style="margin-top:0px;"  class="tablesorter" border="0" cellpadding="0" cellspacing="1"> <%-- class="tablesorter" --%>
    <thead class="ls">
    												 
    		<th nowrap="nowrap">Sales Region</th>
    		<th width="250">ROLES MAPPED AT REGION LEVEL (ALL EXCEPT SALES ID)</th>
    		<th nowrap="nowrap" >Customer</th>
    		<th nowrap="nowrap" >Country</th>
    		<th nowrap="nowrap" >Sales ID</th>
    		
    	</thead>
    
    	<tbody class="ls1">
    	<%ArrayList cust_list=(ArrayList)request.getAttribute("cust_list"); 
    	for (int i = 0; i < cust_list.size(); i++) {
    	MapCustomerForm mcf=(MapCustomerForm)cust_list.get(i);%>
    	<TR class="<% if(i%2==0){%><%=""%><%}else{%><%="odd"%><%}%>">
    								<td width="148" nowrap="nowrap">
    								<%=mcf.getRegion()%>
    							</td>
    
    							
    
    								<td width="408"  width="40">
    
    							<%=mcf.getUser_names() %>					
    							</td>
    							<td width="188" nowrap="nowrap">
    								<%=mcf.getCustomer()%>
    							</td>
    							<td width="148" nowrap="nowrap">
    								<%=mcf.getLocation()%>
    							</td>
    							<td width="98" nowrap="nowrap">
    								<%=mcf.getSalesid()%>
    							</td>
    	</tr>
    	<%} %>
    	</tbody>
    </table></div>
    
    		</html:form>
    	</body>
    </html>

    ---------------->
    Java Code:
    Action class code-----------.
    
    
    package com.zyom.struts.ats.action;
    
    import java.io.File;
    import java.text.NumberFormat;
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.List;
    
    import javax.servlet.ServletContext;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    
    import jxl.Workbook;
    import jxl.write.Colour;
    import jxl.write.Label;
    import jxl.write.WritableCellFormat;
    import jxl.write.WritableFont;
    import jxl.write.WritableSheet;
    import jxl.write.WritableWorkbook;
    
    
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.actions.DownloadAction;
    import org.apache.struts.actions.DownloadAction.ResourceStreamInfo;
    import org.apache.struts.actions.DownloadAction.StreamInfo;
    
    import com.zyom.reuse.util.DateHandler;
    import com.zyom.struts.form.CmForm;
    import com.zyom.struts.form.DemandFGForm;
    import com.zyom.webclient.util.DBHelper;
    import com.zyom.webclient.util.AtsHelper;
    import com.zyom.webclient.util.DemandSupplyItem;
    import com.zyom.webclient.util.MozartCostUtils;
    import com.zyom.struts.form.MapCustomerForm;
    
    public class RegionCustUserMapXlAction extends DownloadAction {
    
    	protected StreamInfo getStreamInfo(ActionMapping mapping, ActionForm form,
    			HttpServletRequest request, HttpServletResponse response)
    	throws Exception {
    		Date currentDatetime = new Date(System.currentTimeMillis());
    		SimpleDateFormat formatter = new SimpleDateFormat("MM-dd-yyyy-HH-mm");
    
    		String myDate = formatter.format(currentDatetime);
    
    		String myDate1 = formatter.format(currentDatetime);
    		String fileName = "RegCustUsrMap_"+myDate+".xls";
    		String contentType = "application/vnd.ms-excel";
    		ServletContext servletCtx = this.servlet.getServletContext();
    		
    		try{
    
    			String path = servletCtx.getRealPath(fileName);
    			WritableWorkbook workbook = Workbook.createWorkbook(new File(path)); 		
    			HttpSession session = request.getSession(true);
    			List cust_list=new ArrayList();
    			cust_list=(ArrayList)session.getAttribute("cust_list");
    			
    			jxl.write.Number num;
    
    			Calendar stDate = Calendar.getInstance();
    			Calendar endDate = Calendar.getInstance();
    			
    			String temp = "";
    
    			SimpleDateFormat formatter1 = new SimpleDateFormat("MMM-dd,yyyy");	 
    
    			WritableSheet sheet = workbook.createSheet("RegCustUsrMap_"+myDate1, 1); 
    			WritableFont arial10font = new WritableFont(WritableFont.ARIAL, 10);
    			WritableCellFormat arial10format = new WritableCellFormat (arial10font);
    			// sheet.mergeCells(0,0,2,0);
    			WritableFont times16font = new WritableFont(WritableFont.TIMES, 10, WritableFont.BOLD, true);
    			WritableCellFormat times16format = new WritableCellFormat (times16font);
    			times16format.setAlignment(jxl.format.Alignment.CENTRE);
    			// times16format.setBackground(Colour.BLUE);
    			times16format.setBorder(jxl.format.Border.ALL, jxl.format.BorderLineStyle.MEDIUM,Colour.BLACK);
    
    
    
    			WritableFont datafont = new WritableFont(WritableFont.ARIAL , 10);
    			WritableFont datafont1 = new WritableFont(WritableFont.ARIAL , 10);
    			WritableFont datafont2 = new WritableFont(WritableFont.ARIAL , 10);
    
    			datafont1.setColour(Colour.BLUE);
    			datafont2.setColour(Colour.RED);
    			datafont.setColour(Colour.BLACK);
    			WritableCellFormat dataformat = new WritableCellFormat (datafont2);
    			WritableCellFormat dataformatApproved = new WritableCellFormat (datafont);
    			WritableCellFormat dataformatnotApproved = new WritableCellFormat (datafont1);
    			WritableCellFormat dataformatApproved1 = new WritableCellFormat (datafont);
    			dataformat.setAlignment(jxl.format.Alignment.LEFT);
    			dataformatApproved.setAlignment(jxl.format.Alignment.LEFT);
    			dataformatnotApproved.setAlignment(jxl.format.Alignment.LEFT);
    			dataformatApproved.setBackground(jxl.format.Colour.YELLOW);
    			dataformatApproved1.setAlignment(jxl.format.Alignment.LEFT);
    			dataformatApproved1.setBackground(jxl.format.Colour.BRIGHT_GREEN);
    			// times16format.setBackground(Colour.BLUE);
    
    			dataformatApproved.setBorder(jxl.format.Border.ALL , jxl.format.BorderLineStyle.MEDIUM_DASHED ,Colour.BLACK);
    			dataformatApproved1.setBorder(jxl.format.Border.ALL , jxl.format.BorderLineStyle.MEDIUM_DASHED ,Colour.BLACK);
    			
    			Label label = new Label(0, 0, "Region Customer User Map",arial10format);
    			sheet.addCell(label);
    			label=new Label(0,2,"As of: ",arial10format);
    			sheet.addCell(label);
    			label=new Label(1,2,DateHandler.getTodaysDate(),arial10format);
    			sheet.addCell(label);
    				    	
    	        int i=0;
    			int j=3;
    			
    			j++;
    			label = new Label(i, j, "Sales Region" ,times16format);
    			sheet.addCell(label); 	
    			i++;
    			label = new Label(i, j, "ROLES MAPPED AT REGION LEVEL (ALL EXCEPT SALES ID)" ,times16format);
    			sheet.addCell(label); 	
    			i++;
    			label = new Label(i, j, "Customer" ,times16format);
    			sheet.addCell(label); 	
    			i++;
    			label = new Label(i, j, "Country" ,times16format);
    			sheet.addCell(label);
    			i++;
    			label = new Label(i, j, "Sales Id" ,times16format);
    			sheet.addCell(label); 	
    			i++;
    						
    
    			while(endDate.after(stDate)){
    				 
    				label = new Label(i, j, formatter1.format(new java.util.Date(stDate.getTimeInMillis())) ,times16format);
    				sheet.addCell(label);
    				 i++;
    				stDate.add(Calendar.DATE, 7);
    				 }    
    			
    		for (int count = 0; count < cust_list.size(); count++) {
    			MapCustomerForm mapCustomerForm=new MapCustomerForm();
    			mapCustomerForm = (MapCustomerForm) cust_list.get(count);
    				
    				  j++;
    				  
    				  	i=0;
    				  	label = new Label(i, j, mapCustomerForm.getRegion(),arial10format);
    					sheet.addCell(label); 	
    					i++;
    					label = new Label(i, j, mapCustomerForm.getUser_names(),arial10format);
    					sheet.addCell(label); 	
    					i++;
    					label = new Label(i, j,mapCustomerForm.getCustomer(),arial10format);
    					sheet.addCell(label); 	
    					i++;
    					label = new Label(i, j, mapCustomerForm.getLocation(),arial10format);
    					sheet.addCell(label); 	
    					i++;
    					label = new Label(i, j,mapCustomerForm.getSalesid(),arial10format);
    					sheet.addCell(label);
    					i++;
    					
    			}
    					    
    		j=j+2;
    		
    				workbook.write();
    				workbook.close(); 
    
    		}catch(Exception e){
    
    			System.out.print(e);
    		}	
    		 
    response.setContentType("application/vnd.ms-excel");
    		response.setHeader("Content-disposition","attachment;fileName=" + fileName);
    		final java.io.OutputStream os = response.getOutputStream();
    		
    		os.flush();
    				
    		return new ResourceStreamInfo(contentType, servletCtx, fileName);
    		
    	}
    }
    Last edited by raghu88; 09-14-2012 at 02:38 PM. Reason: coding is not clear to understand for the people

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Cannot forward after response has been committed...jboss 6.1

    Please use [code] tags [/code] when posting code.
    That lot is almost unreadable without them.

    Highlight the line of code that the exception is being thrown from as well, so we know where we should be looking.

    That exception is thrown because at some point in your code you have already committed the response. Once you do that you cannot then forward to another JSP/Servlet.

    In fact:
    Java Code:
    final java.io.OutputStream os = response.getOutputStream();
    os.flush();
    Why are you doing that?
    As soon as you call flush() you cannot forward bvecause the flush() call (as per the API for getOutputStream()) commits the response.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    raghu88 is offline Member
    Join Date
    Sep 2012
    Posts
    7
    Rep Power
    0

    Default Re: Cannot forward after response has been committed...jboss 6.1

    Hi Tolls ,
    Thanks for the reply....
    Java Code
    final java.io.OutputStream os = response.getOutputStream();
    os.flush();
    Without this code i got this exception Servlet.service() for servlet jsp threw exception: java.lang.IllegalStateException: getOutputStream() has already been called for this response
    i googled about this issue i found the above code that's why i inserted that code.these type of errors i didn't face when i am using jboss 4.2.2.
    pls help me how to solve this issue?

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Cannot forward after response has been committed...jboss 6.1

    So don't call getOutputStream.
    It's not as if you're using it...

    You cannot start sending stuff back on the response stream and then forward to a JSP (which is what struts will be doing after the Action has finished).
    And the way the response identifies if you;ve started sending things is by marking whether getOutputStream has been called.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    raghu88 is offline Member
    Join Date
    Sep 2012
    Posts
    7
    Rep Power
    0

    Default Re: Cannot forward after response has been committed...jboss 6.1

    pls see my code i am not calling getOutputStream() anywhere [Remove the above code don't think about it].

    i am not clear about this ....change my code and again post

    Thanks alot for your reply.

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Cannot forward after response has been committed...jboss 6.1

    Line 184 in the code in the first post.
    If that code is no longer there then you'll need to give us any new errors/exceptions and where they are being thrown from.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    raghu88 is offline Member
    Join Date
    Sep 2012
    Posts
    7
    Rep Power
    0

    Default Re: Cannot forward after response has been committed...jboss 6.1

    sorry i was edited my post i didn't found the exact line and i think line 184 is showing an import statement .
    dont mind pls tell me where it is exactly?

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Cannot forward after response has been committed...jboss 6.1

    Look up there at the first post!
    Line 184!
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  9. #9
    raghu88 is offline Member
    Join Date
    Sep 2012
    Posts
    7
    Rep Power
    0

    Default Re: Cannot forward after response has been committed...jboss 6.1

    sorry! can't found pls post the code at line 184
    Thanks,
    Raghu.

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Cannot forward after response has been committed...jboss 6.1

    Java Code:
    final java.io.OutputStream os = response.getOutputStream();  // <-- LINE 184
    os.flush();
    This is in your code in the original post.
    Neither line should be there.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  11. #11
    raghu88 is offline Member
    Join Date
    Sep 2012
    Posts
    7
    Rep Power
    0

    Default Re: Cannot forward after response has been committed...jboss 6.1

    i already post the error if you remove the above 2 lines code...i am getting the following exception....

    pls give me the solution its a great help for me.....


    java.lang.IllegalStateException: getOutputStream() has already been called for this response
    at org.apache.catalina.connector.Response.getWriter(R esponse.java:598) [:6.1.0.Final]
    at org.apache.catalina.connector.ResponseFacade.getWr iter(ResponseFacade.java:199) [:6.1.0.Final]
    at org.apache.jasper.runtime.JspWriterImpl.initOut(Js pWriterImpl.java:125) [:6.1.0.Final]
    at org.apache.jasper.runtime.JspWriterImpl.flushBuffe r(JspWriterImpl.java:118) [:6.1.0.Final]
    at org.apache.jasper.runtime.PageContextImpl.release( PageContextImpl.java:188) [:6.1.0.Final]
    at org.apache.jasper.runtime.JspFactoryImpl.internalR eleasePageContext(JspFactoryImpl.java:117) [:6.1.0.Final]
    at org.apache.jasper.runtime.JspFactoryImpl.releasePa geContext(JspFactoryImpl.java:76) [:6.1.0.Final]
    at org.apache.jsp.pages.MozartCostLoginAdmin_jsp._jsp Service(MozartCostLoginAdmin_jsp.java:86)
    at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70) [:6.1.0.Final]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:847) [:1.0.0.Final]
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:369) [:6.1.0.Final]
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:326) [:6.1.0.Final]
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:253) [:6.1.0.Final]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:847) [:1.0.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:324) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:242) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:734) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationDispatcher.pro cessRequest(ApplicationDispatcher.java:541) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationDispatcher.doF orward(ApplicationDispatcher.java:479) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationDispatcher.for ward(ApplicationDispatcher.java:407) [:6.1.0.Final]
    at org.apache.struts.action.RequestProcessor.doForwar d(RequestProcessor.java:1063) [:1.2.7]
    at org.apache.struts.action.RequestProcessor.processF orwardConfig(RequestProcessor.java:386) [:1.2.7]
    at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:229) [:1.2.7]
    at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1194) [:1.2.7]
    at org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:432) [:1.2.7]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:754) [:1.0.0.Final]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:847) [:1.0.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:324) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:242) [:6.1.0.Final]
    at com.zyom.security.LoginMonitorFilter.doFilter(Logi nMonitorFilter.java:67) [:]
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:274) [:6.1.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:242) [:6.1.0.Final]
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:275) [:6.1.0.Final]
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:161) [:6.1.0.Final]
    at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:181) [:6.1.0.Final]
    at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
    at org.jboss.modcluster.catalina.CatalinaContext$Requ estListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
    at org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:88) [:6.1.0.Final]
    at org.jboss.web.tomcat.security.SecurityContextEstab lishmentValve.invoke(SecurityContextEstablishmentV alve.java:100) [:6.1.0.Final]
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:159) [:6.1.0.Final]
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102) [:6.1.0.Final]
    at org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:158) [:6.1.0.Final]
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109) [:6.1.0.Final]
    at org.jboss.web.tomcat.service.request.ActiveRequest ResponseCacheValve.invoke(ActiveRequestResponseCac heValve.java:53) [:6.1.0.Final]
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:362) [:6.1.0.Final]
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:877) [:6.1.0.Final]
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:654) [:6.1.0.Final]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:951) [:6.1.0.Final]
    at java.lang.Thread.run(Thread.java:619) [:1.6.0_13]

  12. #12
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Cannot forward after response has been committed...jboss 6.1

    So look for anywhere else in your code you are calling getOutputStream.
    And I'm not sure why you're setting the response headers etc either.

    You have your code...we don't (or the desire to debug all your code for you).
    I've explained what that error means, so you should now have the ammunition to go and find the source of the problem.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  13. #13
    raghu88 is offline Member
    Join Date
    Sep 2012
    Posts
    7
    Rep Power
    0

    Default Re: Cannot forward after response has been committed...jboss 6.1

    My problem is i didn't find where getOutputStream() is calling.It is working fine jboss 4.2.2 without any exceptions and problem with jboss 6.1.0

    any how thanks for your suggestions.

  14. #14
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Cannot forward after response has been committed...jboss 6.1

    Maybe JBoss 422 is more forgiving, or there is something else going on that we cannot see here.
    Forget about "it works on 422" and simply look for anywhere you are getting the output stream.
    Debug the code.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 0
    Last Post: 04-07-2011, 03:09 PM
  2. jsp:forward problem
    By Lutra in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 03-22-2011, 07:00 PM
  3. Replies: 2
    Last Post: 12-17-2009, 05:54 PM
  4. Replies: 13
    Last Post: 09-07-2009, 04:32 PM
  5. Replies: 5
    Last Post: 07-29-2008, 02:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •