wiki:StartupErrorsDatabaseConnections

Handling Startup Errors and Showing Database Stats

Date 2011/02/15
Contact(s) Simon Pigot
Last edited 2011/02/15
Status draft, being discussed - initial work complete
Assigned to release 2.7.0
Resources Resources available

Overview

Many users report problems because an exception has been raised in the servlet initialization. This is often due to database connection problems but can be due to other things such as port already in use. Asking users to look at the log files is not terribly satisfactory because:

  • although the problems often need changes to config files, the log files are not always accessible to the user
  • often the first exception will cause a shower of other exceptions and this is confusing

Jeeves is designed to display exceptions that occur after servlet initialization. So the changes in this proposal will:

  • detect and collect any exception information from the servlet initialization (as well as continuing to log it) in jeeves/server/JeevesEngine.java
  • if an exception occurs then this info will be shown to any user that makes a request after the servlet has finished initialization by directing all requests (because we can't assume the user will come to the page through a particular service and what use is the webapp when the initialization has failed?) to a GeoNetwork error service (main.error), configured in web/geonetwork/WEB-INF/config.xml

Next screen shot shows the info displayed when role (user) in postgres database info doesn't exist. Note that the navigation says http://localhost:8080/geonetwork/srv/en/main.home - if an exception occurs during initialization, then whatever service the user requests is replaced with a call to main.error (behind the scenes) to make sure that the exception info is shown.

Finally, related to this problem is the need to display database status (at least: has the connection been successful, jdbc url, number of active connections in pool, number of available (idle) connections in pool, maximum number of active connections). This info can be obtained from the Apache Commons Database Connection Pool ResourceProvider that replaces the old Jeeves DbmsPool and can be displayed in Francois' new System Information screen in the Administration menu.

A version of this service, with sensitive info removed, could be added to the banner menus so that the database status and stats can be seen without needing to log in (since if the database was down the log in would fail!)?

Proposal Type

  • Type: Jeeves Change, GeoNetwork config change
  • App: GeoNetwork
  • Module: Jeeves (mainly)
  • Developer list discussions:

Voting History

  • Not proposed for voting as its probably only a minor change.

Motivations

  • Make info about exceptions during initialization available through the web interface.
  • Let the user see status and stats about current database connections in the web interface

Backwards Compatibility Issues

None

New libraries added

None

Risks

None

Last modified 13 years ago Last modified on Feb 15, 2011, 6:35:02 AM
Note: See TracWiki for help on using the wiki.