Thursday December 11, 2008
TOTD # 59: Alternative JSF implementations on GlassFish - MyFaces and Tomahawk
GlassFish comes
bundled with an industry grade implementation of Java Server Faces
codenamed Mojarra.
It is the
most complete, up-to-date and well-tested JSF implementation
and used pretty
extensively. GlassFish v2 and v3 Prelude ships with JSF
1.2.x-compliant implementation that is defined as part of Java EE 5.
GlassFish v3 trunk contains JSF 2.0-compliant implementation that is
getting defined as part of Java EE 6. The latest version of Mojarra can
be installed from the Update
Center.
But GlassFish does not restrict
you to Mojarra
and instead it embraces other JSF implementations easily. This blog
uses MyFaces,
an alternate JavaServer Faces implementation from Apache, to
demonstrate
that. If you are interested in a brief summary of what it takes to use
these alternate implementations on GlassFish then scroll to the end of
this entry.
![]() |
MyFaces also provides several component libraries such as Tomahawk, Trinidad, and Tobago for building web applications. This blog shows how MyFaces Tomahawk samples can be deployed on GlassFish v2 and v3. The basic integration hooks between GlassFish and other JSF implementations remain the same and are independent of the component library. |
| [#|2008-12-05T11:00:43.710-0800|INFO|sun-appserver9.1|javax.enterprise.system.tools.deployment|_ThreadID=22;_ThreadName=Thread-43;| deployed with moduleid = myfaces-example-simple-1.1.8|#] [#|2008-12-05T11:00:44.296-0800|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=21; _ThreadName=httpWorkerThread-4848-1;/myfaces-example-simple-1.1.8;|Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context '/myfaces-example-simple-1.1.8'|#] |

| [#|2008-12-03T16:27:43.935-0800|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=24;_ThreadName=httpSSLWorkerThread-8080-1;| 2008-12-03 16:27:43,935 [httpSSLWorkerThread-8080-1] INFO org.apache.myfaces.shared_tomahawk.config.MyfacesConfig - Starting up Tomahawk on the MyFaces-JSF-Implementation |#] [#|2008-12-03T16:27:43.935-0800|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=24;_ThreadName=httpSSLWorkerThread-8080-1;| 2008-12-03 16:27:43,935 [httpSSLWorkerThread-8080-1] ERROR org.apache.myfaces.shared_tomahawk.config.MyfacesConfig - Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations. |
| <?xml version="1.0"
encoding="UTF-8"?> <!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet 2.4//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd"> <sun-web-app> <class-loader delegate="false"/> <property name="useMyFaces" value="true"/> </sun-web-app> |
| . . . [#|2008-12-05T11:11:25.615-0800|INFO|sun-appserver9.1|javax.enterprise.system.tools.deployment|_ThreadID=24;_ThreadName=Thread-257;| deployed with moduleid = myfaces-simple-v2|#] [#|2008-12-05T11:11:26.266-0800|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=httpWorkerThread-4848-1;| 2008-12-05 11:11:26,266 [httpWorkerThread-4848-1] INFO org.apache.myfaces.config.FacesConfigurator - Reading standard config org/apache/myfaces/resource/standard-faces-config.xml |#] [#|2008-12-05T11:11:26.290-0800|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=httpWorkerThread-4848-1;| 2008-12-05 11:11:26,290 [httpWorkerThread-4848-1] INFO org.apache.myfaces.config.FacesConfigurator - Reading config jar:file:/Users/arungupta/tools/glassfish/v2/ur2/glassfish/domains/domain1/applications/j2ee-modules/myfaces-simple-v2/WEB-INF/lib/tomahawk-1.1.8.jar!/ META-INF/faces-config.xml |#] [#|2008-12-05T11:11:26.309-0800|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=httpWorkerThread-4848-1;|2008-12-05 11:11:26,308 [httpWorkerThread-4848-1] INFO org.apache.myfaces.config.FacesConfigurator - Reading config /WEB-INF/examples-config.xml |#] [#|2008-12-05T11:11:26.337-0800|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=httpWorkerThread-4848-1;|2008-12-05 11:11:26,337 [httpWorkerThread-4848-1] INFO org.apache.myfaces.config.FacesConfigurator - Reading config /WEB-INF/testSuite-config.xml |#] [#|2008-12-05T11:11:26.349-0800|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=httpWorkerThread-4848-1;|2008-12-05 11:11:26,349 [httpWorkerThread-4848-1] INFO org.apache.myfaces.config.FacesConfigurator - Starting up MyFaces-package : myfaces-api in version : 1.1.6 from path : file:/Users/arungupta/tools/glassfish/v2/ur2/glassfish/domains/domain1/applications/j2ee-modules/myfaces-simple-v2/WEB-INF/lib/myfaces-api-1.1.6.jar |#] [#|2008-12-05T11:11:26.350-0800|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=httpWorkerThread-4848-1;|2008-12-05 11:11:26,350 [httpWorkerThread-4848-1] INFO org.apache.myfaces.config.FacesConfigurator - Starting up MyFaces-package : myfaces-impl in version : 1.1.6 from path : file:/Users/arungupta/tools/glassfish/v2/ur2/glassfish/domains/domain1/applications/j2ee-modules/myfaces-simple-v2/WEB-INF/lib/myfaces-impl-1.1.6.jar |#] [#|2008-12-05T11:11:26.350-0800|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=httpWorkerThread-4848-1;|2008-12-05 11:11:26,350 [httpWorkerThread-4848-1] INFO org.apache.myfaces.config.FacesConfigurator - MyFaces-package : tomahawk-sandbox not found. |#] [#|2008-12-05T11:11:26.350-0800|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=httpWorkerThread-4848-1;|2008-12-05 11:11:26,350 [httpWorkerThread-4848-1] INFO org.apache.myfaces.config.FacesConfigurator - Starting up MyFaces-package : tomahawk in version : 1.1.8 from path : file:/Users/arungupta/tools/glassfish/v2/ur2/glassfish/domains/domain1/applications/j2ee-modules/myfaces-simple-v2/WEB-INF/lib/tomahawk-1.1.8.jar |#] . . . [#|2008-12-05T11:11:27.069-0800|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=httpWorkerThread-4848-1;|2008-12-05 11:11:27,069 [httpWorkerThread-4848-1] INFO org.apache.myfaces.shared_impl.config.MyfacesConfig - Starting up Tomahawk on the RI-JSF-Implementation. |#] [#|2008-12-05T11:11:27.069-0800|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=httpWorkerThread-4848-1;|2008-12-05 11:11:27,069 [httpWorkerThread-4848-1] INFO org.apache.myfaces.shared_impl.config.MyfacesConfig - Starting up Tomahawk on the MyFaces-JSF-Implementation |#] [#|2008-12-05T11:11:27.070-0800|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=httpWorkerThread-4848-1;|2008-12-05 11:11:27,070 [httpWorkerThread-4848-1] ERROR org.apache.myfaces.shared_impl.config.MyfacesConfig - Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations. |#] [#|2008-12-05T11:11:27.070-0800|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=httpWorkerThread-4848-1;|2008-12-05 11:11:27,070 [httpWorkerThread-4848-1] INFO org.apache.myfaces.webapp.StartupServletContextListener - ServletContext '/Users/arungupta/tools/glassfish/v2/ur2/glassfish/domains/domain1/applications/j2ee-modules/myfaces-simple-v2/' initialized. |#] |

| Dec 5, 2008 11:27:17 AM
com.sun.faces.config.ConfigureListener contextInitialized INFO: Initializing Mojarra (1.2_10-b01-FCS) for context '/myfaces-example-simple-1.1.8' Dec 5, 2008 11:27:18 AM com.sun.enterprise.web.WebApplication start INFO: Loading application myfaces-example-simple-1.1.8 at /myfaces-example-simple-1.1.8 Dec 5, 2008 11:27:18 AM org.glassfish.deployment.admin.DeployCommand execute INFO: Deployment of myfaces-example-simple-1.1.8 done is 3470 ms |
| Dec 5, 2008 11:54:54 AM INFO: 2008-12-05 11:54:54,083 [httpWorkerThread-8080-0] INFO org.apache.myfaces.shared_tomahawk.config.MyfacesConfig - Starting up Tomahawk on the RI-JSF-Implementation. Dec 5, 2008 11:54:54 AM INFO: 2008-12-05 11:54:54,083 [httpWorkerThread-8080-0] INFO org.apache.myfaces.shared_tomahawk.config.MyfacesConfig - Starting up Tomahawk on the MyFaces-JSF-Implementation Dec 5, 2008 11:54:54 AM INFO: 2008-12-05 11:54:54,083 [httpWorkerThread-8080-0] ERROR org.apache.myfaces.shared_tomahawk.config.MyfacesConfig - Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations. |

| Dec 5, 2008 12:35:17 PM
com.sun.faces.config.ConfigureListener contextInitialized INFO: Initializing Mojarra 2.0.0 (SNAPSHOT b05) for context '/myfaces-example-simple-1.1.8' Dec 5, 2008 12:35:18 PM org.apache.catalina.core.ApplicationContext log SEVERE: WebModule[/myfaces-example-simple-1.1.8]PWC1275: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener java.lang.NoClassDefFoundError: com/sun/facelets/tag/jsf/ComponentHandler at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:675) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:974) |
| <context-param> <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name> <param-value>true</param-value> </context-param> |
| Dec 5, 2008 2:50:21 PM
com.sun.faces.config.ConfigureListener contextInitialized INFO: Initializing Mojarra 2.0.0 (SNAPSHOT b05) for context '/myfaces-simple-v3' Dec 5, 2008 2:50:21 PM com.sun.enterprise.web.WebApplication start INFO: Loading application myfaces-simple-v3 at /myfaces-simple-v3 Dec 5, 2008 2:50:21 PM org.glassfish.deployment.admin.DeployCommand execute INFO: Deployment of myfaces-simple-v3 done is 1513 ms |

| <?xml version="1.0"
encoding="UTF-8"?> <!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet 2.4//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd"> <sun-web-app> <class-loader delegate="false"/> <property name="useBundledJsf" value="true"/> </sun-web-app> |
| . . . Dec 5, 2008 3:19:54 PM INFO: 2008-12-05 15:19:54,786 [httpWorkerThread-4848-1] INFO org.apache.myfaces.config.FacesConfigurator - Reading config jar:file:/Users/arungupta/tools/glassfish/v3/snapshot/glassfish/domains/domain1/applications/myfaces-simple-v3-usebundled/WEB-INF/lib/tomahawk-1.1.8.jar!/ META-INF/faces-config.xml Dec 5, 2008 3:19:54 PM INFO: 2008-12-05 15:19:54,806 [httpWorkerThread-4848-1] INFO org.apache.myfaces.config.FacesConfigurator - Reading config /WEB-INF/examples-config.xml Dec 5, 2008 3:19:54 PM INFO: 2008-12-05 15:19:54,828 [httpWorkerThread-4848-1] INFO org.apache.myfaces.config.FacesConfigurator - Reading config /WEB-INF/testSuite-config.xml Dec 5, 2008 3:19:54 PM INFO: 2008-12-05 15:19:54,841 [httpWorkerThread-4848-1] INFO org.apache.myfaces.config.FacesConfigurator - Starting up MyFaces-package : myfaces-api in version : 1.1.6 from path : file:/Users/arungupta/tools/glassfish/v3/snapshot/glassfish/domains/domain1/applications/myfaces-simple-v3-usebundled/WEB-INF/lib/myfaces-api-1.1.6.jar Dec 5, 2008 3:19:54 PM INFO: 2008-12-05 15:19:54,841 [httpWorkerThread-4848-1] INFO org.apache.myfaces.config.FacesConfigurator - Starting up MyFaces-package : myfaces-impl in version : 1.1.6 from path : file:/Users/arungupta/tools/glassfish/v3/snapshot/glassfish/domains/domain1/applications/myfaces-simple-v3-usebundled/WEB-INF/lib/myfaces-impl-1.1.6.jar Dec 5, 2008 3:19:54 PM INFO: 2008-12-05 15:19:54,841 [httpWorkerThread-4848-1] INFO org.apache.myfaces.config.FacesConfigurator - MyFaces-package : tomahawk-sandbox not found. Dec 5, 2008 3:19:54 PM INFO: 2008-12-05 15:19:54,841 [httpWorkerThread-4848-1] INFO org.apache.myfaces.config.FacesConfigurator - Starting up MyFaces-package : tomahawk in version : 1.1.8 from path : file:/Users/arungupta/tools/glassfish/v3/snapshot/glassfish/domains/domain1/applications/myfaces-simple-v3-usebundled/WEB-INF/lib/tomahawk-1.1.8.jar . . . Dec 5, 2008 3:19:55 PM INFO: 2008-12-05 15:19:55,763 [httpWorkerThread-4848-1] INFO org.apache.myfaces.shared_impl.config.MyfacesConfig - Starting up Tomahawk on the RI-JSF-Implementation. Dec 5, 2008 3:19:55 PM INFO: 2008-12-05 15:19:55,764 [httpWorkerThread-4848-1] INFO org.apache.myfaces.shared_impl.config.MyfacesConfig - Starting up Tomahawk on the MyFaces-JSF-Implementation Dec 5, 2008 3:19:55 PM INFO: 2008-12-05 15:19:55,764 [httpWorkerThread-4848-1] ERROR org.apache.myfaces.shared_impl.config.MyfacesConfig - Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations. Dec 5, 2008 3:19:55 PM INFO: 2008-12-05 15:19:55,764 [httpWorkerThread-4848-1] INFO org.apache.myfaces.webapp.StartupServletContextListener - ServletContext '/Users/arungupta/tools/glassfish/v3/snapshot/glassfish/domains/domain1/applications/myfaces-simple-v3-usebundled/' initialized. Dec 5, 2008 3:19:55 PM com.sun.enterprise.web.WebApplication start INFO: Loading application myfaces-simple-v3-usebundled at /myfaces-simple-v3-usebundled Dec 5, 2008 3:19:55 PM org.glassfish.deployment.admin.DeployCommand execute INFO: Deployment of myfaces-simple-v3-usebundled done is 1994 ms |

| JSF Implementations | ||
| Mojarra | MyFaces | |
| GlassFish v2 | Default | "useMyFaces" property in "sun-web.xml" |
| GlassFish v3 Prelude | Default | Not supported |
| GlassFish v3 Trunk | Disable Facelets 2.0 in "web.xml" | "useMyFaces"
OR "useBundledJsf" property in "sun-web.xml" Disable Facelets 2.0 in "web.xml" (only for Facelets 1.1.x dependencies) |
Posted by Arun Gupta in web2.0 | Comments[5]
|
|
|
|
|
Today's Page Hits: 6786
Total # blog entries: 1002
| « November 2009 | ||||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
1 | 2 | 4 | 6 | 7 | ||
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | |||||
| Today | ||||||
good!
cool!
Posted by simtool on December 11, 2008 at 08:55 PM PST #
thanks
Posted by tattoo on December 30, 2008 at 08:10 AM PST #
ThankSs
Posted by dizi izle on February 21, 2009 at 09:21 AM PST #
Thank YoUuu
Posted by dizi izle on February 21, 2009 at 09:22 AM PST #
thank u.
Posted by sinema izle on March 07, 2009 at 03:40 PM PST #