2 Replies Latest reply on Apr 28, 2010 9:04 PM by Amrish Tandon

    NullPointerException In CachedResourceBuilder

    Amrish Tandon Newbie

      I am getting the following on my WAs 7.0 server when I attempt to use the CachedResourceBuilder:

       

      4/26/10 14:52:39:224 EDT] 00000022 webapp        E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[Faces Servlet]: java.lang.NullPointerException
      at java.util.LinkedHashMap.get(LinkedHashMap.java:324)
      at org.ajax4jsf.resource.cached.CachedResourceBuilder.getResourceDataForKey(CachedResourceBuilder.java:105)
      at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:156)
      at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:141)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:508)
      at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:895)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:932)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:500)
      at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
      at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864)
      at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
      at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:183)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
      at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
      at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
      at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
      at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
      at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
      at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)

       

      After the above error is thrown, I am getting the fllowing error for every JSF page I access:

       

       

      [4/26/10 14:52:43:752 EDT] 00000021 lifecycle     E   JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /searchresults.jsp) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@4dc04dc]
      [4/26/10 14:52:43:759 EDT] 00000021 servlet       E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet Faces Servlet in application productsvc_ear. Exception created : javax.servlet.ServletException
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1655)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1595)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
      at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:895)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:932)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:500)
      at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
      at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3810)
      at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)
      at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
      at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:183)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
      at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
      at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
      at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
      at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
      at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
      at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
      Caused by: java.lang.NullPointerException
      at java.util.LinkedHashMap.get(LinkedHashMap.java:324)
      at org.ajax4jsf.resource.cached.DualLRUMap.getKey(DualLRUMap.java:73)
      at org.ajax4jsf.resource.cached.CachedResourceBuilder.getUri(CachedResourceBuilder.java:167)
      at org.ajax4jsf.resource.InternetResourceBase.getUri(InternetResourceBase.java:218)
      at org.ajax4jsf.resource.BaseResourceRenderer.encodeBegin(BaseResourceRenderer.java:60)
      at org.ajax4jsf.resource.OneTimeRenderer.encodeBegin(OneTimeRenderer.java:48)
      at org.ajax4jsf.resource.BaseResourceRenderer.encode(BaseResourceRenderer.java:47)
      at org.ajax4jsf.resource.InternetResourceBase.encode(InternetResourceBase.java:313)
      at org.ajax4jsf.renderkit.HeaderResourcesRendererBase.encodeResourcesArray(HeaderResourcesRendererBase.java:141)
      at org.ajax4jsf.renderkit.HeaderResourcesRendererBase.encodeToHead(HeaderResourcesRendererBase.java:153)
      at org.ajax4jsf.context.ViewResources.processComponent(ViewResources.java:325)
      at org.ajax4jsf.context.ViewResources.traverse(ViewResources.java:381)
      at org.ajax4jsf.context.ViewResources.traverse(ViewResources.java:385)
      at org.ajax4jsf.context.ViewResources.traverse(ViewResources.java:385)
      at org.ajax4jsf.context.ViewResources.traverse(ViewResources.java:385)
      at org.ajax4jsf.context.ViewResources.traverse(ViewResources.java:385)
      at org.ajax4jsf.context.ViewResources.traverse(ViewResources.java:385)
      at org.ajax4jsf.context.ViewResources.traverse(ViewResources.java:385)
      at org.ajax4jsf.context.ViewResources.traverse(ViewResources.java:385)
      at org.ajax4jsf.context.ViewResources.traverse(ViewResources.java:385)
      at org.ajax4jsf.context.ViewResources.traverse(ViewResources.java:385)
      at org.ajax4jsf.context.ViewResources.processHeadResources(ViewResources.java:514)
      at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:193)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
      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)
      ... 30 more

       

      If I remove the CachedResourceBuilder, all errors go away. I need the CachedResourceBuilder so that I can get proper URLs for the CSS files and javascript files.

       

      Any ideas? This is a critical issue for us to be able to use richfaces in production.