views:

43

answers:

0

Hello

I have dropped a war into the autodeploy of a Glassfish 3 domain and it has exploded fine, showing a subdirectory tree domain1>applications>myApp under which is a WEB-INF>classes>myApp folder tree which stores the classes for myApp.

The app originally used JSF1.2 and facelets (1.1.15) and was deployed to tomcat 6, but I'm now trying a build using JEE 6 and Glassfish v3.

I know that JEE 6 has JSF 2 onboard and facelets so I've stripped out all the unecessary jars from my app library leaving RichFaces, and Log4J jars and some Apache commons jars needed to support the app.

The app deploys, but I've got this problem:

The index.xhtml JSF file loads once the app deploys. The page content appears unparsed as the richfaces and jsf tags are ignored although the whole file is sent to the browser. The whole page is encapsulated in a ui:composition facelets tag. I've read elsewhere that this is because the page isn't going through the FacesServlet. Can anyone suggest what I need to do to my deployment descriptors to make this work if they are indeed the problem?

My faces-config.xml has managed-bean setups only; my web.xml contains:

<!-- Faces Servlet -->
<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

<!-- Faces Servlet Mapping -->
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>

<!-- Added for facelets -->
<context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
</context-param>

among a load of other tags. My sun-web.xml contains:

<sun-web-app error-url="">
  <context-root>/MyApp</context-root>
  <class-loader delegate="false"/>
  <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>

EDIT

I pointed the browser at http://localhost:9090/myApp/index.jsf and the problem is unchanged, although in the server log I get this

[#|2010-10-15T12:27:17.603+0100|INFO|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=Thread-1;||STDOUT| 2010-10-15 12:27:17,603 | INFO  | [http-thread-pool-9090-(12)]: Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
|#]

[#|2010-10-15T12:27:17.603+0100|INFO|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=Thread-1;||STDOUT| 2010-10-15 12:27:17,603 | INFO  | [http-thread-pool-9090-(12)]: Creating LRUMap cache instance using parameters: {javax.faces.DEFAULT_SUFFIX=.xhtml, com.sun.faces.validateXml=true, com.sun.faces.forceLoadConfiguration=true, facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE=true, org.richfaces.LoadStyleStrategy=ALL, javax.faces.STATE_SAVING_METHOD=server, org.richfaces.CONTROL_SKINNING=enable, org.richfaces.SKIN=glassX, org.richfaces.CONTROL_SKINNING_CLASSES=enable}
|#]

[#|2010-10-15T12:27:17.603+0100|INFO|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=Thread-1;||STDOUT| 2010-10-15 12:27:17,603 | INFO  | [http-thread-pool-9090-(12)]: Creating LRUMap cache instance of default capacity
|#]

[#|2010-10-15T12:27:17.635+0100|INFO|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=Thread-1;||STDOUT| 2010-10-15 12:27:17,635 | INFO  | [http-thread-pool-9090-(12)]: Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
|#]

[#|2010-10-15T12:27:17.635+0100|INFO|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=Thread-1;||STDOUT| 2010-10-15 12:27:17,635 | INFO  | [http-thread-pool-9090-(12)]: Creating LRUMap cache instance using parameters: {javax.faces.DEFAULT_SUFFIX=.xhtml, com.sun.faces.validateXml=true, com.sun.faces.forceLoadConfiguration=true, facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE=true, org.richfaces.LoadStyleStrategy=ALL, javax.faces.STATE_SAVING_METHOD=server, org.richfaces.CONTROL_SKINNING=enable, org.richfaces.SKIN=glassX, org.richfaces.CONTROL_SKINNING_CLASSES=enable}
|#]

[#|2010-10-15T12:27:17.635+0100|INFO|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=Thread-1;||STDOUT| 2010-10-15 12:27:17,635 | INFO  | [http-thread-pool-9090-(12)]: Creating LRUMap cache instance of default capacity

so it looks like it likes the faces-config.xml contents but it's still not rendering. To confirm, I've specified <url-pattern>*.jsf</url-pattern> in my web.xml deployment descriptor, my javax.faces.DEFAULT_SUFFIX has a param-value of .xhtml and my welcome page and all other web content pages end .xhtml.

Is there any significance in the server returning the same info twice?

Thanks for your help.

EDIT 2 The richfaces-[api|impl-jsf2|ui]-3.3.3.Final jars are in the lib, along with jsf-facelets.jar which is 1.1.15 as recommended here. My web-app descriptor is version="2.5". Because of the fact that I needed to include 1.1.15 of facelets, and I'm using Glassfish 3 ie. JEE 6, I've tried setting <class-loader delegate="true"/> to false to try and get my facelets 1.1.15 jar picked up and used as a preference by the class loader, but it hasn't made any difference.

The faces-config.xml is set to version="2.0":

<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"&gt;