I have two complex composite components that are rendered on different parts of a page. They each have their own backing beans that extend UIInput in order to submit a converted value back to the server based on the component inputs. Separately these components work fine and update and submit their values as appropriate. However, when they are placed on the same page, they appear to conflict with each other despite having no obvious connection (other than being on the same page).
One of the components is on the main part of the page, the other is in a p:dialog. When I perform an ajax request that updates the dialog or its contents, the request fails.
Firefox reports a console warning: "XML or text declaration not at start of entity"
The response returned from the server looks like two separate partial responses mixed with each other. It has two <partial-response> tags before the first end tag for them, it has two <xml version=...> tags as well. They're not one right after the other, there's the usual updates that you would expect before the second xml and partial response tags and then the data after the second set is an error from the server.
On the server side, the server reports there was an error rendering the view and that while trying to render ComponentA.xhtml (which is not part of the update from the ajax request) the property "Extras" (which is a property in ComponentA's data was not found for the object that Component B (which is part of the update) takes as a value.
So it looks like the page is trying to re-render or otherwise process component A even though it should be excluded from the ajax request and then giving it the data that should be going to Component B which is part of the ajax request. I've checked to make sure the ids for the components are different, that they are pointing to the correct backing beans and that those beans point to the correct components and it's still not working. At this point I'm stuck. Does anyone have any ideas?
In response to BalusC's questions, there's no special exception handling set up on the server or in the application. Whatever the defaults are for Mojarra 2.1.3, Primefaces 5.0 and Tomcat 7 are what we're using. Here's the only exception being output by the tomcat server:
Nov 5, 2015 11:40:27 AM com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException
SEVERE: Error Rendering View[/program/toc/tocmain.xhtml]
javax.el.PropertyNotFoundException: /resources/ppa/personselector.xhtml @55,136 rendered="#{not empty item.extras}": Property 'extras' not found on type org.ppa.pejsf.objects.FreeFormDrugData
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:111)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:413)
at javax.faces.component.UIComponent.isVisitable(UIComponent.java:1646)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1579)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at org.primefaces.component.api.UITabPanel.visitTree(UITabPanel.java:916)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIForm.visitTree(UIForm.java:344)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:376)
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:297)
at org.primefaces.context.PrimePartialViewContext.processPartial(PrimePartialViewContext.java:60)
at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:981)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:390)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
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:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:98)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:200)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:701)
If it helps at all, it looks like the issue appears when rendering the view and Component B's value is not null on the back end.
Well, I didn't ever find a reason for why this was happening, but I did find a solution to prevent it from happening. If I include the component that the system was trying to render (but shouldn't be) in the render/update list for the ajax request, the issue goes away.