tags:

views:

709

answers:

1

I'm trying to migrate a JSF 1.2 project running on Tomcat to Mojarra 2 running on Glassfish v3 (b71). I tried creating a new test project in Eclipse (JEE Ganymede) and a simple facelets page works until I add the libaries I'll be using from the old project, then the same facelets page isn't rendered, i.e. the page source in Firefox is just the facelets code. Any ideas what could be affecting this?

Libs:

   activation.jar
   antlr-2.7.6.jar   
   aplosjsfcomponents.jar c3p0.jar   
   cbfsms.jar chartcreator-1.2.0.jar   
   commons-beanutils-1.8.1.jar   
   commons-digester-2.0.jar   
   commons-logging-1.1.1.jar docx4j.jar 
   dom4j-1.6.1.jar ejb3-persistence.jar 
   gnu-regexp-1.0.8.jar hibernate3.jar  
   hibernate-annotations.jar   
   hibernate-commons-annotations.jar   
   javassist-3.4.GA.jar jaxb-api.jar   
   jaxb-impl.jar jcommon-1.0.16.jar   
   jdynamite.jar jfreechart-1.0.13.jar  
   log4j-1.2.15.jar mail.jar   
   mysql-connector-java-5.1.7-bin.jar   
   parent-pointer-plugin-1.0.jar   
   postgresql-8.3-603.jdbc3.jar   
   richfaces-api-3.3.2.SR1.jar   
   richfaces-impl-3.3.2.SR1.jar   
   richfaces-ui-3.3.2.SR1.jar   
   slf4j-api-1.5.6.jar   
   slf4j-log4j12-1.5.6.jar standard.jar 
   xml-apis-1.0.b2.jar   
   xmlgraphics-commons-1.3.1.jar

web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app 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"
    version="2.5">
    <context-param>
     <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
     <param-value>.xhtml</param-value>
    </context-param>
    <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>

</web-app>

Testing it further, is the richfaces libs that are causing the trouble, just being in the classpath, although the JSF 2 compatibility seems to be a number of bugfixes rather than anything show stopping. Here's my server log:

10-Nov-2009 15:34:35 com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: JVM invocation command line:
C:\Program Files\Java\jdk1.6.0\bin\java.exe
-cp
C:/glassfishv3/glassfish/modules/glassfish.jar
-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009
-XX:+UnlockDiagnosticVMOptions
-XX:MaxPermSize=192m
-XX:NewRatio=2
-XX:+LogVMOutput
-XX:LogFile=C:\glassfishv3\glassfish\domains\domain1/logs/jvm.log
-Xmx512m
-client
-javaagent:C:/glassfishv3/glassfish/lib/monitor/btrace-agent.jar=unsafe=true,noServer=true
-Dosgi.shell.telnet.maxconn=1
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Dfelix.fileinstall.dir=C:\glassfishv3\glassfish/modules/autostart/
-Djavax.net.ssl.keyStore=C:\glassfishv3\glassfish\domains\domain1/config/keystore.jks
-Dosgi.shell.telnet.port=6666
-Djava.security.policy=C:\glassfishv3\glassfish\domains\domain1/config/server.policy
-Dfelix.fileinstall.poll=5000
-Dcom.sun.aas.instanceRoot=C:\glassfishv3\glassfish\domains\domain1
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Dosgi.shell.telnet.ip=127.0.0.1
-Djava.endorsed.dirs=C:\glassfishv3\glassfish/modules/endorsed;C:\glassfishv3\glassfish/lib/endorsed
-Dcom.sun.aas.installRoot=C:\glassfishv3\glassfish
-Djava.ext.dirs=C:\Program Files\Java\jdk1.6.0/lib/ext;C:\Program Files\Java\jdk1.6.0/jre/lib/ext;C:\glassfishv3\glassfish\domains\domain1/lib/ext
-Dfelix.fileinstall.bundles.new.start=true
-Djavax.net.ssl.trustStore=C:\glassfishv3\glassfish\domains\domain1/config/cacerts.jks
-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
-Djava.security.auth.login.config=C:\glassfishv3\glassfish\domains\domain1/config/login.conf
-DANTLR_USE_DIRECT_CLASS_LOADING=true
-Dfelix.fileinstall.debug=1
-Djava.library.path=C:/glassfishv3/glassfish/lib;C:/Java 6 EE SDK/jdk/bin;C:/glassfishv3/glassfish;C:/WINDOWS/Sun/Java/bin;C:/WINDOWS/system32;C:/WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/WINDOWS/system32/wbem;C:/Program Files/ATI Technologies/ATI Control Panel;C:/Program Files/MySQL/MySQL Server 5.1/bin;C:/Program Files/Common Files/Roxio Shared/DLLShared;C:/Program Files/Common Files/Roxio Shared/9.0/DLLShared;C:/Program Files/Microsoft SQL Server/90/Tools/Binn;C:/Program Files/Git/cmd;C:/Java 6 EE SDK/bin;C:/AppServ/Apache2.2/bin;C:/AppServ/php5;C:/cygwin/bin
com.sun.enterprise.glassfish.bootstrap.ASMain
-domainname
domain1
-asadmin-args
start-domain,,,--domaindir,,,C:/glassfishv3/glassfish/domains,,,--debug,,,--verbose=false,,,domain1
-instancename
server
-verbose
false
-debug
true
-asadmin-classpath
C:/glassfishv3/glassfish/modules/admin-cli.jar
-asadmin-classname
com.sun.enterprise.admin.cli.AsadminMain
-upgrade
false
-domaindir
C:/glassfishv3/glassfish/domains/domain1
-read-stdin
true
10-Nov-2009 15:34:35 com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: Successfully launched in 16 msec.

