struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Per Pascal Grube (JIRA)" <>
Subject [jira] Created: (WW-3444) JSON plugin thows java.lang.IllegalStateException when used together with Struts2 Portlet Bridge
Date Wed, 05 May 2010 07:13:03 GMT
JSON plugin thows java.lang.IllegalStateException when used together with Struts2 Portlet Bridge

                 Key: WW-3444
             Project: Struts 2
          Issue Type: Bug
          Components: Plugin - JSON
    Affects Versions:
         Environment: OS: Linux, Sun JDK, Liferay 5.2.3 running on Tomcat 6.0.26
            Reporter: Per Pascal Grube

When trying to use the JSON Plugin when Struts is running as a portlet a java.lang.IllegalStateException:
Not allowed in an a portlet is thrown.
The full stacktrace is: 

java.lang.IllegalStateException: Not allowed in a portlet
        at org.apache.struts2.portlet.servlet.PortletServletResponse.setContentLength(
        at org.apache.struts2.json.JSONUtil.writeJSONToResponse(
        at org.apache.struts2.json.JSONResult.writeToResponse(
        at org.apache.struts2.json.JSONResult.execute(
        at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
        at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(
        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
        at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(
        at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(
        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(


Surrounding line 260 [ response.setContentLength(json.getBytes(serializationParams.getEncoding()).length);
] in org/apache/struts2/json/ makes it possible to get it running, but I guess
it should be avoided at all to run into this exception.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message