1 Reply Latest reply on Oct 24, 2017 11:07 PM by jaikiran

    Are there known issues regarding sessions in Wildfly 10.1.0.Final with Undertow 1.4.6.Final?

    mchur

      Hey guys,

       

      I'm facing a weird bug regarding sessions and have neither found anything related here nor in jira.

      The bug occurred with Wildfly 10.1.0.Final and Undertow 1.4.6.Final (yep I replaced all Undertow modules for security reasons).

       

      As is situation:

      • JSF backed by a @ViewScoped bean.
      • There is a @SessionScoped injected into this @ViewScoped bean. @PostConstruct method of the @ViewScoped bean uses this @SessionScoped bean.
      • There is a @Stateless EJB injected into this @SessionScoped bean.
      • The @SessionScoped bean consists of several private members and getters for them. Data is set during @PostConstruct.
      • There's a method in the @SessionScoped bean that uses one of the private members and returns an entity that is retrieved by using the @Stateless EJB (it makes use of a simple entitymanager find and a Long value as primary key).
      • Wildfly with standalone configuration, no HA.
      • There are many sessions but let's look at particular sessions A and B.

       

      You might think: What could possibly go wrong in this case when A and B are interacting with different JSF pages?

      The actual problem is that @ViewScoped is created for A but is initialized with data from @SessionScoped of B. Whatever the reason is, session data is mixed in very rare situations and I'm not able to reproduce this. Undertow access logging shows that requests are performed by the valid sessions A and B. Logging of beans shows that data for A is based upon data of B.

       

      Any suggestions are much appreciated.

       

      Thanks for your help!

       

      Best regards,

      Markus