[EMAIL PROTECTED] wrote:
Martin,

Can you elaborate on this a bit? Why does the change in location of spy.properties solve the problem? Should deregister work on its own? Also, would a similar consideration apply if Tomcat is using a JDBC-based realm? I've never had any luck getting p6spy to work with Tomcat, and this sounds like it might help - we don't use load-on-startup, but we do have JDBC realm.

Yes, using the JDBC realm will cause a similar problem as using a servlet with load-on-startup=1 and eg a database connection pool.

The problem is then that Tomcat (if using JDBC realm or DBCP DataSource in
Tomcat) or a webapp (with load-on-startup=1) will be the first thing
registering a driver with the JDBC DriverManager.

Since P6Spy is acting as a proxy driver it will then fail to install
itself if it comes in 2nd place of DriverManager registering.


This is where deregister-driver=true comes in in spy.properties, using this on it's own _can_ solve the problem but not if you want to use P6Spy to trace something for the pools that were already loaded before your webapp (or if Tomcat and eg a DBCP conenction pool/DataSource is keeping P6Spy from succefully deregistering the driver).


To successfully set up P6Spy under these conditions, you will need: 1) to use deregister-driver=true in spy.properties 2) move spy.properties to CATALINA_HOME/common/classes 3) move p6spy.jar to CATALINA_HOME/common/lib

This should make P6Spy functional even if using the JDBC realm
(only the DataSources or connections using the P6 driver explicitly
will log anything though).

Also note that P6Spy has a habit of bootstrapping with it's file-
logger, even if you configure Log4J-logging. Hence you will get an
almost empty spy.log with just the spy.properties setting echoed,
before P6Spy starts logging through Log4J. (And thus it might look
like it's still not working if you just see the spy.log, which will
most likely end up in "cwd" for Tomcat start, eg CATALINA_HOME/bin)

Regards,
 Martin


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to