Hi,
It is quite strange that you speak about a dataSource from jndi
(java:comp/env/jdbc/dataSource), given that you give a datasource
configuration from a Spring context file which uses
org.apache.commons.dbcp.BasicDataSource directly and which does not
use your jndi datasource.
But anyway, we can probably ignore the jndi dataSource and use
Spring to monitor the "defaultDataSource".
For that, you don't have to change the jdbc driver: you do not have
to use net.bull.javamelody.JdbcDriver.
You can simply add
"classpath:net/bull/javamelody/monitoring-spring.xml" in the web.xml
file: open the web.xml file and find the
contextConfigLocation,
then add the monitoring-spring.xml like this :
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:net/bull/javamelody/monitoring-spring.xml
...
It should be enough to monitor the "defaultDataSource" from your
spring context and so the sql requests (because
monitoring-spring.xml contains a post-processor for DataSources).
Note that I have not tested it myself with Alfresco.
Reference:
http://code.google.com/p/javamelody/wiki/UserGuide#7._JDBC
By the way, you could also probably monitor various beans of
Alfresco from your Spring context, see the following chapter:
http://code.google.com/p/javamelody/wiki/UserGuide#9._Business_facades_%28if_Spring%29
You will have to define a pointcut based on an Alfresco interface or
based on a jdk regexp for example. And it's up to you to find the
beans which can and should be monitored.
bye,
Emeric