The following are samples of the threading issues that may be encountered if the com.sun.faces.enableThreading context parameter is NOT set to false in your AppEngine's web.xml configuration file. Error: Server Error - WebConfiguration.javaThis problem did not manifest itself when the application was launched from within Eclipse, but once the application was deployed to the Google AppEngine platform a "500 Server Error" message was displayed in the browser window upon visiting the site (see figure shown below). Figure 1: Screenshot of "500 Server Error" Message Signing into the Google AppEngine console for your web application and reviewing the log files generated by your application will reveal the following exception:
The "com.sun.faces.config.WebConfiguration.processJndiEntries - Stack Trace" document provides a comprehensive stack trace illustrating that the problem was caused when the processJndiEntries(String) method of the WebConfiguration class was invoked in line 109 of the attached WebConfiguration.java class. SolutionAs the javax.naming.InitialContext is not supported in the Google AppEngine at this time, the body of the processJndiEntries(String) method has been commented out (see below). /** * <p>Process all JNDI entries.</p> * @param contextName the context name */ private void processJndiEntries(String contextName) { /* FIXME AppEngine javax.naming.Context is not supported by Google App Engine's Java runtime environment Context initialContext = null; try { initialContext = new InitialContext(); } catch (NamingException ne) { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, ne.toString(), ne); } } if (initialContext != null) { // process environment entries for (WebEnvironmentEntry entry : WebEnvironmentEntry.values()) { String entryName = entry.getQualifiedName(); String value = null; try { value = (String) initialContext.lookup(entryName); } catch (NamingException root) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine(root.toString()); } } if (value != null) { if (LOGGER.isLoggable(Level.INFO)) { // special logic for ClientStateSavingPassword if (!entry .equals(WebEnvironmentEntry.ClientStateSavingPassword)) { if (LOGGER .isLoggable(loggingLevel)) { LOGGER.log(loggingLevel, "jsf.config.webconfig.enventryinfo", new Object[]{contextName, entryName, value}); } } else { if (LOGGER .isLoggable(loggingLevel)) { LOGGER.log(loggingLevel, "jsf.config.webconfig.enventry.clientencrypt", contextName); } } } envEntries.put(entry, value); } } } */ } A patched version of the WebConfiguration.java source code file should be placed in the src/com/sun/faces/config directory in your web application's project directory.Error: Server Error - ConfigManager.javaOnce the problem with the WebConfguration class has been successfully addressed, the next issue that will warrant attention is the ConfigManager class source code file should be placed in the src/com/sun/faces/config directory in your web application's project directory. If you re-deploy your web application to the Google AppEngine servers and attempt to visit the web site, the browser will display another "500 Server Error" window.Upon signing into the application's control panel and reviewing the logs captured for the site, a message similar following message will be visible: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! access denied (java.lang.RuntimePermission modifyThreadGroup) The "com.sun.faces.config.ConfigManager.initialize - Stack Trace" document provides a comprehensive stack trace illustrating that the problem was caused when the initialize(ServletContext) method of the ConfigManager class was invoked. SolutionThe attached ConfigManger.java source code file should be placed in the src/com/sun/faces/config directory in your web application's project directory.Error: Server Error - ConfigureListener.javaJust when you thought you may be out of the woods, there is attempt to create threads in the ConfigureListener class. Once again, when you publish your application to the Google AppEngine site and attempt to access it, you may again encounter the following exception: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! access denied (java.lang.RuntimePermission modifyThreadGroup) This problem will only manifest itself if the javax.faces.PROJECT_STAGE context parameter in your web applications WEB-INF/web.xml file is set equal to "Development". See the example below.
SolutionThere are two options available to fix this particular problem. The first of which is to place the attached Patched Version of the ConfigureListener.java source code in the src/com/sun/faces/config directory in your web application's project directory. A second option would be to set the javax.faces.PROJEC_STAGE configuration parameter in the web.xml to some other value. The following is a list of available options (Lubuke) for the javax.faces.PROJECT_STAGE configuration option..
|
Java Platform Enterprise Edition > JavaServer Faces > JavaServer Faces 2.0 > Configuring JavaServer Faces 2.0 to run on the Google App Engine Using Eclipse > JavaServer Faces 2.0 and Google App Engine Compatibility Issues >
Samples of Threading Issues
Subpages (5):
com.sun.faces.config.ConfigManager.initialize - Stack Trace
com.sun.faces.config.ConfigureListener.initConfigMonitoring(ServletContext) - Stack Trace
com.sun.faces.config.WebConfiguration.processJndiEntries - Stack Trace
Patched Version of ConfigManager.java
Patched Version of ConfigureListener.java
Comments