Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

adding "java.sql.SQLexception" to web.xml exception handling

 
abhiavi kumar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get the following error when trying to update a database from an application using servlets.

"java.sql.SQLException: ORA-02291"

I use Apache Tomcat server, and I can see the error in it's console, this error message of course, is not displayed on the browser, but only in the console. I've added other exceptions like "java.lang" etc, but they all work very well. I'm thinking that since oracle is involved, it must be the reason.

I tried adding "java.sql.SQLException" to <error-page> <exception-type> </exception-type> </error-page> but it doesn't seem to work at all. any help would be appreciated. If any more information is needed, please ask.




 
T Mishra
Ranch Hand
Posts: 108
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I display a stack trace on a web page?
 
abhiavi kumar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks but that wasn't really what I was looking for.

I'll put in a more straight-forward fashion.

When I goto my web.xml and enter
<error-page> <exception-type> java.sql.SQLException </exception-type> <location> /error.html </location> </error-page>

It doesn't seem to goto error.html when this java.sql.SQLException occurs. I've done this with java.nullpointer and other exceptions, they all work, perfectly... so, is it possible to handle java.sql.SQLExceptions in web.xml exception handling?
 
T Mishra
Ranch Hand
Posts: 108
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this defined in error.html ?
<location> /error.html </location>
is the location relative to current directory ? It looks to be present in the context root.

examples - Setting Error Pages by Using the web.xml Template, JSP isErrorPage Example
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic