java.lang.IllegalStateException: Illegal attempt to set ViewHandler after a response has been rendered

后端 未结 2 1046
我在风中等你
我在风中等你 2020-12-04 04:09

My Java EE web application is working fine with Glassfish 2.1. Now I want to migrate to Glassfish 3.1.1, but after a successful deployment of the war file it gives following

相关标签:
2条回答
  • 2020-12-04 04:19

    java.lang.IllegalStateException: Illegal attempt to set ViewHandler after a response has been rendered.

    This is a typical error message when you use a JSF 1.2 targeted component library on a JSF 2.x environment. RichFaces 3.3.x is designed for JSF 1.2, but Glassfish 3.1 ships with JSF 2.1 instead of JSF 1.2 as in Glassfish 2.1. In JSF 2 there are quite a lot of changes in the area of view handling, because JSP has been deprecated and replaced by Facelets.

    RichFaces has an excellent guide how to install and configure RichFaces 3.3.3 in a JSF 2 environment: RichFaces 3.3.3 and JSF 2.0. The key step to solve this particular exception is adding the following context parameter which disables the JSF 2 Facelets view handler:

    <context-param>
         <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
         <param-value>true</param-value>
    </context-param>
    

    But more steps needs to be done as well. Read the guide thoroughly.

    0 讨论(0)
  • 2020-12-04 04:19

    I had to remove the Ajax4jsf library from my application before I could get this error to go away. Evidently, the Ajax4jsf library is not compatible with JSF 2.0.

    Here where I found this.
    Migrating JSF 1.1 with Ajax4jsf-1.x to JSF2

    0 讨论(0)
提交回复
热议问题