10 Replies Latest reply on Aug 6, 2018 5:35 AM by Ziad Saade

    Wildfly 12.0.0 Final Delay in Getting the Value Attributes of the Session Variables (Result in Null Pointer Exception)

    Ziad Saade Newbie

      Dear All


      I am using Wildfly 12.0.0 Final, when deploying the application I’m receiving Null pointer exception, below is the flow of the Code:


      At the beginning of the Servlet, I am getting the value of the Session Variable:

      TestBean testBean = (TestBean)session.getAttribute("testBean");


      When getting the value from the variable “testBean” I am getting null pointer exception.

      String testAcc = testBean.getAmount();


      Note that delaying (Code Below) the load of the HTTP POST request before getting the value of the session Variable will resolve the issue (as a workaround):


      for (int i = 0; i < 5000; i++)


      1. System.out.println("Value of i = " + i );


      TestBean testBean = (TestBean)session.getAttribute("testBean");

      String testAcc = testBean.getAmount();


      Kindly advice how to fix the problem at the level of the server configuration.

      PS: I am not getting the exception when deploying the same application under other J EE application servers (Tomcat....)


      Thanks and Best Regards