Details
Description
If you don't set the default JSF suffix in the web.xml and are using Facelets you'll run into this NPE:
2007-04-16 14:56:34,859 DEBUG [com.sun.faces.lifecycle.RenderResponsePhase] About to render view /main.iface
2007-04-16 14:56:34,859 ERROR [com.icesoft.faces.facelets.D2DFaceletViewHandler] Problem in renderResponse: replacement
java.lang.NullPointerException: replacement
at java.util.regex.Matcher.replaceFirst(Matcher.java:844)
at java.lang.String.replaceFirst(String.java:1967)
at com.icesoft.faces.facelets.D2DFaceletViewHandler.getRenderedViewId(D2DFaceletViewHandler.java:232)
at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:246)
at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:149)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:268)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
at com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet.service(PersistentFacesServlet.java:402)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
2007-04-16 14:56:34,859 DEBUG [com.sun.faces.lifecycle.RenderResponsePhase] About to render view /main.iface
2007-04-16 14:56:34,859 ERROR [com.icesoft.faces.facelets.D2DFaceletViewHandler] Problem in renderResponse: replacement
java.lang.NullPointerException: replacement
at java.util.regex.Matcher.replaceFirst(Matcher.java:844)
at java.lang.String.replaceFirst(String.java:1967)
at com.icesoft.faces.facelets.D2DFaceletViewHandler.getRenderedViewId(D2DFaceletViewHandler.java:232)
at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:246)
at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:149)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:268)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
at com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet.service(PersistentFacesServlet.java:402)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
Issue Links
- blocks
-
ICE-2142 Seam PDF example doesn't work
- Closed
suggest fix, log error:
Index: D:/Documents and Settings/pbreau/workspace/ICEfaces/core/src/com/icesoft/faces/facelets/D2DFaceletViewHandler.java
{ + log.error(ViewHandler.DEFAULT_SUFFIX_PARAM_NAME + + " is not initialized in web.xml. Please define the suffix used for your JSF pages. eg. .jspx"); + }===================================================================
— D:/Documents and Settings/pbreau/workspace/ICEfaces/core/src/com/icesoft/faces/facelets/D2DFaceletViewHandler.java (revision 14650)
+++ D:/Documents and Settings/pbreau/workspace/ICEfaces/core/src/com/icesoft/faces/facelets/D2DFaceletViewHandler.java (working copy)
@@ -254,6 +254,12 @@
String facesSuffix = actionId.substring(actionId.lastIndexOf('.'));
String viewSuffix = context.getExternalContext()
.getInitParameter(ViewHandler.DEFAULT_SUFFIX_PARAM_NAME);
+ if( viewSuffix == null ){
+ if (log.isErrorEnabled())
+ }
viewId = actionId.replaceFirst(facesSuffix, viewSuffix);
}
return viewId;