I have a web application currently deployed on Wildfly 23.0.2, using JSF 2.3 and OpenJDK 11. I'm also using the latest version of OmniFaces (3.11). One of the application requirements is PWA support. For this, I'm using PWAResourceHandler exactly as described in the omnifaces webpage.
I would like to use the ViewScoped annotation from OmniFaces instead of the one from JSF. I know this OmniFaces-JSF gap is reducing, but for testing purposes I changed the ViewScoped annotation import. After this change, in all pages with
<f:metadata>
<f:viewParam name="myParam" value="#{omnifacesTest.myParam}" />
</f:metadata>
I get the following error:
Caused by: java.lang.IllegalStateException: Component ID omnifaces_omnifaces_js has already been found in the view.
at [email protected]//com.sun.faces.util.Util.checkIdUniqueness(Util.java:1299)
at [email protected]//com.sun.faces.util.Util.checkIdUniqueness(Util.java:1283)
at [email protected]//com.sun.faces.application.view.FaceletPartialStateManagementStrategy.saveView(FaceletPartialStateManagementStrategy.java:453)
at [email protected]//com.sun.faces.application.StateManagerImpl.saveView(StateManagerImpl.java:64)
at [email protected]//com.sun.faces.application.view.WriteBehindStateWriter.getState(WriteBehindStateWriter.java:310)
at [email protected]//com.sun.faces.application.view.WriteBehindStateWriter.flushToWriter(WriteBehindStateWriter.java:204)
at [email protected]//com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:484)
at [email protected]//com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:170)
at [email protected]//javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:132)
at [email protected]//javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:132)
at [email protected]//javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:132)
at deployment.my-application-0.0.1-SNAPSHOT.ear.my-web.war//org.omnifaces.viewhandler.OmniViewHandler.renderView(OmniViewHandler.java:155)
at [email protected]//com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:102)
at [email protected]//com.sun.faces.lifecycle.Phase.doPhase(Phase.java:76)
at [email protected]//com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:199)
at [email protected]//javax.faces.webapp.FacesServlet.executeLifecyle(FacesServlet.java:708)
If I remove the viewParam
from f:metadata
, or disable PWA support, the error disappears.
I can't seem to find a reason for this behaviour. Has anynone else found this problem? Any suggestions on how to handle this?
Thanks for your help!