Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

500 internal server error

 
ashu goel
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,The site on which i am working is encountering a 500 INTERNAL SERVER ERROR for a few days.Also shown alongwith it is a
NullPointerException.I am using JSP and oracle.could anyone tell me the reason for such an error appearing.When this exception occurs the webserver says maximum connections exceeded..
Also at times an ORACLE INSTANCE TERMINATED error comes on javawebserver 2.0...
What could i do to solve these problems...
Are the two interrelated??
please reply
ashu

------------------
 
Mohamed Yousuff
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I think the problem lies with the way you handle connection to the database. Normally the database, whatever it is, will not accept any connections after a certain limit. Check your jsp code. Make sure that you properly close all the handles to the database like the resultset,statement and connection. If these are not closed, the connection could not be obtained and the call for DriverManager.getConnection() method will return null. If you have not checked for null then it throws a null pointer exception which is then passed to the application server. The application server in turn will log it in the log files and close the connection to the webserver. Since the application server has closed the connection unexpected by the webserver, the webserver will show the Internal Server Error. The exact reason could be found in the log files of the application server you are using. If you want the site to be up immediately, just restart the database server. Since you are using Oracle, you have to stop and start the tnslistener. That would be sufficient. The site would be down again after sometime if the connection limit is exceeded.

Hope you understand the solution to your problem.
Originally posted by ashu goel:
hi,The site on which i am working is encountering a 500 INTERNAL SERVER ERROR for a few days.Also shown alongwith it is a
NullPointerException.I am using JSP and oracle.could anyone tell me the reason for such an error appearing.When this exception occurs the webserver says maximum connections exceeded..
Also at times an ORACLE INSTANCE TERMINATED error comes on javawebserver 2.0...
What could i do to solve these problems...
Are the two interrelated??
please reply
ashu



------------------
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic