Re: Need help getting started with GlassFish, MyFaces, and Trinidad
Hi Alan, Great to here that the app is running now! Those things you're encountering really seem like GlassFish (or NetBeans) bugs to me. Actually @Model really should work, because it is just a Stereotype for @Named @RequestScoped. My guess here is that GlassFish does not enable CDI correctly when running with MyFaces, because if you test @Model in Tomcat using MyFaces-2 and Apache OpenWebBeans it works fine! Regards, Jakob 2010/10/19 Alan omegaobj...@gmail.com: On Mon, Oct 18, 2010 at 12:53 PM, Jakob Korherr jakob.korh...@gmail.comwrote: You need to have myfaces-api and myfaces-impl dependencies in your project like this: OK, thanks to Jakob's hints I got MyFaces-2 running under GlassFish. One thing that is essential (I am putting it here for reference) is the format of the sun-web.xml entry has to be: property name=useMyFaces value=true/ Also you have to set: class-loader delegate=false/ I encountered something very disturbing when experimenting with this. In many cases something actually over-writes the sun-web.xml file when I try to run the application. It seems to happen somewhere in the deployment process. I don't know if this is a bug in netbeans or the MyFaces servlet is doing something. Has anyone else seen this? Another thing I discovered is that when using MyFaces, the CDI services no longer work for managed beans. You have to use the @java.faces.bean.ManagedBean annotation. The @javax.enterprise.inject.Model annotation will not work. This is sort of a show-stopper for me since I have a fair amount of code that uses CDI now and I read that the faces annotations may end up deprecated. Is there any workaround on this or any word if this is going to be fixed? Thanks for all the help. Regards, A. -- Jakob Korherr blog: http://www.jakobk.com twitter: http://twitter.com/jakobkorherr work: http://www.irian.at
Re: Tomahawk installation - infinite redirect when configuring extension filters
Hi, thx for your help but it doesn't helped. Already the same problem with infinite redirect: Thats the actuall web.xml ?xml version=1.0 ? 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 !-- RichFaces -- context-param param-nameorg.richfaces.SKIN/param-name param-valueblueSky/param-value /context-param !-- Suppress spurious stylesheets -- context-param param-nameorg.richfaces.CONTROL_SKINNING/param-name param-valuedisable/param-value /context-param context-param param-nameorg.richfaces.CONTROL_SKINNING_CLASSES/param-name param-valuedisable/param-value /context-param !-- Change load strategy to DEFAULT to disable sending scripts/styles as packs -- context-param param-nameorg.richfaces.LoadStyleStrategy/param-name param-valueALL/param-value /context-param context-param param-nameorg.richfaces.LoadScriptStrategy/param-name param-valueALL/param-value /context-param !-- Seam -- listener listener-classorg.jboss.seam.servlet.SeamListener/listener-class /listener filter filter-nameSeam Filter/filter-name filter-classorg.jboss.seam.servlet.SeamFilter/filter-class /filter filter-mapping filter-nameSeam Filter/filter-name url-pattern/*/url-pattern /filter-mapping servlet servlet-nameSeam Resource Servlet/servlet-name servlet-classorg.jboss.seam.servlet.SeamResourceServlet/servlet-class /servlet servlet-mapping servlet-nameSeam Resource Servlet/servlet-name url-pattern/seam/resource/*/url-pattern /servlet-mapping !-- Facelets development mode (disable in production) -- context-param param-namefacelets.DEVELOPMENT/param-name param-value@debug@/param-value /context-param !-- JSF -- context-param param-namejavax.faces.DEFAULT_SUFFIX/param-name param-value.xhtml/param-value /context-param servlet servlet-nameFaces Servlet/servlet-name servlet-classjavax.faces.webapp.FacesServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.seam/url-pattern /servlet-mapping servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern/faces//url-pattern /servlet-mapping security-constraint display-nameRestrict raw XHTML Documents/display-name web-resource-collection web-resource-nameXHTML/web-resource-name url-pattern*.xhtml/url-pattern /web-resource-collection auth-constraint / /security-constraint !-- uncomment ejb-local-ref entries when deploying to GlassFish and (optionally) JBoss AS 5 -- !-- ejb-local-ref ejb-ref-namecreditfriend/AuthenticatorBean/local/ejb-ref-name ejb-ref-typeSession/ejb-ref-type local-home/ localch.bemar.creditfriend.action.Authenticator/local /ejb-local-ref -- !-- Add entries for each EJB session bean which is also a Seam component (not required on JBoss AS) -- persistence-unit-ref persistence-unit-ref-namecreditfriend/pu/persistence-unit-ref-name persistence-unit-name../creditfriend.jar#creditfriend/persistence-unit-name !-- The relative reference doesn't work on GlassFish. Instead, set the persistence-unit-name to creditfriend, package persistence.xml in the WAR, and add a jar-file element in persistence.xml with value ../../creditfriend.jar. persistence-unit-namecreditfriend/persistence-unit-name -- /persistence-unit-ref filter filter-nameMyFacesExtensionsFilter/filter-name filter-classorg.apache.myfaces.webapp.filter.ExtensionsFilter/filter-class init-param param-nameuploadMaxFileSize/param-name param-value20m/param-value /init-param /filter !-- extension mapping for adding script/, link/, and other resource tags to JSF-pages -- filter-mapping filter-nameMyFacesExtensionsFilter/filter-name !-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -- servlet-nameFaces Servlet/servlet-name /filter-mapping !-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -- filter-mapping filter-nameMyFacesExtensionsFilter/filter-name url-pattern/faces/myFacesExtensionResource/*/url-pattern /filter-mapping /web-app Jakob Korherr schrieb: Hi Ben, Just a shot into the blue, but I noticed that you only mapped your Faces
Re: Tomahawk installation - infinite redirect when configuring extension filters
Hi, Then I guess it is some sort of incompatibility with Seam. However I am sorry, I've never really used it, so I don't know why this is happening.. Regards, Jakob 2010/10/19 Benjamin Mark be...@bemar.de: Hi, thx for your help but it doesn't helped. Already the same problem with infinite redirect: Thats the actuall web.xml ?xml version=1.0 ? 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 !-- RichFaces -- context-param param-nameorg.richfaces.SKIN/param-name param-valueblueSky/param-value /context-param !-- Suppress spurious stylesheets -- context-param param-nameorg.richfaces.CONTROL_SKINNING/param-name param-valuedisable/param-value /context-param context-param param-nameorg.richfaces.CONTROL_SKINNING_CLASSES/param-name param-valuedisable/param-value /context-param !-- Change load strategy to DEFAULT to disable sending scripts/styles as packs -- context-param param-nameorg.richfaces.LoadStyleStrategy/param-name param-valueALL/param-value /context-param context-param param-nameorg.richfaces.LoadScriptStrategy/param-name param-valueALL/param-value /context-param !-- Seam -- listener listener-classorg.jboss.seam.servlet.SeamListener/listener-class /listener filter filter-nameSeam Filter/filter-name filter-classorg.jboss.seam.servlet.SeamFilter/filter-class /filter filter-mapping filter-nameSeam Filter/filter-name url-pattern/*/url-pattern /filter-mapping servlet servlet-nameSeam Resource Servlet/servlet-name servlet-classorg.jboss.seam.servlet.SeamResourceServlet/servlet-class /servlet servlet-mapping servlet-nameSeam Resource Servlet/servlet-name url-pattern/seam/resource/*/url-pattern /servlet-mapping !-- Facelets development mode (disable in production) -- context-param param-namefacelets.DEVELOPMENT/param-name param-value@debug@/param-value /context-param !-- JSF -- context-param param-namejavax.faces.DEFAULT_SUFFIX/param-name param-value.xhtml/param-value /context-param servlet servlet-nameFaces Servlet/servlet-name servlet-classjavax.faces.webapp.FacesServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.seam/url-pattern /servlet-mapping servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern/faces//url-pattern /servlet-mapping security-constraint display-nameRestrict raw XHTML Documents/display-name web-resource-collection web-resource-nameXHTML/web-resource-name url-pattern*.xhtml/url-pattern /web-resource-collection auth-constraint / /security-constraint !-- uncomment ejb-local-ref entries when deploying to GlassFish and (optionally) JBoss AS 5 -- !-- ejb-local-ref ejb-ref-namecreditfriend/AuthenticatorBean/local/ejb-ref-name ejb-ref-typeSession/ejb-ref-type local-home/ localch.bemar.creditfriend.action.Authenticator/local /ejb-local-ref -- !-- Add entries for each EJB session bean which is also a Seam component (not required on JBoss AS) -- persistence-unit-ref persistence-unit-ref-namecreditfriend/pu/persistence-unit-ref-name persistence-unit-name../creditfriend.jar#creditfriend/persistence-unit-name !-- The relative reference doesn't work on GlassFish. Instead, set the persistence-unit-name to creditfriend, package persistence.xml in the WAR, and add a jar-file element in persistence.xml with value ../../creditfriend.jar. persistence-unit-namecreditfriend/persistence-unit-name -- /persistence-unit-ref filter filter-nameMyFacesExtensionsFilter/filter-name filter-classorg.apache.myfaces.webapp.filter.ExtensionsFilter/filter-class init-param param-nameuploadMaxFileSize/param-name param-value20m/param-value /init-param /filter !-- extension mapping for adding script/, link/, and other resource tags to JSF-pages -- filter-mapping filter-nameMyFacesExtensionsFilter/filter-name !-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -- servlet-nameFaces Servlet/servlet-name /filter-mapping !-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -- filter-mapping filter-nameMyFacesExtensionsFilter/filter-name
Re: Tomahawk installation - infinite redirect when configuring extension filters
Hi If ExtensionsFilter does not work for your particulat configuration, you can use TomahawkFacesContextWrapper strategy instead. It is useful in situations like this one, where ExtensionsFilter just does not fit well. To do that you must set the following web.xml config params: context-param param-nameorg.apache.myfaces.CHECK_EXTENSIONS_FILTER/param-name param-valuefalse/param-value /context-param context-param param-nameorg.apache.myfaces.DISABLE_TOMAHAWK_FACES_CONTEXT_WRAPPER/param-name param-valuefalse/param-value /context-param There is additional details here: http://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/webapp/filter/TomahawkFacesContextWrapper.java regards, Leonardo Uribe 2010/10/19 Jakob Korherr jakob.korh...@gmail.com Hi, Then I guess it is some sort of incompatibility with Seam. However I am sorry, I've never really used it, so I don't know why this is happening.. Regards, Jakob 2010/10/19 Benjamin Mark be...@bemar.de: Hi, thx for your help but it doesn't helped. Already the same problem with infinite redirect: Thats the actuall web.xml ?xml version=1.0 ? 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 !-- RichFaces -- context-param param-nameorg.richfaces.SKIN/param-name param-valueblueSky/param-value /context-param !-- Suppress spurious stylesheets -- context-param param-nameorg.richfaces.CONTROL_SKINNING/param-name param-valuedisable/param-value /context-param context-param param-nameorg.richfaces.CONTROL_SKINNING_CLASSES/param-name param-valuedisable/param-value /context-param !-- Change load strategy to DEFAULT to disable sending scripts/styles as packs -- context-param param-nameorg.richfaces.LoadStyleStrategy/param-name param-valueALL/param-value /context-param context-param param-nameorg.richfaces.LoadScriptStrategy/param-name param-valueALL/param-value /context-param !-- Seam -- listener listener-classorg.jboss.seam.servlet.SeamListener/listener-class /listener filter filter-nameSeam Filter/filter-name filter-classorg.jboss.seam.servlet.SeamFilter/filter-class /filter filter-mapping filter-nameSeam Filter/filter-name url-pattern/*/url-pattern /filter-mapping servlet servlet-nameSeam Resource Servlet/servlet-name servlet-classorg.jboss.seam.servlet.SeamResourceServlet/servlet-class /servlet servlet-mapping servlet-nameSeam Resource Servlet/servlet-name url-pattern/seam/resource/*/url-pattern /servlet-mapping !-- Facelets development mode (disable in production) -- context-param param-namefacelets.DEVELOPMENT/param-name param-value@debug@/param-value /context-param !-- JSF -- context-param param-namejavax.faces.DEFAULT_SUFFIX/param-name param-value.xhtml/param-value /context-param servlet servlet-nameFaces Servlet/servlet-name servlet-classjavax.faces.webapp.FacesServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.seam/url-pattern /servlet-mapping servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern/faces//url-pattern /servlet-mapping security-constraint display-nameRestrict raw XHTML Documents/display-name web-resource-collection web-resource-nameXHTML/web-resource-name url-pattern*.xhtml/url-pattern /web-resource-collection auth-constraint / /security-constraint !-- uncomment ejb-local-ref entries when deploying to GlassFish and (optionally) JBoss AS 5 -- !-- ejb-local-ref ejb-ref-namecreditfriend/AuthenticatorBean/local/ejb-ref-name ejb-ref-typeSession/ejb-ref-type local-home/ localch.bemar.creditfriend.action.Authenticator/local /ejb-local-ref -- !-- Add entries for each EJB session bean which is also a Seam component (not required on JBoss AS) -- persistence-unit-ref persistence-unit-ref-namecreditfriend/pu/persistence-unit-ref-name persistence-unit-name../creditfriend.jar#creditfriend/persistence-unit-name !-- The relative reference doesn't work on GlassFish. Instead, set the persistence-unit-name to creditfriend, package persistence.xml in the WAR, and add a jar-file element in persistence.xml with value ../../creditfriend.jar.