Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hi im getting IllegalState exception when im trying to use sitemesh , any help pleas

 
Ramina Nibilian
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
thank you for reading my post
im triyng to use sitemesh for one project and im getting the following exception
can some one pleas tell me , how i can overcome this?
It seems that something in filters have problem , but what is that things?


java.lang.IllegalStateException
org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:395)
org.netbeans.modules.web.monitor.server.MonitorResponseWrapper.sendError(MonitorResponseWrapper.java:121)
javax.servlet.http.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:107)
com.opensymphony.module.sitemesh.filter.PageResponseWrapper.sendError(PageResponseWrapper.java:180)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:283)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
com.opensymphony.module.sitemesh.taglib.page.ApplyDecoratorTag.doEndTag(ApplyDecoratorTag.java:228)
org.apache.jsp.tiles.main_jsp._jspx_meth_page_applyDecorator_1(main_jsp.java:238)
org.apache.jsp.tiles.main_jsp._jspService(main_jsp.java:93)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
com.opensymphony.module.sitemesh.filter.PageFilter.applyDecorator(PageFilter.java:156)
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:59)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to look up the source but since you don't give the version I don't seem to have found the right one. However the similar code I did find suggests that the IllegalStateException comes from trying to send a Http error code AFTER the response has been committed.
The response gets committed automatically when the output buffer gets full so you might try setting a reallly larrrrrrge output buffer.
Bill
 
Ramina Nibilian
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi thank you for reading this.
Sorry if it is too long.
I use struts 1.1 and Sitemesh 2.2.1 (latest version)
following is my code , you see the exception above

I used Sitemesh.xml from the sanple provided with sitemesh distro
and my decorators.xml is as follow :

<decorators defaultdir="/tiles">
<decorator name="main" page="mainLayout.jsp">
<pattern>*</pattern>


</decorator>
<decorator name="window" page="/decorators/window.jsp"/>
</decorators>


my mainLayout jsp file is as follow:

<%@taglib uri="http://www.opensymphony.com/sitemesh/page"
prefix="page"%>
<%@taglib uri="http://www.opensymphony.com/sitemesh/decorator"
prefix="decorator"%>
<html>
<head>
<title><decorator:title default="Jahan afrooz"></decorator:title> </title>
<LINK rel="stylesheet" href="theme/adt3.css" type="text/css">
<META http-equiv="Content-Type" content="charset=UTF-8">
<%@taglib uri="/WEB-INF/page.tld" prefix="Page"%><%@ include file="includes/style.jsp" %>
<decorator:head></decorator:head>
</head>
<body>
<CENTER>
<TABLE border="0" width="100%" height="100%">
<TBODY>
<TR>
<TD width="58" height="235" colspan="2"><page:applyDecorator name="window" page="header.jsp" />
</TD>
<TD width="84" height="235"><page:applyDecorator name="window" page="search.jsp" /></TD>
</TR>
<TR>
<TD width="58" height="235" colspan="3"><page:applyDecorator name="window" page="menu.jsp" /></TD>
</TR>
<TR>
<TD width="58" height="235" rowspan="2"><page:applyDecorator name="window" page="news.jsp" /></TD>
<TD width="335" height="235" rowspan="2"><decorator:body/></TD>
<TD width="84" height="235"><page:applyDecorator name="window" page="login.jsp"/></TD>
</TR>
<TR><TD width="84" height="423"><page:applyDecorator name="window" page="poll.jsp" /></TD>
</TR>
<TR>
<TD width="58" colspan="3" height="21" align="center"><page:applyDecorator name="window" page="footer.jsp" /></TD>
</TR>
</TBODY>
</TABLE>
</CENTER>
</body>
</html>


I add the filter definition to web.xml as the sample file did.

Thank you for help
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The primary cause of the exception may be something completely different, with the IllegalStateException occuring when the servlet tries to create another error message because the respons has already been comitted.
Some useful information should be showing up in the log files.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic