• Post Reply Bookmark Topic Watch Topic
  • New Topic

Synchronization issue in Jsp  RSS feed

 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a jsp pagewhere I have used an useBean for instantiation of a bean in session scope.
Now the problem is that sometimes this page is giving NullPointerException when multiple user or may be first time hitting this page.
In compiled java file of this jsp there is a synchronized block(synchronized(session)) where the instantiation is occuring.

So I am confused what is happening as because the requests will wait untill instantiation ,so no question of "Null".Please help.



 
Sony Agrawal
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have created the obj1 using bean and set that in session.
How do the scriplet know "what is obj1"
sometimes this page is giving NullPointerException

Is it sometimes or always ??
 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya. It is added as an attribute in session scope.That part is ok.
An coming to your next question it happens sometimes.

Even after 1/2 tries it runs smoother when it gives error.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!