Hi,
Tomcat 5.5, myface 1.1.3 and Tomahawk 1.1.3
I have a managed bean that hold a TreeModelBase.
This tree is feel with somme data.
I have an action that replace the TreeModelBase of the bean with new
empy one.
This action work.
After that, if i go to a any other page with any link i have an error.
i.e. :
a normal tree.jsf =>(1) go to an empytree.jsf =>(2) go to any other jsf
(1) ok
(2) error after Phase APPLY_REQUEST_VALUES(2)
ERROR http-8080-Processor23
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/siteexo].[Fa
cesServlet] - "Servlet.service()" pour la servlet FacesServlet a lancé une
exception
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at
org.apache.myfaces.custom.tree2.TreeModelBase.getNodeById(TreeModelBase.java
:139)
at
com.me.bean.tree.PanierTreeState.isNodeExpanded(PanierTreeState.java:28)
at
org.apache.myfaces.custom.tree2.TreeWalkerBase.next(TreeWalkerBase.java:103)
at
org.apache.myfaces.custom.tree2.UITreeData.processNodes(UITreeData.java:489)
at
org.apache.myfaces.custom.tree2.UITreeData.processDecodes(UITreeData.java:17
1)
at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:60
2)
at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:60
2)
at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:60
2)
at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:60
2)
at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:60
2)
at
javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:135)
at
org.apache.myfaces.lifecycle.LifecycleImpl.applyRequestValues(LifecycleImpl.
java:219)
at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:71)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:672)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDis
patcher.java:463)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:398)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:301)
at
org.tuckey.web.filters.urlrewrite.RewrittenUrl.doRewrite(RewrittenUrl.java:1
76)
at
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter
.java:728)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at com.me.filter.HibernateFilter.doFilter(HibernateFilter.java:33)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.
java:144)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va: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.Http11Processor.process(Http11Processor.java:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processC
onnection(Http11BaseProtocol.java:664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav
a:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo
rkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:684)
at java.lang.Thread.run(Thread.java:595)
But at this time, my tree is empty an the runtime take the old tree delete
on (1) for this error (i print it to verify)
The PanierTreeState.isNodeExpanded is customise like this :
public boolean isNodeExpanded(String nodeId) {
TreeNode tn=null;
System.out.print("isNodeExpanded nodeId: "+nodeId+" ");
tn=model.getNodeById(nodeId);
if (tn.getChildCount()>0) return true;
return false;
}
For expand every node that is not a leaf.
When i surround with try catch i have this output :
isNodeExpanded nodeId: 0:0:3:0:0
isNodeExpanded nodeId: 0:0:3:0:1
isNodeExpanded nodeId: 0:0:3:0:2
isNodeExpanded nodeId: 0:0:3:0:3
isNodeExpanded nodeId: 0:0:3:0:4
isNodeExpanded nodeId: 0:0:3:0:5
isNodeExpanded nodeId: 0:0:3:0:6
isNodeExpanded nodeId: 0:0:3:0:7
(...)
isNodeExpanded nodeId: 0:0:3:0:21279
(...).....
(kill process)
If i remove my custom "isNodeExpanded" and expand all nodes with
"toggleExpanded",
i have got an output that say the same thing at the same moment.
How can I avoid this ?
Is this a bug from tree 2 ?
Many thanks,
Igor.