Wildfly-8.2.0.Final: IllegalStateException (duplicate component id)
ahaumer Jan 7, 2015 9:11 AMThis week I tested a rather large application on Wildfly-8.2.0.Final for the first time (we currently use Wildfly-8.1.0.Final in production).
The EAR deploys fine, I can log in and work with most parts of the application, but for some use cases I get an IllegalStateException because of duplicate component id's
The use case is like this:
- The application shows a list of entities in a rich:dataTable
- The user selects a single entity by clicking on the contents of a cell in a row
- The application shows a detailled view of the entity and presents a "back" button
- The user clicks on the "back" button
With Wildfly-8.1.0.Final, the application goes to step (1) again (this is the expected result)
With Wildfly-8.2.0.Final, the application crashes with an IllegalStateException ("component-id already found in view") like this:
Caused by: java.lang.IllegalStateException: Komponenten-ID j_idt220:tab:j_idt250 wurde bereits in der Ansicht gefunden.
at com.sun.faces.util.Util.checkIdUniqueness(Util.java:987) [jsf-impl-2.2.8-jbossorg-1.jar:]
at com.sun.faces.util.Util.checkIdUniqueness(Util.java:971) [jsf-impl-2.2.8-jbossorg-1.jar:]
at com.sun.faces.util.Util.checkIdUniqueness(Util.java:971) [jsf-impl-2.2.8-jbossorg-1.jar:]
at com.sun.faces.util.Util.checkIdUniqueness(Util.java:971) [jsf-impl-2.2.8-jbossorg-1.jar:]
at com.sun.faces.util.Util.checkIdUniqueness(Util.java:971) [jsf-impl-2.2.8-jbossorg-1.jar:]
at com.sun.faces.util.Util.checkIdUniqueness(Util.java:971) [jsf-impl-2.2.8-jbossorg-1.jar:]
at com.sun.faces.application.view.FaceletPartialStateManagementStrategy.saveView(FaceletPartialStateManagementStrategy.java:461) [jsf-impl-2.2.8-jbossorg-1.jar:]
at com.sun.faces.application.StateManagerImpl.saveView(StateManagerImpl.java:89) [jsf-impl-2.2.8-jbossorg-1.jar:]
at com.sun.faces.application.view.WriteBehindStateWriter.getState(WriteBehindStateWriter.java:328) [jsf-impl-2.2.8-jbossorg-1.jar:]
at com.sun.faces.application.view.WriteBehindStateWriter.flushToWriter(WriteBehindStateWriter.java:221) [jsf-impl-2.2.8-jbossorg-1.jar:]
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:473) [jsf-impl-2.2.8-jbossorg-1.jar:]
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133) [jsf-impl-2.2.8-jbossorg-1.jar:]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) [jsf-impl-2.2.8-jbossorg-1.jar:]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.8-jbossorg-1.jar:]
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) [jsf-impl-2.2.8-jbossorg-1.jar:]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at org.omnifaces.filter.FacesExceptionFilter.doFilter(FacesExceptionFilter.java:56) [omnifaces-1.7.jar:1.7]
In the component-tree dump I see the whole set of columns of the data table duplicated!
I see this problem consistently in all similar use cases in our application (about 40 use cases)
I found two workarounds for this problem so far, which might give you a clue of what is going on here:
1) Start a new conversation when the user clicks on the "back" button.
The "back" button in the entity detail view is a h:button like this:
<h:button id="listButton" value="Back" outcome="/admin/entityList.xhtml">
<f:param name="cid" value="#{javax.enterprise.context.conversation.id}"/>
</h:button>
If I remove the f:param line with the conversation ID, I get a new conversation, but no exception.
2) Replace mojarra-2.2.8 from Wildfly-8.2.0.Final with mojarra-2.2.6 from Wildfly-8.1.0.Final
Both workarounds I'd rather not deploy in production... :-)
I'm using RichFaces-4.5.1.Final
Now I'm wondering: ist this a bug in Wildfly-8.2.0.Final (Mojarra-2.2.8), a bug in RichFaces or a bug in my application?
I'm asking here, because the application runs unchanged without problems with Wildfly-8.1.0.Final, but shows the exception with Wildfly-8.2.0.Final and nothing else changed
(In fact in my tests I'm deploying the same EAR)
I'm sorry I can't present a simple demo application for this problem. I'm in an early stage of problem solving and still gathering information.
The application in question is rather big and involves our own components and framework code which of course might add to the situation.
Still I think we have a valid JEE application (prove: it works with Wildfly-8.1.0.Final ;-). So something must have changed with Wildfly-8.2.0.Final / Mojarra-2.2.8 which actually triggers the problem.
So what might that be?
Any idea anyone?