0 Replies Latest reply on Oct 10, 2007 10:27 AM by Rob Guest

    Expression Language error on startup using tree-demo sample

    Rob Guest Newbie

      Can you help me figure out why I am getting a javax.el.ELException when I am using code from the sample tree-demo?

      The server output:


      Oct 10, 2007 10:49:39 AM com.sun.facelets.FaceletViewHandler handleRenderException
      SEVERE: Error Rendering View[/login.xhtml]
      javax.el.ELException: /login.xhtml: Bean: com.ridan.cgtip.ui.bean.RichTreeBean, property: onExpand
      at com.sun.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:53)
      at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39)
      at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:232)
      at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
      at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
      at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
      at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
      at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
      at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
      at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:100)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
      at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
      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:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Unknown Source)


      I have taken the index.jsp and converted it to a facelets-style xhtml page.
      <?xml version="1.0" encoding="UTF-8"?>
      <ui:composition
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
       xmlns:rich="richfaces.ajax4jsf.org/rich"
       >
       <ui:define name="container2Contents">
       <a4j:outputPanel ajaxRendered="true">
       <h:messages />
       </a4j:outputPanel>
      
       <h:form>
      
       <h:outputText value="Render facets:" />
       <h:selectOneRadio value="#{RichTreeBean.renderFacets}" onclick="submit()">
       <f:selectItem itemLabel="true" itemValue="#{true}" />
       <f:selectItem itemLabel="false" itemValue="#{false}" />
       </h:selectOneRadio>
      
       <br />
       <rich:tree id="tree" switchType="ajax"
       value="#{RichTreeBean.data}" var="data"
       nodeFace="#{data.name != 'param-value' ? 'input' : 'text'}"
       changeExpandListener="#{RichTreeBean.onExpand}"
       nodeSelectListener="#{RichTreeBean.onSelect}" binding="#{RichTreeBean.tree}"
       onselected="window.status='selectedNode: '+event.selectedNode;"
       onexpand="window.status='expandedNode: '+event.expandedNode"
       oncollapse="window.status='collapsedNode: '+event.collapsedNode"
       ajaxSubmitSelection="true" reRender="outputText, selectOneListbox"
       preserveModel="none"
       dragIndicator="treeIndicator"
       immediate="false"
      
       iconCollapsed="#{RichTreeBean.iconCollapsed}"
       iconExpanded="#{RichTreeBean.iconExpanded}"
       iconLeaf="#{RichTreeBean.iconLeaf}"
       icon="#{RichTreeBean.icon}"
       >
      
       <f:facet name="icon">
       <h:outputText value="icon" rendered="#{RichTreeBean.renderFacets}"/>
       </f:facet>
      
       <f:facet name="iconLeaf">
       <h:outputText value="leaf" rendered="#{RichTreeBean.renderFacets}"/>
       </f:facet>
      
       <f:facet name="iconExpanded">
       <h:outputText value="expanded" rendered="#{RichTreeBean.renderFacets}"/>
       </f:facet>
      
       <f:facet name="iconCollapsed">
       <h:outputText value="collapsed" rendered="#{RichTreeBean.renderFacets}"/>
       </f:facet>
      
       <rich:treeNode type="input" oncollapse="Element.removeClassName(event['treeItem'].getElement(), 'colored')" onexpand="Element.addClassName(event['treeItem'].getElement(), 'colored')">
       <h:outputText value="#{data} : " />
       <h:inputText value="#{data.name}" required="true" styleClass="inputs">
       </h:inputText>
      
       </rich:treeNode>
       <rich:treeNode type="text" nodeClass="customNode" acceptedTypes="file2" onselected="return false;">
       <h:outputText value="#{data}" />
       </rich:treeNode>
       </rich:tree>
      
       <h:outputText value="Enter path to expand, eg. [webApp_:id__1 , webApp_:id__1:7 ]:" />
       <h:inputText value="#{RichTreeBean.pathToExpand}">
       <a4j:support event="onchange" reRender="tree" action="#{RichTreeBean.expandNode}"/>
       </h:inputText>
      
       <f:verbatim>
       <br />
       <br />
       </f:verbatim>
      
       <rich:tree id="testTree"
       var="_data"
       switchType="ajax"
       ajaxSubmitSelection="true"
       preserveModel="none"
       value="#{RichTreeBean.data1}"
       nodeSelectListener="#{RichTreeBean.onSelectInc}"
       nodeFace="node">
       <rich:treeNode type="node">
       <h:outputText value="#{_data}" />
       </rich:treeNode>
       </rich:tree>
       </h:form>
       <a4j:status startText="...start..." />
       <a4j:log hotkey="O" />
       </ui:define>
      </ui:composition>
      


      I basically just renamed the Bean class in the sample to RichTreeBean and that's it.
      The Exception seems to be thrown when parsing this line in index.xhtml:
      changeExpandListener="#{RichTreeBean.onExpand}"

      "onExpand" is a valid method in RichTreeBean so I am stumped. Any ideas about what is causing this?

      Thanks,
      Rob