You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
The use case is pretty straight forward and I cannot find a way to make it work.
We use p6spy in a Tomcat container. The library is in Tomcat's classpath (/lib).
We want to be able to specify a different spy.properties configuration for each webapp that is deployed. This can help having different log files, different thresholds, ...
It seems to work at first, injecting the spy.properties file in the webapp's classpath works fine (using Tomcat's PreResource in webapp's context file).
But the first datasource that gets initialize seems to set the configuration for the whole JVM.
Other configuration files are simply ignored.
This seems to be caused by P6ModuleManager:private static P6ModuleManager instance which is loaded from the Tomcat global class loader, thus unique for the whole tomcat.
The text was updated successfully, but these errors were encountered:
Dealus
changed the title
Cannot have different configuration for different webapps in same container (Tomcat)
Cannot have different configuration for different webapps in same container (Tomcat) - p6spy 3.9.0
Mar 4, 2021
@typekpb , I gave it a try. This seems to work fine, passes the tests, and allows me to use different configurations.
But it's a pretty wild change.
With this, the P6ModuleManager holds an instance for each different contextClassLoader it is used from, defaulting to current class loader if no context one is found.
@Dealus I think you just need to put p6spy jar in the webapps and not in the server. Then in the individual webapps you just wrap the DataSource you get from Tomcat/Server with the P6DataSource and you are good to go. If you don't have access to the source code there might be a little work involved to set up a P6DataSource for each webapp individually.
@typekpb I'd close this issue as invalid. I don't think any code changes are needed to p6spy.
Hello,
The use case is pretty straight forward and I cannot find a way to make it work.
We use p6spy in a Tomcat container. The library is in Tomcat's classpath (/lib).
We want to be able to specify a different spy.properties configuration for each webapp that is deployed. This can help having different log files, different thresholds, ...
It seems to work at first, injecting the spy.properties file in the webapp's classpath works fine (using Tomcat's PreResource in webapp's context file).
But the first datasource that gets initialize seems to set the configuration for the whole JVM.
Other configuration files are simply ignored.
This seems to be caused by P6ModuleManager:private static P6ModuleManager instance which is loaded from the Tomcat global class loader, thus unique for the whole tomcat.
The text was updated successfully, but these errors were encountered: