wood burning stoves*
The moose likes Servlets and the fly likes Througing HTTP 1.1 500 when my servlet was not syncronized Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Througing HTTP 1.1 500 when my servlet was not syncronized" Watch "Througing HTTP 1.1 500 when my servlet was not syncronized" New topic
Author

Througing HTTP 1.1 500 when my servlet was not syncronized

RaghavaRao oura
Greenhorn

Joined: Apr 26, 2007
Posts: 8


1) I am using Oracle application server 10g.
2) I was writen servlet progarma as like this
a)public class My class extends HttpServlet
b) public void init(ServletConfig c)
throws ServletException
{
super.init(c);
}
c) protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{

service(request, response);
}
d) protected void service(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
My logic here
}

3) I am testing like this way then My application server throughing HTTP 1.1" 500 error
a) Prepared on client program like it will read line by line and hit the server
b) My server is sending request to my servlet class
c) From 5 clients i am hitting 2000 req concurently
d) after started the clients hiting then it will throug one client HTTP 500 then stop server.
e) In my open log is wring Null pointer exception
***********
4) Then I have checed my code as below
protected synchronized void service(HttpServletRequest request, HttpServletResponse response)

Then it is working fine.

********

My question how suncronized is behaving... Due to this my response also bit slow.
If i remove how can i resolve this.

Thanks
Raghava
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Througing HTTP 1.1 500 when my servlet was not syncronized