Last Modified: December 30, 2011 This section discusses some of the problems you you will encounter when you try to use Sun Microsystem's Reference Implementation of the JavaServer Faces 2.0 framework on the Google AppEngine platform. Current IssuesThe following compatibility issues with the 2.0.6 release of Oracle's reference implementation of the JavaServer Faces 2.0 specification and the 1.6.1 release of the Google App Engine platform. Thread Use in the JavaServer Faces Reference ImplementationBy default, Sun's reference implementation (RI) for the JavaServer Faces (JSF) framework uses threads. When running under traditional Java runtime environments, this does not present a problem because threading is allowed. Unfortunately, applications deployed on the Google AppEngine platform cannot start threads of their own. This is enumerated in the "Threads" sub-topic of the "Sandbox" section of the "Java Servlet Environment" document published on Google's web site (shown below). A Java application cannot create a new SolutionThe release notes for the JSF 2.0 reference implementation updated with the release of the second beta describes the "com.sun.faces.enableThreading" configuration parameter which, when set to false, tells the framework NOT to use threads. Adding the following to an application's WEB-INF/web.xml configuration file will stop any attempts by the JSF framework to spawn additional threads.
<param-name>com.sun.faces.enableThreading</param-name>
If the com.sun.faces.enableThreading context parameter is not set to false (or omitted completely from the web.xml configuration file) an application deployed on the Google AppEngine will display a number of different errors all caused by the JSF reference implementation's attempts to construct threads. NOTE: I mention (possibly earlier) because I have not been as diligent in testing these compatibility issues with each release. In updating the "Configuring JavaServer Faces 2.0 to run on the Google App Engine Using Eclipse" article to be compatible with the 1.6.1 release of Google's AppEngine platform, I added the javax.faces.PROJECT_STAGE context parameter with a value of "Development" and the template application deployed and ran successfully.While the release notes for the JSF 2.0 reference implementation indicate that setting the com.sun.faces.enableThreading context parameter equal to false will cause the "...ResourceHandle [to] not pick up new versions of resources when the ProjectStage is development.", practical experience has proven otherwise. When the javax.faces.PROJECT_STAGE context parameter is set equal to Development, the web application will fail to start and the logs available in the Google AppEngine console will contain the following error message. com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! access denied (java.lang.RuntimePermission modifyThreadGroup) For more details, please refer to the "Samples of Threading Issues" document. SolutionWhile working with a pre-release version of the JSF 2.0 reference implementation, it is recommended that the javax.faces.PROJECT_STAGE context parameter be set to either or Production, UnitTest, SystemTest, or Extension. For example, a web application of an application deployed on the Google AppEngine with the following setting in the WEB-INF/web.xml configuration file will not have a problem.
<param-name>javax.faces.PROJECT_STAGE</param-name> <param-value>Production</param-value>
This section describes items that have, in the past, been a problem when running JSF2 applications on the Google App Engine platform; however, they should no longer be a problem when using a modern version of the local development tools or the current server-side runtime. BasisLibrary: Restricted Class IssueResolved in Release: 1.5.0 After configuring a web application to use the second beta of the JSF 2.0 reference implementation and deploying it to the Google AppEngine platform the application failed to start. The log files access through the application's AppEngine console reported the following error: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED!
|
Java Platform Enterprise Edition > JavaServer Faces > JavaServer Faces 2.0 > Configuring JavaServer Faces 2.0 to run on the Google App Engine Using Eclipse >