jsf - <t:panelNavigation2> causes javax.faces.FacesException: Cannot add the same component twice -


i using tomahawk20 1.1.14 jsf 2.0 on wildfly 8.2.0. when using <t:panelnagivation2>, below exception thrown:

javax.faces.facesexception: cannot add same component twice 

how caused , how can solve it? here stack trace:

caused by: javax.faces.facesexception: cannot add same component twice: nav:panel-nav:nav_panel-nav_uinavmitem1     @ com.sun.faces.context.statecontext$dynamicaddremovelistener.handleaddremovewithautoprune(statecontext.java:751) [jsf-impl-2.2.8-jbossorg-1.jar:]     @ com.sun.faces.context.statecontext$dynamicaddremovelistener.handleadd(statecontext.java:678) [jsf-impl-2.2.8-jbossorg-1.jar:]     @ com.sun.faces.context.statecontext$addremovelistener.processevent(statecontext.java:352) [jsf-impl-2.2.8-jbossorg-1.jar:]     @ com.sun.faces.context.statecontext$dynamicaddremovelistener.processevent(statecontext.java:568) [jsf-impl-2.2.8-jbossorg-1.jar:]     @ javax.faces.event.systemevent.processlistener(systemevent.java:108) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]     @ javax.faces.event.componentsystemevent.processlistener(componentsystemevent.java:118) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]     @ com.sun.faces.application.applicationimpl.processlistenersaccountingforadds(applicationimpl.java:2239) [jsf-impl-2.2.8-jbossorg-1.jar:]     @ com.sun.faces.application.applicationimpl.invokeviewlistenersfor(applicationimpl.java:2057) [jsf-impl-2.2.8-jbossorg-1.jar:]     @ com.sun.faces.application.applicationimpl.publishevent(applicationimpl.java:292) [jsf-impl-2.2.8-jbossorg-1.jar:]     @ com.sun.faces.application.applicationimpl.publishevent(applicationimpl.java:247) [jsf-impl-2.2.8-jbossorg-1.jar:]     @ org.jboss.as.jsf.injection.weld.forwardingapplication.publishevent(forwardingapplication.java:299) [wildfly-jsf-injection-8.2.0.final.jar:8.2.0.final]     @ javax.faces.component.uicomponentbase.publishafterviewevents(uicomponentbase.java:2253) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]     @ javax.faces.component.uicomponentbase.dopostaddprocessing(uicomponentbase.java:1934) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]     @ javax.faces.component.uicomponentbase.setparent(uicomponentbase.java:447) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]     @ org.apache.myfaces.custom.navmenu.htmlnavmenu.htmlnavigationmenurenderer.adduinavigationmenuitems(htmlnavigationmenurenderer.java:355) [tomahawk20-1.1.14.jar:1.1.14]     @ org.apache.myfaces.custom.navmenu.htmlnavmenu.htmlnavigationmenurenderer.preprocessnavigationitems(htmlnavigationmenurenderer.java:340) [tomahawk20-1.1.14.jar:1.1.14]     @ org.apache.myfaces.custom.navmenu.htmlnavmenu.htmlnavigationmenurenderer.encodeend(htmlnavigationmenurenderer.java:175) [tomahawk20-1.1.14.jar:1.1.14]     @ javax.faces.component.uicomponentbase.encodeend(uicomponentbase.java:919) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]     @ javax.faces.component.uicomponent.encodeall(uicomponent.java:1863) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]     @ javax.faces.render.renderer.encodechildren(renderer.java:176) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]     @ javax.faces.component.uicomponentbase.encodechildren(uicomponentbase.java:889) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]     @ javax.faces.component.uicomponent.encodeall(uicomponent.java:1856) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]     @ javax.faces.component.uicomponent.encodeall(uicomponent.java:1859) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]     @ com.sun.faces.application.view.faceletviewhandlingstrategy.renderview(faceletviewhandlingstrategy.java:456) [jsf-impl-2.2.8-jbossorg-1.jar:]     @ com.sun.faces.application.view.multiviewhandler.renderview(multiviewhandler.java:133) [jsf-impl-2.2.8-jbossorg-1.jar:]     @ javax.faces.application.viewhandlerwrapper.renderview(viewhandlerwrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]     @ org.apache.myfaces.tomahawk.application.resourceviewhandlerwrapper.renderview(resourceviewhandlerwrapper.java:169) [tomahawk20-1.1.14.jar:1.1.14]     @ javax.faces.application.viewhandlerwrapper.renderview(viewhandlerwrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]     @ javax.faces.application.viewhandlerwrapper.renderview(viewhandlerwrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]     @ com.sun.faces.lifecycle.renderresponsephase.execute(renderresponsephase.java:120) [jsf-impl-2.2.8-jbossorg-1.jar:]     @ com.sun.faces.lifecycle.phase.dophase(phase.java:101) [jsf-impl-2.2.8-jbossorg-1.jar:]     @ com.sun.faces.lifecycle.lifecycleimpl.render(lifecycleimpl.java:219) [jsf-impl-2.2.8-jbossorg-1.jar:]     @ javax.faces.webapp.facesservlet.service(facesservlet.java:647) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]     ... 20 more 

downgrading wildfly use jsf 2.1.29-04 (which latest 2.1.x version) throws following error:

caused by: java.lang.classnotfoundexception: javax.faces.view.viewscoped [module "org.jboss.as.jsf:main" local module loader @15b3e5b (finder: local module finder @61ca2dfa (roots: /wildfly_8.2.0_final_acd/wildfly_8.2.0_final_acd/modules,/wildfly_8.2.0_final_acd/wildfly_8.2.0_final_acd/modules/system/layers/base))] @ org.jboss.modules.moduleclassloader.findclass(moduleclassloader.java:213) @ org.jboss.modules.concurrentclassloader.performloadclassunchecked(concurrentclassloader.java:459) @ org.jboss.modules.concurrentclassloader.performloadclasschecked(concurrentclassloader.java:408) @ org.jboss.modules.concurrentclassloader.performloadclass(concurrentclassloader.java:389) @ org.jboss.modules.concurrentclassloader.loadclass(concurrentclassloader.java:134) ... 24 more 

and in effect class

javax.faces.view.viewscoped 

is missing in jsf-api.jar

tomahawk jsf 2.0 not compatible jsf 2.2. components may work, others may not work. <t:panelnavigation2> such one. exception faced consequence of bug in dynamic component tree manipulation (which used workaround old jsf 1.x bug in tracking programmatic component tree changes).

you have 2 options:

  1. downgrade jsf 2.1/2.0. can use same instructions answered here: upgrade jsf / mojarra in jboss / eap / wildfly you'll miss jsf 2.2 specific features.

  2. or, drop tomahawk. myfaces stopped development of tomahawk (at least, isn't maintained anymore years). lot of utilities/enhancements taken on in standard jsf. visual components, ui component library such primefaces, or use "plain vanilla" html/css (if don't consider ie6/7 supported browsers, menus relatively trivial <ul><li> , bit of css).


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -