1 Reply Latest reply on Dec 15, 2011 10:17 AM by gadeyne.bram

    Richfaces 3.3.3 NodeSelectedListener

    gadeyne.bram Master

      Hi,

       

      I'm working with seam 2.2.2 Final witch contains RIchfaces 3.3.3.

       

      I'm trying to get the selected value from a rich:tree to a backingbean property. The tree nodes are shown perfectly but when I click on one a debug page occurs (see stacktraces below).

       

      Here's my jsf tag

       

      <h:form>

                  <rich:tree switchType="client" ajaxSubmitSelection="true">

                      <rich:nodeSelectListener binding="#{newInfectionController}"></rich:nodeSelectListener>

                      <rich:recursiveTreeNodesAdaptor roots="#{newInfectionController.roots}" var="item" nodes="#{item.enumses}">

                          <rich:treeNode>

                              <h:outputText value="#{item.key}" />

                          </rich:treeNode>

                      </rich:recursiveTreeNodesAdaptor>

                  </rich:tree>

      </h:form>

       

      Here's my backingbean

       

      @Name("newInfectionController")

      @Scope(ScopeType.SESSION)

      public class NewInfectionController implements NodeSelectedListener {

       

      @Override

          public void processSelection(NodeSelectedEvent event)

                  throws AbortProcessingException {

              try{

                  log.info("selected value was {0}", event);

                  UIComponent comp=(UIComponent) event.getSource();

                  boolean found=false;

                  while(comp!=null){

                      found=(comp.getClass().equals(HtmlTree.class));

                      comp=comp.getParent();

                      log.info("class was {0}", comp);

                  }

                  if(!found)

                      return;

                 

                  HtmlTree tree=(HtmlTree) comp;

                  log.info("selected value was {0}", tree.getData());

                 

              }catch(Exception e){

                  log.error("error with selecting value",e);

              }

             

          }

      }

       

      The first log.info shows up in the logs and displays: selected value was org.richfaces.event.AjaxSelectedEvent[source=org.richfaces.component.html.HtmlTree@4dc79451]

       

      Now I get a debugpage from seam with 2 stacktraces

      Caused by javax.servlet.ServletException with message: ""

      javax.faces.webapp.FacesServlet.service(FacesServlet.java:321)

      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)

      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)

      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)

      org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)

      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)

      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)

      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)

      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)

      org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

      org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)

      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

      org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)

      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)

      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)

      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)

      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)

      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)

      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)

      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)

      org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)

      org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)

      org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)

      org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)

      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159)

      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

      org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

      org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)

      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)

      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)

      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)

      java.lang.Thread.run(Thread.java:662)

       

      Caused by java.lang.reflect.InvocationTargetException with message: ""

      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      java.lang.reflect.Method.invoke(Method.java:597)

      org.jboss.seam.util.Reflections.invoke(Reflections.java:22)

      org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)

      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)

      org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)

      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

      org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)

      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

      org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)

      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

      org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)

      org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

      org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)

      org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)

      org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)

      be.ugent.cosara2.infectionoverview.controller.NewInfectionController_$$_javassist_seam_8.processSelection(NewInfectionController_$$_javassist_seam_8.java)

      org.richfaces.event.NodeSelectedEvent.processListener(NodeSelectedEvent.java:63)

      javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:773)

      javax.faces.component.UIData.broadcast(UIData.java:890)

      org.ajax4jsf.component.UIDataAdaptorBase.broadcast(UIDataAdaptorBase.java:1373)

      org.richfaces.component.UITree.broadcast(UITree.java:586)

      org.ajax4jsf.component.UIDataAdaptorBase.broadcast(UIDataAdaptorBase.java:1387)

      org.richfaces.component.UITree.broadcast(UITree.java:586)

      org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:329)

      org.ajax4jsf.component.AjaxViewRoot.broadcastEventsForPhase(AjaxViewRoot.java:304)

      org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:261)

      org.ajax4jsf.component.AjaxViewRoot.processUpdates(AjaxViewRoot.java:440)

      com.sun.faces.lifecycle.UpdateModelValuesPhase.execute(UpdateModelValuesPhase.java:74)

      com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)

      com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)

      javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)

      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)

      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)

      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)

      org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)

      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)

      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)

      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)

      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)

      org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

      org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)

      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

      org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)

      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)

      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)

      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)

      org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)

      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)

      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)

      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)

      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)

      org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)

      org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)

      org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)

      org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)

      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159)

      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

      org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

      org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)

      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)

      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)

      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)

      java.lang.Thread.run(Thread.java:662)

       

      Would anyone know what I can do to resolve this issue?

       

      Kind regards

      Bram