-
1. Re: Empty page after adding JSFUnit jar to NetBeans project
ssilvert Apr 15, 2010 11:26 AM (in response to stanax)It looks like a problem mapping to the Faces Servlet. But I can't think of why just putting the JSFUnit jar in there would cause a problem. It does cause wrapping of the FacesContext, but it only does that when you are running a test.
Have you tried using file extension mapping instead of path mapping?
Stan
-
2. Re: Empty page after adding JSFUnit jar to NetBeans project
stanax Apr 16, 2010 3:59 AM (in response to ssilvert)You mean change in web.xml
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>to <url-pattern>*.xhtml</url-pattern> ?
This still not works.
In simple Hello Word aplication(only one index.xhtml page, no java classes) it throws :
java.lang.NullPointerException in web browser
WARNING: ApplicationDispatcher[/HelloWordJSF] PWC1231: Servlet.service() for servlet Faces Servlet threw exception
javax.servlet.ServletException: PWC1232: Exceeded maximum depth for nested request dispatches: 20
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:787)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:664)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:497).......
WARNING: ApplicationDispatcher[/HelloWordJSF] PWC1231: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NullPointerException
at com.sun.faces.context.flash.ELFlash.getPhaseMapForReading(ELFlash.java:748)
at com.sun.faces.context.flash.ELFlash.isEmpty(ELFlash.java:466)
at com.sun.faces.facelets.util.DevTools.writeVariables(DevTools.java:318)
at com.sun.faces.facelets.util.DevTools.writeVariables(DevTools.java:208)
at com.sun.faces.facelets.util.DevTools.debugHtml(DevTools.java:123)
at com.sun.faces.renderkit.RenderKitUtils.renderHtmlErrorPage(RenderKitUtils.java:1139)Before adding Jars it works, after adding it shows this.
I am using NetBeans and GlassFish.And I create simply project, then I add jars and then I run it by NetBeans on server. I dont use ant, maven or something else for it.
Ales
-
3. Re: Empty page after adding JSFUnit jar to NetBeans project
ssilvert Apr 16, 2010 8:00 AM (in response to stanax)Ales Stanko wrote:
You mean change in web.xml
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>to <url-pattern>*.xhtml</url-pattern> ?
This still not works.
No. With extension mapping, you do it like this:
{code}<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>{code}Then you call http://localhost:8080/MyTime/index.jsf. JSF is responsible for loading /index.xhtml. BTW, are you putting this in /faces/index.html? It should be in the root.
I know there are others who use JSFUnit with Glassfish, but it's not one of the containers I test against.
Stan