voyent
Cannot add the same component twice: vaz4n2-retrieve-update  XML
Forum Index -> General Help
Author Message
mcyk87

Joined: 10/Jul/2013 06:00:40
Messages: 1
Offline


Hi, I new to ICEfaces and I tried out tutorial from this link, http://www.icesoft.org/wiki/display/ICE/Creating+ICEfaces+Applications+with+Eclipse

When I click on "debug as", using tomcat 7, I get this error:

javax.faces.FacesException: Cannot add the same component twice: vaz4n2-retrieve-update
at com.sun.faces.context.StateContext$AddRemoveListener.handleAddRemoveWithAutoPrune(StateContext.java:510)
at com.sun.faces.context.StateContext$AddRemoveListener.handleAdd(StateContext.java:437)
at com.sun.faces.context.StateContext$AddRemoveListener.processEvent(StateContext.java:359)
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106)
at com.sun.faces.application.ApplicationImpl.processListenersAccountingForAdds(ApplicationImpl.java:2212)
at com.sun.faces.application.ApplicationImpl.invokeViewListenersFor(ApplicationImpl.java:2033)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:292)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:247)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2207)
at javax.faces.component.UIComponentBase.doPostAddProcessing(UIComponentBase.java:1889)
at javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:406)
at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2641)
at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2613)
at org.icefaces.impl.event.BridgeFormsSetup.addNewTransientForm(BridgeFormsSetup.java:51)
at org.icefaces.impl.event.BridgeFormsSetup.processEvent(BridgeFormsSetup.java:36)
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106)
at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2163)
at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2139)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:303)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:247)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:818)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1777)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:439)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:124)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)



Please advise. Thanks alot:)
samsundark

Joined: 12/Nov/2008 00:00:00
Messages: 5
Offline


Hi Even I am facing the same problem after migrating to latest version 3.3.0. Can anyone help please.
dipak_icefaces

Joined: 10/Aug/2013 01:09:07
Messages: 1
Offline


Please help me any one
Even I also got the same error....

javax.faces.FacesException: Cannot add the same component twice: v6qzcg2-retrieve-update
at com.sun.faces.context.StateContext$AddRemoveListener.handleAddRemoveWithAutoPrune(StateContext.java:510)
at com.sun.faces.context.StateContext$AddRemoveListener.handleAdd(StateContext.java:437)
at com.sun.faces.context.StateContext$AddRemoveListener.processEvent(StateContext.java:359)
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106)
at com.sun.faces.application.ApplicationImpl.processListenersAccountingForAdds(ApplicationImpl.java:2212)
at com.sun.faces.application.ApplicationImpl.invokeViewListenersFor(ApplicationImpl.java:2033)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:292)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:247)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2207)
at javax.faces.component.UIComponentBase.doPostAddProcessing(UIComponentBase.java:1889)
at javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:406)
at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2641)
at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2613)
at org.icefaces.impl.event.BridgeFormsSetup.addNewTransientForm(BridgeFormsSetup.java:51)
at org.icefaces.impl.event.BridgeFormsSetup.processEvent(BridgeFormsSetup.java:36)
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106)
at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2163)
at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2139)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:303)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:247)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:818)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1777)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:439)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:124)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2989
Offline


Hi,
Could be an old version of JSF. Double check the server logs to see which version of Mojarra is loading. Make sure that you have the javax.faces.jar from the ICEfaces 3.3 bundle included in your web app lib dir.

Philip

.
ssiddique

Joined: 17/Nov/2009 00:00:00
Messages: 3
Offline


Ok, I had an exact same issue. After banging my head a bit, it turns out to be due to recent version of tomcat (7.0.42)

my ver of icefaces works on tomcat 7.0.41 but NOT on 7.0.42 (and I get the exact same error: "Cannot add the same component twice... "). After reverting to 7.0.41, the problem is gone

Hope this helps someone else.
philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2989
Offline


I can't reproduce on Tomcat 7.0.42 with the 3.3 trunk (Mojarra 2.1.21). What version of Mojarra are you using? When exactly do you get the error?

Philip

.
damonh

Joined: 17/Jul/2013 19:35:41
Messages: 1
Offline


I also had this same problem with Tomcat 7.0.42, ICEfaces 3.3.0, and Mojarra 2.1.25. ssiddique's recommendation of rolling back to Tomcat 7.0.41 works. Thanks
philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2989
Offline


