5 Replies Latest reply on Apr 23, 2009 9:51 AM by Francis Drake

    s:cache throws NullPointer

    Francis Drake Newbie
      I try to put seam/jboss cache into my project, but at the beginning I got problem for which I can't find solution.

      I try to use s:cache to cache page fragment:

      <s:cache key="header_links" region="header_fragments">
                          <s:link styleClass="header_links" view="/home.xhtml">#{bundle_header.aboutUs}</s:link>
                          <s:link styleClass="header_links" view="/home.xhtml">#{bundle_header.contact}</s:link>
                          <s:link styleClass="header_links" view="/home.xhtml">#{bundle_header.rules}</s:link>
                      </s:cache>

      I have copied treecache.xml from blog-example to my app and added into components.xml following (after seam reference):

      <cache:jboss-cache-provider configuration="treecache.xml" />

      I tried to put treecache.xml to almost every directory of EAR hoping that's the case - nope.

      I got following error when trying to display page containg s:cache tag:

      09:53:55,750 ERROR [STDERR] 2009-04-22 09:53:55 com.sun.facelets.FaceletViewHand
      ler handleRenderException
      SEVERE: Error Rendering View[/home.xhtml]
      java.lang.NullPointerException
              at org.jboss.seam.ui.renderkit.CacheRendererBase.doEncodeChildren(CacheR
      endererBase.java:39)
              at org.jboss.seam.ui.util.cdk.RendererBase.encodeChildren(RendererBase.j
      ava:92)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.
      java:837)
              at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(
      HtmlBasicRenderer.java:234)
              at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRendere
      r.java:178)
              at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRe
      nderer.java:126)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.
      java:837)
              at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(
      HtmlBasicRenderer.java:234)
              at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRendere
      r.java:178)
              at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRe
      nderer.java:126)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.
      java:837)
              at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(
      HtmlBasicRenderer.java:234)
              at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRendere
      r.java:178)
              at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRe
      nderer.java:126)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.
      java:837)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
              at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.jav
      a:592)
              at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWra
      pper.java:108)
              at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.j
      ava:196)
              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePha
      se.java:109)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:206)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:83)
              at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)

              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFil
      ter.java:380)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
              at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
              at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.jav
      a:51)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
      lter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:230)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:175)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
      yAssociationValve.java:182)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
      torBase.java:432)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
      e.java:84)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:102)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
      onnectionValve.java:157)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:262)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :844)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ss(Http11Protocol.java:583)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
      6)
              at java.lang.Thread.run(Thread.java:619)