3 Replies Latest reply on Feb 12, 2010 7:08 AM by nbelaevski

    rich:tree getting exception after migration 3.1.4 to 3.3.2 G

      Hello Friends,

      I am using richfaces 3.1.4 GA version for long time and used rich:tree in my application.
      Now I am upgrading richfaces 3.1.4 GA to 3.3.2 GA.
      I am getting this exception when my jsf page contains rich:tree and any event happens in page like onchange of list box with a4j:support.
      This exception does not break my functionality but we can not live with exception also. Below is the exception -


      java.lang.IllegalStateException: No tree element available or row key not set!
      at org.richfaces.model.TreeDataModel.getRowData(TreeDataModel.java:284)
      at org.ajax4jsf.component.UIDataAdaptor.getRowData(UIDataAdaptor.java:257)
      at caf.opm.preclosing.os.view.DealTreeBean.getActualNode(DealTreeBean.java:796)
      at caf.opm.preclosing.os.view.DealTreeBean.isInSameDeal(DealTreeBean.java:822)
      at caf.opm.preclosing.os.view.DealTreeBean$$FastClassByCGLIB$$f794618d.invoke()
      at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
      at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:695)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
      at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
      at caf.opm.preclosing.common.exception.handler.ExceptionHandlerAdvice.manageExceptionAround(ExceptionHandlerAdvice.java:31)
      at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:576)
      at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:562)
      at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:60)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
      at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:630)



      Please let me know if more details needed.
      Thanks in advance.

      Cheers,
      Ashish

        • 1. Re: rich:tree getting exception after migration 3.1.4 to 3.3
          ilya_shaikovsky

          show the page and model code.

          • 2. Re: rich:tree getting exception after migration 3.1.4 to 3.3
            jmiguel77

            hi

             

            i have the same problem with richfaces 3.3.0

             

            the xhtml page code is this

             

            <rich:modalPanel id="accountFormPanel" width="300" height="300">

            <f:facet name="header">

            <h:outputText value="Seleccionar cuenta" />

            </f:facet>

            <f:facet name="controls">

            <h:graphicImage value="/img/paginas/cancel.png"

            onclick="#{rich:component('accountFormPanel')}.hide()" />

            </f:facet>

            <a4j:outputPanel id="accountTreePanel" layout="block"

            ajaxRendered="true">

            <a4j:form>

            <rich:tree id="accountsTree"

            binding="#{asientoController.accountTree}"

            value="#{asientoDataManager.nodoRaiz}" var="item"

            switchType="ajax" ajaxSubmitSelection="true">

            <rich:treeNode id="cuentaTreeNode" data="#{item}">

            <h:outputText value="#{item.ctNemonico} : #{item.ctDescripcion}"

            style="color:#{item.vigente?'black':'red'}" />

            </rich:treeNode>

            </rich:tree>

            <a4j:commandButton id="selectAccountCommandButton"

            value="Seleccionar"

            actionListener="#{asientoController.selectAccountActionListener}"

            reRender="movimientoFormPanel"

            oncomplete="#{rich:component('accountFormPanel')}.hide()" />

            </a4j:form>

            </a4j:outputPanel>

            </rich:modalPanel>

             

            when i hit the selectAccountCommandButton and execute the selectAccountActionListener method i get the same error:

             

            No tree element available or row key not set!

             

            i have tried this way:

             

            Object data = getAccounstTree().getRowData();

             

            and

             

            final Object rowKey = getAccountTree().getRowKey();

            final Object rowData = getAccountTree().getRowData(rowKey);

             

            but both fail; i have noticed that the rowKey is null; i will try with the 3.3.2-SR1

             

            please help

            • 3. Re: rich:tree getting exception after migration 3.1.4 to 3.3
              nbelaevski

              Hi,

               

              As "selectAccountCommandButton" component is external to tree component, it is not executed in the context of particular node. Thus exception is thrown when you request row data. You should either do setRowKey() before requesting data or check if row data is available using isRowAvailable() method.