RichFaces 3.3.3.Final not parsing on Glassfish v3
bp2s Oct 18, 2010 12:58 PMHello
I have followed the instructions posted on using RF 3.3.3.Final with a Glassfish 3 setup bearing mind the need to use facelets 1.1.15 etc.
I've read other posts about index.xhtml etc not parsing and I'm having the same problem but none of the suggestions have worked for me.
My pertinent setup is as follows:
- Glassfish v3 installed on my Windows PC ie. JEE 6, JSF 2 with version of facelets which we can't use yet
- Eclipse 3.6 running ant builds
- My app lib has richfaces-[api,impl-jsf2,ui].3.3.3.Final jars and jsf-facelets.jar (v1.1.15)
- My web.xml has these entries:
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <!-- FACELETS SETUP --> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping> <context-param> <param-name>javax.faces.DEFAULT_SUFFIX</param-name> <param-value>.xhtml</param-value> </context-param> <!-- To prevent the error below --> <!-- WARNING: facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE is set to 'true' but facelets.BUILD_BEFORE_RESTORE is set to 'false' or unset. To use facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE you must also \ --> <!-- set facelets.BUILD_BEFORE_RESTORE to 'true'! --> <context-param> <param-name>facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name> <param-value>com.sun.facelets.FaceletViewHandler</param-value> </context-param> <!-- RICHFACES SETUP --> <context-param> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>server</param-value> </context-param> <context-param> <param-name>org.richfaces.SKIN</param-name> <param-value>glassX</param-value> </context-param> <context-param> <param-name>org.richfaces.CONTROL_SKINNING</param-name> <param-value>enable</param-value> </context-param> <context-param> <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name> <param-value>enable</param-value> </context-param> <context-param> <param-name>org.richfaces.LoadStyleStrategy</param-name> <param-value>ALL</param-value> </context-param> <!-- must be the first filter in this file! --> <filter> <display-name>RichFaces Filter</display-name> <filter-name>richfaces</filter-name> <filter-class>org.ajax4jsf.Filter</filter-class> </filter> <filter-mapping> <filter-name>richfaces</filter-name> <servlet-name>Faces Servlet</servlet-name> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>INCLUDE</dispatcher> </filter-mapping> <!-- JSF SETUP --> <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/error.html</location> </error-page> <!-- Optional JSF-RI Parameters to Help Debug --> <context-param> <param-name>com.sun.faces.validateXml</param-name> <param-value>true</param-value> </context-param>
- My faces-config.xml has only managed bean descriptors and this header:
<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
- My sun-web.xml has this content
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd"> <sun-web-app error-url=""> <context-root>/Client</context-root> <class-loader delegate="true"/> <jsp-config> <property name="keepgenerated" value="true"> <description>Keep a copy of the generated servlet class java code.</description> </property> </jsp-config> </sun-web-app>
The ant build assembles the .war and deploys to GF3 no problem. With the
org.ajax4jsf.VIEW_HANDLERS
entry in web.xml, I get a stack trace 'Error Rendering View[/index.xhtml]' with an Null pointer exception. If I remove this context-param the app loads into the view but the content is not parsed properly.
Can anyone suggest what I need to tweak to get the pages read? I feel I'm close to it working but obviously don't know enough to get it working.