INFO: Running GlassFish Version: GlassFish v3 (build 71)

INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Grizzly Framework 1.9.18-e started in: 78ms listening on port 8181
INFO: Grizzly Framework 1.9.18-e started in: 188ms listening on port 8080
INFO: Grizzly Framework 1.9.18-e started in: 93ms listening on port 4848
INFO: Starting Grizzly Framework 1.9.18-e - Tue Nov 10 15:34:42 GMT 2009
INFO: Grizzly Framework 1.9.18-e started in: 31ms listening on port 3700
INFO: Starting Grizzly Framework 1.9.18-e - Tue Nov 10 15:34:42 GMT 2009
INFO: Grizzly Framework 1.9.18-e started in: 16ms listening on port 7676

INFO: The Admin Console is already installed, but not yet loaded.
INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate

INFO: javassist.util.proxy.ProxyFactory.classLoaderProvider = org.glassfish.weld.WeldActivator$GlassFishClassLoaderProvider@1d9bf04
INFO: SEC1002: Security Manager is OFF.

INFO: Security startup service called
INFO: SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
INFO: Realm admin-realm of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm file of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm certificate of classtype com.sun.enterprise.security.auth.realm.certificate.CertificateRealm successfully created.
INFO: Security service(s) started successfully....

INFO: Created HTTP listener http-listener-1 on port 8080
INFO: Created HTTP listener http-listener-2 on port 8181
INFO: Created HTTP listener admin-listener on port 4848
INFO: Created virtual server server
INFO: Created virtual server __asadmin

INFO: Virtual server server loaded system default web module

INFO: Initializing Mojarra 2.0.2 (FCS b01) for context '/MyApp'

INFO: Loading application MyApp at /MyApp
INFO: Loading MyApp Application done is 43407 ms
INFO: GlassFish v3 (71) startup time : Felix(5750ms) startup services(44687ms) total(50437ms)

INFO: Binding RMI port to *:8686
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started

INFO: felix.fileinstall.poll  (ms)   5000
INFO: felix.fileinstall.dir            C:\glassfishv3\glassfish\modules\autostart
INFO: felix.fileinstall.debug          1
INFO: felix.fileinstall.bundles.new.start          true
INFO: felix.fileinstall.poll  (ms)   5000
INFO: felix.fileinstall.dir            C:\glassfishv3\glassfish\domains\domain1\autodeploy\bundles
INFO: felix.fileinstall.debug          1
INFO: felix.fileinstall.bundles.new.start          true
INFO: Updating configuration from org.apache.felix.fileinstall-autodeploy-bundles.cfg

INFO: felix.fileinstall.poll  (ms)   5000
INFO: felix.fileinstall.dir            C:\glassfishv3\glassfish\domains\domain1\autodeploy\bundles
INFO: felix.fileinstall.debug          1
INFO: felix.fileinstall.bundles.new.start          true

INFO: JMXStartupService: Started JMXConnector, JMXService URL = service:jmx:rmi://APLOS-DV:8686/jndi/rmi://APLOS-DV:8686/jmxrmi

Update

Now found that richfaces requires an entry for facelets' extra viewhandler in the web.xml but I'm not sure where this class is for the JSF2 implementation of facelets:

<context-param>
 <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
 <param-value>com.sun.faces.WhereIsTHeFaceletsViewHandler</param-value>
</context-param>
A: 

Sorry, just found the edit button

David Masters
Please edit your question/problem if you have more information. Treat this site like a blog, not like a forum.
BalusC