Search code examples
jsf-2glassfish-3jrebel

Glassfish 3: cannot set javax.faces.PROJECT_STAGE to "production"


I', trying to set the javax.faces.PROJECT_STAGE to "production" in my web.xml, but in runtime I see, that the value is always "development". Debugging shows very strange things, cannot get to the situation.. Tried both on GF 3.0.1 and GF 3.1 - the same.

Here is the piece of my web.xml:

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/spring/applicationContext*.xml</param-value>
</context-param>
<context-param>
    <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
    <param-value>/WEB-INF/rstk-tag.taglib.xml</param-value>
</context-param>
<context-param>
    <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
    <param-value>true</param-value>
</context-param>
<context-param>
    <param-name>rstk.DOWNLOAD_PATH</param-name>
    <param-value>c:\glassfish3.1\downloads</param-value>
</context-param>
<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Production</param-value>
</context-param>

and this

FacesContext.getCurrentInstance().getApplication().getProjectStage()

always returns Development!

Any help appreciated, this is the real stopper for me as JSF 2.1 in GF 3.1 results in frustrating warning in development mode..


Solution

  • Ok, finally I found the real reason for this staff.

    It's Jrebel. For some reasons they force the DEVELOPMENT mode for jsf. For more details you can see http://java.net/jira/browse/JAVASERVERFACES-2079?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel - comments block. The other person had the same problem and finally found out the core reason.

    Hope this will help everyone.