Question

I'm creating a JSF 2 application using PrimeFaces 3.4.2 and CDI on JBoss EAP 6. The application has a section that uses a long running conversation for 3 pages. When the user navigates to the first page that uses the conversation they have 2 links to the other pages.

<p:commandLink action="#{event.navigateToIfg()}" >
    <h:outputText value="#{msg.ifg_label}" />      
</p:commandLink>
<p:commandLink action="#{event.navigateToJob()}" >   
        <h:outputText value="#{msg.job_label}"/>        
</p:commandLink>

Both methods use navigation rules to move between the pages.

navigateToIfg() uses rule:

<navigation-rule>
    <from-view-id>/event/event.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>TO_IFG</from-outcome>
            <to-view-id>/event/eventGuideIfg.xhtml?cid=#  {javax.enterprise.context.conversation.id}</to-view-id>
            <redirect />
        </navigation-case>
</navigation-rule>

navigateToJob() uses rule:

<navigation-rule>
    <from-view-id>/event/event.xhtml</from-view-id>
    <navigation-case>
        <from-outcome>TO_JOB</from-outcome>
        <to-view-id>/event/eventGuideJob.xhtml?cid=#{javax.enterprise.context.conversation.id}</to-view-id>
        <redirect />
    </navigation-case>
</navigation-rule>       

The application also has a global on click javascript listener that triggers a p:remoteCommand notifying a sessionscoped bean of the click. So when a user tries to navigate to IFG or to JOB the following is triggered as well.

<p:remoteCommand id="keepAliveRemoteCommand" name="keepAliveRC" actionListener="#{sessionInfo.keepAlive()}" autoRun="false" update="@none" process="@this" />

I believe the navigation and the click listener firing close together causes me to get the warning:

WELD-000315 Failed to acquire conversation lock in 1,000 for Conversation with id: 1

which then causes other exceptions and failures in my application. Lastly, the issue is not always consistent, sometimes it will happen immediately other times it won't happen using the same steps. I need to understand what I'm doing wrong and how I can fix this issue.

Update:
Can anyone explain this warning? What does it mean? How it's specifically caused? It doesn't seem like its something my JSF application would control. It seems specific to the web app in this case JBoss EAP 6 (JBoss AS 7.1.3).

Was it helpful?

Solution

After getting some more information about what the WELD-000315 error means, I've determined that the cause of the error is the fact that I was firing a global click listener for every click the user made.

The ajax request for the click always appended the conversation id on to the request which caused it to try and get a lock on the conversation while another request was running longer than 1 second. The issue occurred requests that took longer than 1 second such as navigating to different pages, or long save requests. All I had to do to resolve the issue was be more specific on when to fire the click listener.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top