Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7873187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:26:23+00:00 2026-06-03T02:26:23+00:00

I get this error when I click on a p:commandButton in my page java.lang.IllegalStateException:

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T02:26:24+00:00Added an answer on June 3, 2026 at 2:26 am

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know what these error's mean? I get this when I click a
I get this error on a .click() event in jQuery. I see it in
I get this error if I click a button that starts the backgroundworker twice.
Hello I cannot figure out why I get this error. I've got a list
I get this error when I try recreate tables in my database with hibernate.
I get this error: Can't locate Foo.pm in @INC Is there an easier way
I get this error on an update panel within a popupControlExtender which is within
I get this error when I do an svn update : Working copy XXXXXXXX
I get this error:- You have an error in your SQL syntax; check the
We get this error in Visual Studio 2005 and TFS very often. Can anyone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.