1 Reply Latest reply on Feb 22, 2009 2:10 PM by John Ament

    Strange NPE, seems like it just started happening

    John Ament Master

      So some environment info


      JBoss AS 5
      Seam 2.1.1
      Richfaces 3.3
      Running on a few different Fedora releases


      stack trace:


      java.lang.NullPointerException
           at javax.faces.component.UIComponentBase$AttributesMap.put(UIComponentBase.java:1656)
           at javax.faces.component.UIComponentBase$AttributesMap.put(UIComponentBase.java:1526)
           at org.jboss.seam.contexts.PageContext.set(PageContext.java:98)
           at org.jboss.seam.Component.handleFactoryMethodResult(Component.java:2062)
           at org.jboss.seam.Component.getInstanceFromFactory(Component.java:2044)
           at org.jboss.seam.Component.getInstance(Component.java:1978)
           at org.jboss.seam.Component.getInstance(Component.java:1950)
           at org.jboss.seam.Component.getInstance(Component.java:1944)
           at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
           at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
           at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
           at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
           at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
           at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
           at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
           at org.jboss.el.parser.AstValue.getValue(AstValue.java:63)
           at org.jboss.el.parser.AstDeferredExpression.getValue(AstDeferredExpression.java:26)
           at org.jboss.el.parser.AstCompositeExpression.getValue(AstCompositeExpression.java:31)
           at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
           at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
           at javax.faces.component.UIOutput.getValue(UIOutput.java:184)
           at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:201)
           at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:284)
           at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:154)
           at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861)
           at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
           at org.richfaces.renderkit.html.PanelRenderer.doEncodeBegin(PanelRenderer.java:189)
           at org.richfaces.renderkit.html.PanelRenderer.doEncodeBegin(PanelRenderer.java:148)
           at org.ajax4jsf.renderkit.RendererBase.encodeBegin(RendererBase.java:101)
           at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:928)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
           at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
           at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
           at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
           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)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)
           at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444)
           at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
           at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310)
           at org.jboss.seam.web.RewriteFilter.process(RewriteFilter.java:98)
           at org.jboss.seam.web.RewriteFilter.doFilter(RewriteFilter.java:57)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
           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:178)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
           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.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
           at java.lang.Thread.run(Thread.java:619)



      my facelet:



      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="/layout/template.xhtml">
      
           <ui:define name="body">
                <f:view>
                     <rich:panel headerClass="topic_header blacktext headertext">
                          <f:facet name="header"><h:outputText value="Recent posts by #{blogTopicsUser.displayName}" /></f:facet>
                          Hello, world!
                     </rich:panel>
                     <div style="clear:both"></div>
                </f:view>
           </ui:define>
      </ui:composition>



      It works fine if I take out the reference to blogTopicsUser
      That object is built using the following:


           @Factory("blogTopicsUser")
           public User getUser() {
                if(username == null)
                     throw new EntityNotFoundException("Username not set.", User.class);
                if(u == null)
                     userDAO.findUserByUsername(username);
                
                return u;
           }



      The odd thing is that I can see the query running, i'm inclined to say that the url rewriting as stopped working.  the url is something like http://localhost:8080/bloggers/JohnA, and in pages.xml I see..



           <page view-id="/blog/view.xhtml">
                <param name="username" value="#{topicManager.username}"/>
                <rewrite pattern="/bloggers/{username}" />
           </page>



      the worst part is that this used to work just fine.  haven't changed the code.