1 Reply Latest reply on Jun 19, 2008 7:30 AM by Sam Elstob

    Null Pointer Exception: org.richfaces.component.UITabPanel.q

    Sam Elstob Newbie

      I am consistently getting the NPE above.

      My JSP has a <rich:tabpanel> which is populated with a list of tabs dynamically

      <h:form id="main_form">
      <rich:tabpanel switchType="client" selectedTab="#{user.workspace.currentTabId}">
      <c:foreach
      items="#{user.workspace.openTabs}" var="tab">
      <rich:tab name="#{tab.id}" reRender="ajax_body">
      ...

      It seems to NPE on the first AJAX form submission. The form covers the entire page (and thus all tabs).

      Any ideas?

      apache-tomcat-6.0.16
      RichFaces 3.2.0-SR1 and 3.2.1
      MyFaces 1.2.3


      Libraries:

      antlr-2.7.6.jar dom4j-1.6.1.jar
      asm-attrs.jar ejb3-persistence.jar
      asm.jar facestrace-0.9.0.jar
      c3p0-0.9.1.jar hibernate3.jar
      cglib-2.1.3.jar hibernate-annotations.jar
      commons-beanutils-1.7.0.jar hibernate-commons-annotations.jar
      commons-chain-1.1.jar htmLib.jar
      commons-codec-1.3.jar jakarta-oro.jar
      commons-collections-3.2.jar jstl-1.2.jar
      commons-dbcp.jar jta.jar
      commons-digester-1.8.jar myfaces-api-1.2.3.jar
      commons-discovery-0.4.jar myfaces-impl-1.2.3.jar
      commons-fileupload-1.1.1.jar richfaces-api-3.2.0.SR1.jar
      commons-io-1.1.jar richfaces-impl-3.2.0.SR1.jar
      commons-logging-1.1.1.jar richfaces-ui-3.2.0.SR1.jar
      commons-pool.jar struts-core-1.3.8.jar
      commons-resources.jar struts-faces-1.3.8.jar
      commons-validator-1.3.1.jar struts-taglib-1.3.8.jar




      SEVERE: An exception occurred
      javax.faces.FacesException: Exception while decoding component : {Component-Path : [Class: org.ajax4jsf.component.AjaxViewRoot,ViewId: /test/dashabs.jsp][Class: javax.faces.component.html.HtmlForm,Id: main_form][Class: org.ajax4jsf.component.html.HtmlAjaxOutputPanel,Id: ajax_body][Class: org.ajax4jsf.component.html.HtmlAjaxOutputPanel,Id: j_id_jsp_700961821_64][Class: org.richfaces.component.html.HtmlTabPanel,Id: ajax_current_dashboard]}
      at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:566)
      at javax.faces.component.UIInput.decode(UIInput.java:184)
      at org.richfaces.component.UISwitchablePanel.processDecodes(UISwitchablePanel.java:169)
      at org.richfaces.component.UITabPanel.processDecodes(UITabPanel.java:146)
      at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:688)
      at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:688)
      at javax.faces.component.UIForm.processDecodes(UIForm.java:57)
      at org.ajax4jsf.component.AjaxViewRoot$1.invokeContextCallback(AjaxViewRoot.java:387)
      at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:234)
      at org.ajax4jsf.component.AjaxViewRoot.processDecodes(AjaxViewRoot.java:404)
      at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java:32)
      at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
      at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:148)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147)
      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:256)
      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:362)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:488)
      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:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.NullPointerException
      at org.richfaces.component.UITabPanel.queueEvent(UITabPanel.java:252)
      at javax.faces.event.FacesEvent.queue(FacesEvent.java:54)
      at org.richfaces.renderkit.TabPanelRendererBase.doDecode(TabPanelRendererBase.java:104)
      at org.ajax4jsf.renderkit.RendererBase.decode(RendererBase.java:76)
      at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:562)
      ... 31 more


      The code:

      public void queueEvent(FacesEvent event) {

      if(event instanceof SwitchablePanelSwitchEvent && this.equals(event.getComponent())){
      SwitchablePanelSwitchEvent switchEvent = (SwitchablePanelSwitchEvent)event;
      UITab tab = processedTab(switchEvent.getEventSource(),switchEvent.getValue());
      THIS LINE-> processedTabImmediate = tab.isImmediate();
      }

      if(event instanceof ActionEvent && event.getComponent()instanceof UITab){

      if(isImmediate()){
      event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
      }else{
      event.setPhaseId(PhaseId.INVOKE_APPLICATION);
      }

      }

        • 1. Re: Null Pointer Exception: org.richfaces.component.UITabPan
          Sam Elstob Newbie

          Sorry - libraries used are:

          antlr-2.7.6.jar
          asm-attrs.jar
          asm.jar
          c3p0-0.9.1.jar
          cglib-2.1.3.jar
          commons-beanutils-1.7.0.jar
          commons-chain-1.1.jar
          commons-codec-1.3.jar
          commons-collections-3.2.jar
          commons-dbcp.jar
          commons-digester-1.8.jar
          commons-discovery-0.4.jar
          commons-fileupload-1.1.1.jar
          commons-io-1.1.jar
          commons-logging-1.1.1.jar
          commons-pool.jar
          commons-resources.jar
          commons-validator-1.3.1.jar
          dom4j-1.6.1.jar
          ejb3-persistence.jar
          facestrace-0.9.0.jar
          hibernate3.jar
          hibernate-annotations.jar
          hibernate-commons-annotations.jar
          htmLib.jar
          jakarta-oro.jar
          jstl-1.2.jar
          jta.jar
          myfaces-api-1.2.3.jar
          myfaces-impl-1.2.3.jar
          richfaces-api-3.2.0.SR1.jar
          richfaces-impl-3.2.0.SR1.jar
          richfaces-ui-3.2.0.SR1.jar
          struts-core-1.3.8.jar
          struts-faces-1.3.8.jar
          struts-taglib-1.3.8.jar