we are facing a duplicate id exception after adding a component in
applicationPhase to to view.

We are using c:forEach and add an item to the iterated list in the

Saving this view is done without problem, but restoring this saved view
results in a view containing the new component twice! Which results in a
duplicate id exception when saving this restored view again.

I found that this new component on creation is marked as
On restore view the facelet is used to recreate the view, which is
including the new component because it is now included in the forEach
After recreating the view with the facelet the view is extended with the
components which were marked with "oam.COMPONENT_ADDED_AFTER_BUILD_VIEW
when storing the view.

At this point the component is duplicated in the view.

The Problem is in
(row 437 to 451 in 2.1.10 sources), the component is added to the view
regardless if there is already a component with same id.

I have a example app to reproduce this Problem can downloaded here
http://www.inexso.net/files/myfaces-dynamic-test.zip .

Run this with "mvn jetty:run" to reproduce this.

Running this with "mvn -Dcontainer=jetty-mojarra jetty:run" did not give
me any error.


Volker Weber
-Leiter Software-Entwicklung-

inexso - information exchange solutions GmbH
Ofener Str. 30      | 26121 Oldenburg

Firmensitz: Oldenburg | Amtsgericht Oldenburg HRB 205251
Geschäftsführer: Stefan Schulte, Michael Terschüren