Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Througing HTTP 1.1 500 when my servlet was not syncronized

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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 knew that guy would be trouble! Thanks tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic