Thank you, Sean, for the reply. However, i cannot afford to switch to Tree2 at the moment.
 
I have solved the problem, however, I still don't know why, and would like to hear from the experts.
 
remember in my posted snippets, I had (line 137 and 138):
 

134:                             selectedNodeClass="treenodeSelected"
135:                             expandRoot="true"
136:           var="testtreevar">
137:                   <x:treeSelectionListener type="#{MyTreeModel}"/>
138:                   <x:iconProvider type="#{MyTreeModel}"/>          
 

Those were defined in the config.xml as

     <managed-bean>
        <managed-bean-name>MyTreeModel</managed-bean-name>
        <managed-bean-class>my.jsf.MyTreeModel</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>

but as soon as I changed the jsp to 
137:                   <x:treeSelectionListener type="my.jsf.MyTreeModel"/>
138:                   <x:iconProvider type="my.jsf.MyTreeModel"/>          
  
it started to work.  So can someone tell me why this is the case?  Thanks.


 

On 6/7/06, Sean Schofield <[EMAIL PROTECTED]> wrote:
Not many users on this list are using the original tree these days.
Most seem to be using the new tree2.  You will probably get more
answers to your questions if you switch.

From your stacktrace it looks like your problem is a class cast
exception as opposed to a missing library (Class not found) problem.

Sean

On 6/7/06, Jim the Standing Bear < [EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I am new to myfaces and JSF. I am trying to create a webapp using the html
> tree, but it would give me the following exception.  Before, it worked
> because the code was written using the namespace
> org.apache.myfaces.examples.tree . but now I have
> refactored them to a different namespace (my.jsf) and got rid of some junk
> which I think we didn't need (apparently i was wrong), and problems started
> to emerge.
>
> Could someone give me a 101 lesson on what the dependencies are for the
> myfaces html tree?  Also what does this exception try to say? Thanks!
>
> Here are the jars I have in my WEB-INF/lib
>  commons-beanutils-1.6.1.jar
>  commons-codec-1.2.jar
>  commons-collections-3.0.jar
>  commons-digester-1.5.jar
>  commons-discovery.jar
>  commons-el.jar
>  commons-fileupload-1.0.jar
>  commons-logging.jar
>  commons-validator.jar
>  jakarta-oro-2.0.8.jar
>  myfaces.jar (I am still using an old version of myfaces, before it is
> separated into myfaces-core and tomahawk)
>  my-publish.jar (this is my compile)
>  servlet-2.3-jsp-1.2.jar
>  struts.jar
>  wsif.jar
>
>
> Here is the exception
>
>
> #### MyTreeModel getTreeModelListeners
> - Servlet.service() for servlet jsp threw exception
> java.lang.ClassCastException: my.jsf.MyTreeModel
>  at
> org.apache.myfaces.custom.tree.taglib.TreeSelectionListenerTag.doStartTag
> ( TreeSelectionListenerTag.java:92)
>  at
> org.apache.jsp.tree2_jsp._jspx_meth_x_treeSelectionListener_0(org.apache.jsp.tree2_jsp:1294)
>  at
> org.apache.jsp.tree2_jsp._jspx_meth_x_tree_0(org.apache.jsp.tree2_jsp:1268 )
>   at
> org.apache.jsp.tree2_jsp._jspx_meth_h_panelGroup_1(org.apache.jsp.tree2_jsp:1230)
>  at
> org.apache.jsp.tree2_jsp._jspx_meth_f_facet_1(org.apache.jsp.tree2_jsp:1194)
>  at org.apache.jsp.tree2_jsp._jspx_meth_x_panelLayout_0
> (org.apache.jsp.tree2_jsp:1161)
>  at
> org.apache.jsp.tree2_jsp._jspx_meth_h_panelGrid_7(org.apache.jsp.tree2_jsp:1124)
>  at
> org.apache.jsp.tree2_jsp._jspx_meth_h_panelGrid_5(org.apache.jsp.tree2_jsp:1024 )
>  at org.apache.jsp.tree2_jsp._jspx_meth_h_panelGrid_4
> (org.apache.jsp.tree2_jsp:973)
>  at
> org.apache.jsp.tree2_jsp._jspx_meth_h_panelGrid_2(org.apache.jsp.tree2_jsp:783)
>  at
> org.apache.jsp.tree2_jsp._jspx_meth_h_panelGrid_0(org.apache.jsp.tree2_jsp:360)
>  at org.apache.jsp.tree2_jsp._jspx_meth_h_form_0
> (org.apache.jsp.tree2_jsp:312)
>  at
> org.apache.jsp.tree2_jsp._jspx_meth_f_view_0 (org.apache.jsp.tree2_jsp:252)
>  at
> org.apache.jsp.tree2_jsp._jspService(org.apache.jsp.tree2_jsp:209)
>  at org.apache.jasper.runtime.HttpJspBase.service
> (HttpJspBase.java:97)
>  at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>  at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
>  at org.apache.jasper.servlet.JspServlet.serviceJspFile
> (JspServlet.java:314)
>  at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
>  at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>  at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> (ApplicationFilterChain.java:252)
>  at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>  at
> org.apache.catalina.core.ApplicationDispatcher.invoke (ApplicationDispatcher.java:672)
>  at
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
>  at
> org.apache.catalina.core.ApplicationDispatcher.doForward (ApplicationDispatcher.java:398)
>  at org.apache.catalina.core.ApplicationDispatcher.forward
> (ApplicationDispatcher.java:301)
>  at
> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch (ServletExternalContextImpl.java:405)
>  at
> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java
> :283)
>  at
> org.apache.myfaces.lifecycle.LifecycleImpl.render (LifecycleImpl.java:303)
>  at
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:113)
>  at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> (ApplicationFilterChain.java :252)
>  at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>  at
> org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java
> :112)
>  at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>  at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java :173)
>  at org.apache.catalina.core.StandardWrapperValve.invoke
> (StandardWrapperValve.java:213)
>  at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>  at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>  at org.apache.catalina.valves.ErrorReportValve.invoke
> (ErrorReportValve.java:105)
>  at
> org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:107)
>  at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>  at org.apache.coyote.http11.Http11AprProcessor.process
> (Http11AprProcessor.java :831)
>  at
> org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:639)
>  at
> org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1203)
>   at java.lang.Thread.run(Unknown Source)
> - Exception in JSP: /tree2.jsp:137
>
> 134:
> selectedNodeClass="treenodeSelected"
> 135:                             expandRoot="true"
> 136:           var="testtreevar">
> 137:                   <x:treeSelectionListener
> type="#{MyTreeModel}"/>
> 138:                   <x:iconProvider type="#{MyTreeModel}"/>
> 139:                   </x:tree>
> 140:                  </h:panelGroup>
>
>
>
> --
> --------------------------------------
> Standing Bear Has Spoken
> --------------------------------------



--
--------------------------------------
Standing Bear Has Spoken
--------------------------------------

Reply via email to