5

i am using jsf 2.0 on glassfish 3.0.1 to build an interface to my search engine , when i used Openfaces components on my jsf page and whenever i submit a form i get this error message :

java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to com.sun.faces.application.view.StateHolderSaver

i didnt find any help on the web , please what is the problem ? and how to get rid of it ?

thanks.

0

2 Answers 2

10

This is known as JSF issue 1427. Partial state saving may fail when ajax requests are fired on a page which is been opened by a JSF POST navigation case. There are three solutions, in recommended order:

  1. Do not use POST for page-to-page navigation. So replace <h:commandLink> by <h:link> or <h:outputLink>. See also h:outputLink vs h:commandLink.

  2. Implement POST-Redirect-GET pattern. So if you're still using old fashioned <navigation-case> in faces-config.xml, then add <redirect/> entry. Or if you're using implicit navigation outcomes, then add ?faces-redirect=true query string to the outcome.

  3. Configure the problematic pages to utilize full state saving.

    <context-param>
        <param-name>javax.faces.FULL_STATE_SAVING_VIEW_IDS</param-name>
        <param-value>/pagename.xhtml</param-value>
    </context-param>
    

    (multiple pages can be definied using comma as separator)

Sign up to request clarification or add additional context in comments.

1 Comment

Maybe it's a type in your 3rd solution, but as you wrote in your blog (balusc.blogspot.com/2011/09/communication-in-jsf-20.html) multiple pages should be separated by comma.
1

Download the new version of JSF framework.

See version 2.1.11 !

It's a problems caused for bug in ajax state request on internal jsf framework !

For more information please see link http://java.net/jira/browse/JAVASERVERFACES-1845;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.