request.getSession() returns an incorrect null on Linux, but on Windows it's
OK.

I have an ordinary Struts2 web app deployed on Tomcat 6.0.20, together with
a JAAS-solution where I have my own Valve class.

The Valve repeatedly executes invoke() with the following code-snippet (here
very much simplified):
  .
  .
  .
  if (LOGGER.isDebugEnabled()) {
    if (request.getSession() == null) {
      // Log incorrect event (1)
    } else {
      // Log OK (2)
    }
    if (request.getSession(true) == null) {
      // Log incorrect event (3)
    } else {
      // Log OK (4)
    }
  }

  /*
   * Here a NullPointerException occurs
   */
  request.getSession().setAttribute("...",...);
  .
  .
  .
In the first request the session is not lost, everything is fine with (2)
and (4). In the following requests getSession() returns null (1) and (3).

This occurs on Linux, not on Windows, both with Tomcat 6.0.20.

On Windows Java version 1.6.0_16 is used

On RedHat Linux Java version 1.6.0_13 is used


Regards

Johan

Reply via email to