I’m trying to use Maven, Jetty and HtmlUnit to test a webapp written using JPA2.0, JSF. I am confused as to how to do it properly. For example, I get dramatically different results depending on which version of maven-jetty-plugin i use:
6.1.x: error during tests, cannot parse basic JSF…
Running xxx.xxx.my.functional.HtmlUnitTest
2011-06-03 19:41:54.741:WARN::/project1/index.html
javax.faces.view.facelets.TagAttributeException: /index.xhtml
@37,60 value="#{item.availability.toString()}" Error Parsing:
#{item.availability.toString()}
7.0.0.pre5 (or preanything, really): supposedly starts, then silently hangs (I have to kill it).
[INFO] Starting jetty 7.0.0.pre5 ...
2011-06-03 19:50:59.035::INFO: jetty-7.0.0.pre5
2011-06-03 19:51:18.381::INFO: No Transaction manager found - if your webapp requires one, please configure one.
2011-06-03 19:51:20 com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.1.0 (FCS 20110303) for context '/projekt1'
2011-06-03 19:51:21 com.sun.faces.lifecycle.ELResolverInitPhaseListener populateFacesELResolverForJsp
INFO: JSF1027: [null] The ELResolvers for JSF were not registered with the JSP container.
2011-06-03 19:51:21.389::INFO: Started SelectChannelConnector@0.0.0.0:8080
[INFO] Started Jetty Server
Any suggestion would be welcome, as trivial “tests” (Assert.assertTrue(true), i.e. no real testing whatsoever) do pass and jetty stops after testing successfully.
I just wanted to pop in and let you know that if you’re trying to run Mojarra (JSF) 2.1.0 under tomcat or Jetty; that it is imcompatible. See this link Mojarra Known Issues. “This release of Mojarra is not known to work in Apache Tomcat or Jetty. Tomcat and Jetty support will be restored in a future release. It is known to work in Oracle WebLogic and Oracle GlassFish.”
Mojarra 2.1.1+ fixed this issue, even though it claims to be still unresolved. I have mojarra 2.1.4 (current as of 12/1/11) running on tomcat 6.0.33 presently. See this post by BalusC for some details about the mojarra fix.
Also, I believe that JSF1027 info warning you are getting is because of the context parameter in your web.xml:
I commented it out in my web.xml and poof, no more JSF1027 (The ELResolvers for JSF were not registered with the JSP container.) errors; and EL still resolves on my JSF pages. 🙂