File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Synchronization issue in Jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Synchronization issue in Jsp" Watch "Synchronization issue in Jsp" New topic
Author

Synchronization issue in Jsp

Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 214
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.




Thanks in Advance,
Kousik
Sony Agrawal
Ranch Hand

Joined: Oct 04, 2009
Posts: 143
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

Joined: Sep 30, 2007
Posts: 214
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.
 
IntelliJ Java IDE
 
subject: Synchronization issue in Jsp
 
Threads others viewed
how to print values on jsp page fetched from servlet
Dynamic form/checkbox problem
Jboss 5.1.0 jsp:root not working
Need help with JSTL: setting end attribute dynamically of "substring" tag
While click on button action is not reach in LoginAction class
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com