File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Exception handling problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Exception handling problems" Watch "Exception handling problems" New topic

Exception handling problems

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I have made a simple servlet. In this servlet I am accepting a username and password from the client. When the client clicks on his submit button, after the request is sent to the servlet the user presses stop button, I get a SocketException in the servlet. I am using post method. I have also tried by putting the whole post method into try catch but yet I could not catch this exception.
Carl Trusiak

Joined: Jun 13, 2000
Posts: 3340
The reason for this is where the Exception is occurring, In most Servlet serving applications (Such as the Oracle Application Server, WebLogic etc.) Certain RunTime exceptions occur in the Servlet runner and not the actual Servlet itself. Because of this, You are not able to catch the exception in your Servlet. You can try and contact the developer of your Server and see if there is a work around or method.
Hope this helps

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
I agree. Here's the link:
subject: Exception handling problems
It's not a secret anymore!