Sunday, 15 September 2013

jsf - MyFaces: all pages throw duplicate id error after enabled partial state saving -



jsf - MyFaces: all pages throw duplicate id error after enabled partial state saving -

in jsf 2.2 project primefaces (currently latest: 5.1) have had problems <p:fileupload>. in multi upload scenario randomly selected files not uploaded. problem solved enabled partial state saving (pss) in web.xml:

<context-param> <param-name>javax.faces.partial_state_saving</param-name> <param-value>true</param-value> </context-param>

now after enabling pss, pages throw duplicate id exception (although there no duplicate0. have crud pages <p:datatable> , binding view-scoped beans. when switch mojarra duplicate id errors gone, reasons want work myfaces. there workaround? bug myfaces.

i'm using myfaces 2.2.5. , here related part of stack trace (at line 90, have first <p:column> within <p:datatable>):

2014-11-01 11:31:51,390 error <admin> unhandled exception on component null during phase render_response(6): org.apache.myfaces.view.facelets.compiler.duplicateidexception: component duplicate id "form:keyworddatatable:j_id_39" found. first component /admin/keyword.xhtml @ line 90 , column 99 @ org.apache.myfaces.view.facelets.compiler.checkduplicateidfaceletutils.createandqueueexception(checkduplicateidfaceletutils.java:152) ~[myfaces-impl-2.2.5.jar:2.2.5] @ org.apache.myfaces.view.facelets.compiler.checkduplicateidfaceletutils.checkids(checkduplicateidfaceletutils.java:107) ~[myfaces-impl-2.2.5.jar:2.2.5] @ org.apache.myfaces.view.facelets.compiler.checkduplicateidfaceletutils.checkids(checkduplicateidfaceletutils.java:124) ~[myfaces-impl-2.2.5.jar:2.2.5] @ org.apache.myfaces.view.facelets.compiler.checkduplicateidfaceletutils.checkids(checkduplicateidfaceletutils.java:124) ~[myfaces-impl-2.2.5.jar:2.2.5] @ org.apache.myfaces.view.facelets.compiler.checkduplicateidfaceletutils.checkids(checkduplicateidfaceletutils.java:124) ~[myfaces-impl-2.2.5.jar:2.2.5] @ org.apache.myfaces.view.facelets.compiler.checkduplicateidfaceletutils.checkids(checkduplicateidfaceletutils.java:124) ~[myfaces-impl-2.2.5.jar:2.2.5] @ org.apache.myfaces.view.facelets.compiler.checkduplicateidfaceletutils.checkids(checkduplicateidfaceletutils.java:89) ~[myfaces-impl-2.2.5.jar:2.2.5] @ org.apache.myfaces.view.facelets.defaultfaceletsstatemanagementstrategy.saveview(defaultfaceletsstatemanagementstrategy.java:688) ~[myfaces-impl-2.2.5.jar:2.2.5] @ org.apache.myfaces.application.statemanagerimpl.saveview(statemanagerimpl.java:213) ~[myfaces-impl-2.2.5.jar:2.2.5] @ javax.faces.application.statemanager.getviewstate(statemanager.java:262) ~[myfaces-api-2.2.5.jar:2.2.5] @ org.apache.myfaces.context.servlet.partialviewcontextimpl.processpartialrendering(partialviewcontextimpl.java:581) ~[myfaces-impl-2.2.5.jar:2.2.5] @ org.apache.myfaces.context.servlet.partialviewcontextimpl.processpartial(partialviewcontextimpl.java:415) ~[myfaces-impl-2.2.5.jar:2.2.5] @ org.primefaces.context.primepartialviewcontext.processpartial(primepartialviewcontext.java:60) ~[primefaces-5.1.1-ur.jar:5.1.1-ur] @ javax.faces.context.partialviewcontextwrapper.processpartial(partialviewcontextwrapper.java:85) ~[myfaces-api-2.2.5.jar:2.2.5] @ javax.faces.component.uiviewroot.encodechildren(uiviewroot.java:516) ~[myfaces-api-2.2.5.jar:2.2.5] @ javax.faces.component.uicomponentbase.encodeall(uicomponentbase.java:541) ~[myfaces-api-2.2.5.jar:2.2.5] @ org.apache.myfaces.view.facelets.faceletviewdeclarationlanguage.renderview(faceletviewdeclarationlanguage.java:1891) ~[myfaces-impl-2.2.5.jar:2.2.5] @ org.apache.myfaces.application.viewhandlerimpl.renderview(viewhandlerimpl.java:313) ~[myfaces-impl-2.2.5.jar:2.2.5] @ javax.faces.application.viewhandlerwrapper.renderview(viewhandlerwrapper.java:58) ~[myfaces-api-2.2.5.jar:2.2.5] @ org.apache.myfaces.lifecycle.renderresponseexecutor.execute(renderresponseexecutor.java:116) ~[myfaces-impl-2.2.5.jar:2.2.5] @ org.apache.myfaces.lifecycle.lifecycleimpl.render(lifecycleimpl.java:267) ~[myfaces-impl-2.2.5.jar:2.2.5] @ javax.faces.webapp.facesservlet.service(facesservlet.java:200) [myfaces-api-2.2.5.jar:2.2.5] @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:305) [catalina.jar:7.0.47] @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210) [catalina.jar:7.0.47] @ org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:51) [tomcat7-websocket.jar:7.0.47] @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:243) [catalina.jar:7.0.47] @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210) [catalina.jar:7.0.47]

just reference, jsf spec section 3.1.5 component binding says: "... if application developers place managed beans pointed @ component binding expressions in scope other request scope, scheme cannot behave correctly.... there potentially negative impacts on memory management when placing component binding in “session” or “view” scopes. ..."

jsf jsf-2 primefaces myfaces

No comments:

Post a Comment