Q:

p:commandButton results in an IllegalStateException

I get this error when I click on a p:commandButton in my page

java.lang.IllegalStateException: PWC3999: Cannot create a session
  after the response has been committed

The button is in an h:form and looks like this:
<p:commandButton value="Save" action="#{discussionManager.save}" ajax="false"/>  

But an h:commandButton works fine:
<h:commandButton value="Save" action="#{discussionManager.save}"/>  (this works)

This is the bean with the method in it
@Named
@RequestScoped
public class DiscussionManager {

    private static final Logger logger = Logger.getLogger("DiscussionManager");

    @Inject
    private DiscussionDao discussionDao;

    private Discussion discussion = new Discussion();

    @Produces
    @Named
    @RequestScoped
    public Discussion getDiscussion() {
        return discussion;
    }

    public String save() {
        logger.info("Hello");
        discussionDao.create(discussion);
        return "list";
    }
}

I've waited all day before posting this question because I feel like I should know how to get this working. But I've read and re-read my book, and loads of other posts. I just don't understand why it's not working. 

A:

I can't comment on your final answer so I have to add another answer. I believe what you did to make your example work was to add widgetVar to your editor component. I had this problem as well. The example on the PrimeFaces Demo wouldn't work properly until I added the widgetVar line. You need to reference the widgetVar name in your onclick call rather than the id. I use different names between the id and widgetVar for clarity so I would change your editor code to:
<h3>Write your message below</h3>
 <p:editor id="editorID" 
        value="#{discussion.message}" 
        widgetVar="editorWidget" 
        width="600"
         required="true"/>  

  <h:message for="editor"/>                                                

<h:panelGrid columns="2" style="margin-top:10px">
    <p:commandButton id="submitButton" value="Save" action="#{discussionManager.save}" ajax="false" icon="ui-icon-disk"/> 
    <p:commandButton id="clearButton" type="button" value="Clear" onclick="editorWidget.clear()" icon="ui-icon-close" />
</h:panelGrid>    

I hope that helps clarify.

