[BetaBuild] Having trouble with maintaining conversational context in AS 7.1.0.Beta1
rmallred Dec 5, 2011 3:37 PMOkay so I'm having some very strange issues that I believe are related to the container maintaining conversation context incorrectly with an application that I'm currently developing. We are shooting for JBoss EAP 6 for production when it's all said and done, but for now we are just working our way through the AS 7 releases as they come out. After making the jump from JBoss AS 7.0.0.FINAL to JBoss AS 7.1.0.Beta1, all of the ajax functionality that previously worked fine no longer functioned correctly without any visible error messages, stack traces in logs etc, literally nothing. It appears that after each ajax call AS7 is throwing back a NonExistentConversationException via the xml ajax reponse (See Below) which is then getting swallowed, hence why there are no visible errors on the screen, not sure why I wouldn't get a stack trace in the log though.
<partial-response> <error> <error-name>class org.jboss.weld.context.NonexistentConversationException</error-name> <error-message>WELD-000321 No conversation found to restore for id 1</error-message> </error> <changes> <extension primefacesCallbackParam="validationFailed">{"validationFailed":false}</extension> </changes> </partial-response>
The weird part is that I can deploy the exact same .war file onto the two different versions of AS7 and on 7.0.0.Final it functions properly and 7.1.0.Beta1, it doesn't work at all. My best guess is that the container is no longer maintaining our conversational state correctly, but I have no idea why this would be the case. Here is my code for opening a new conversation:
Excerpt from mainLookup.xhtml
<ui:define name="additionalHeaderInfo"> .... <f:metadata> <f:event listener="#{typeYearMakeModelBean.setUpConvo}" type="preRenderView"/> </f:metadata> </ui:define>
Excerpt from typeYearMakeModelBean
private void setUpConvo() { if (logger.isDebugEnabled()) { logger.debug("TypeYearMakeModelBean.setUpConvo()"); } // Only start a new conversation one doesn't already exist if (conversation.isTransient()) { conversation.begin(); conversation.setTimeout(CONVERSATION_TIMEOUT); if(logger.isDebugEnabled()) logger.debug("Conversation Id: " + conversation.getId() + " Timeout " + conversation.getTimeout()); } }
For reference, here is an example of a JSF component on my page that has embedded ajax behavior that no longer functions
<div class="lookup"> <h:outputLabel id="typeLabel" for="typeSOL" value="#{msg['epcfe.tymmlookup.outputlabel.type']}" /> <br/> <h:selectOneListbox converter="entityConverter" id="typeSOL" size="1" value="#{typeYearMakeModelBean.type}" required="false"> <f:selectItem itemLabel="#{msg['epcfe.tymmlookup.selectitem.itemlabel.defaultall']}" itemValue="#{null}" noSelectionOption="true" /> <f:selectItems id="typeSIs" value="#{typeYearMakeModelBean.typeList}" var="type" itemValue="#{type}" itemLabel="#{type.vehicleTypeGroupName}" itemLabelEscaped="true" /> <p:ajax event="change" listener="#{typeYearMakeModelBean.onTypeChange}" update="vehicle-nav centerArea" /> </h:selectOneListbox> </div>
...and it's backing bean method
public void onTypeChange() { if (logger.isDebugEnabled()) { logger.debug("TypeYearMakeModelBean.onTypeChange()"); } vehicleTypeChangeEvent.fire(new VehicleTypeChangeEvent(this.type)); updateListValues(false); }
Am I missing something? Any help would be greatly appreciated. Also, feel free to request any other relevant bits of code that I may have left out.
-----------------------------------------------------------------------------------------------------------------------------------------
For reference here is our full technology stack (ommited things I didn't think are relevant, if you think something is missing just ask):
JBoss AS 7.1.0.Beta1
Primefaces 3.0.M2
Mojarra 2.1.3
Weld 1.1.2.Final