I'm not sure the problem really has anything to do with Tomcat. ICEfaces uses a JSF system event listener to add some custom forms to the page. If you accidentally include multiple ICEfaces jars (including the icefaces.jar and icefaces-ee.jar) then the listener can be registered twice, leading to this error. So double check your applications and ensure that only one icefaces.jar or icefaces-ee.jar are on the classpath. I've created a jira for this for us to test for this configuration error if you'd like to vote for it: http://jira.icesoft.org/browse/ICE-9595


Thanks,
Philip

.
tneedham

Joined: 01/Mar/2013 20:59:15
Messages: 1
Offline


I've encountered this problem and found two things that cause it.

The first was I had a Menu.xhtml files that was included in the my other pages with a Code:
<ui:include src="Menu.xhtml"/>
tag but I hadn't surrounded the body of my Menu.xhtml code with Code:
<ui:composition>
. This used to work with ICEfaces 2.0.2 but I guess 3.3.0 is more strict.

The second problem, and the one related to this thread, was that I had upgraded to Tomcat 7.0.42. You're right that if I revert to version 7.0.41 then the problem goes away but before I discovered this thread I found that removing the listener com.sun.faces.config.ConfigureListener from my Web.xml solved the problem.

With Tomcat 7.0.22 (and I assume .41) I got an INFO log message telling me
INFO: The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored. 

but in Tomcat 7.0.42 that log message doesn't appear so it does appear to load the configuration twice, and then complain about it. This could indicate a bug or change in Tomcat that doesn't look out for duplicate configurations.

This isn't a good solution for me as I need to specify the order that listeners are loaded, which is why this is in the Web.xml in the first place, so I'll be looking out for a resolution to this issue. Does anyone know what causes that listener to get loaded if it's not specified in Web.xml?
orwtech

Joined: 03/Dec/2013 04:40:45
Messages: 2
Offline


Had the same issue.

Removing this from the web.xml fixed it for me:

Code:
 <listener>
   <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
 </listener>
 



Versions:

javax.faces.jar 2.1.21
Tomcat 7.0.50
IceFaces 3.3.0
sosarf


Joined: 19/Oct/2010 07:19:05
Messages: 18
Offline


Under Weblogic 10.3.6.0.5 and jdk_1.6.0_45 I have this issue:

On my local Machine:
S.O. Windows 7

javax.faces.FacesException: Cannot add the same component twice: ve5spd2-retrieve-update

On the testing machine:
> uname -a
S.O. Linux tbmwnt27 2.6.32-358.23.2.el6.x86_64 #1 SMP Sat Sep 14 05:32:37 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
everything works fine

Does anybody know how to fix this problem?

Thanks in advance
sosarf


Joined: 19/Oct/2010 07:19:05
Messages: 18
Offline


I found which was my problem on my local machine.

As a test, I create a new weblogic domain but not on development mode as I used to do when I work on Eclipse, but in Production mode. And manually deployed the ear and everything works fine.

It seems that there’s a problem between the development mode of Weblogic and Icefaces, does anybody knows something about it?
faber

Joined: 25/Jun/2010 02:55:11
Messages: 14
Offline


I can add another mysterious solution:

When I use h:head and h:body within my xhtml, I get this
"Cannot add the same component twice" error.
When I change it back to head and body, the xhtml is being displayed.

Is this logical, does it make sense, is this desired behaviour/solution?

Edit 27.05.2014:
The "mistake" to not being able to use h:head and h:body was to use all the html, head and body tags within the included xhtml which only should contain ui:composition, nothing more. Once I removed the <html>, <head> and <body> tags from the included xhtml, everything works as it should now when I use h:head and h:body in the including xhtml. Seems that JSF2/ICEfaces 3 are much more strict in this behaviour than old JSF1.2/ICEfaces 1.8.2.
bfuller18

Joined: 06/May/2014 11:50:53
Messages: 47
Offline


orwtech wrote:
Had the same issue.

Removing this from the web.xml fixed it for me:

Code:
 <listener>
   <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
 </listener>
 



Versions:

javax.faces.jar 2.1.21
Tomcat 7.0.50
IceFaces 3.3.0 

Thank you orwtech, I had the exact same problem, and your solution worked without having to downgrade tomcat versions.

 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team