0

I have created web application using JSF 2.0. I have created one Session bean where I am keeping id of the employee who is logged in.

The problem is when I do some changes in coding and restart tomcat online, I get Null Pointer exception (IF I have not logged out of the system. If I logged out of system, I don't get null pointer exception). To overcome this, I have to clear the history of the browser and the problem get solved.

Below are the steps I follow for project to make online.

  1. Do changes in code
  2. Copy war files to my VPS
  3. shutdown tomcat
  4. remove ROOT folder
  5. change the war file name to ROOT.war
  6. start the tomcat again

Please suggest me what to do....

4

1 回答 1

0

你想让我做什么 ?

发生的事情是当您不关闭浏览器时,用户仍在会话中,cookie,会话 ID 等存在。

现在,当您在不关闭 IE /删除历史记录的情况下重新启动服务器时(如您所说),浏览器将在服务器上查找不存在的会话 ID(因为您已重新启动它),因此它会引发 nullPointerException。

你不需要做任何事情,这是预期的行为。在重新启动之前注销或在重新启动服务器后关闭浏览器(注意新选项卡将无法工作,因为会话保持在选项卡中。)并且您的程序将正常工作并且您不会得到任何空指针

希望这可以帮助。

于 2012-09-25T10:30:29.943 回答