Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using jamon.war on tomcat

Tags:

java

tomcat

jamon

I'm using JAMon, and I want to use the jamon.war to monitor my app. However, my app and the jamon.war app have different classloaders, and therefore they don't see each other's static variables (where the data is stored, as far as I understand). I am getting the proper data when I call MonitorFactory.getReport() in my app.

How to get this working?

like image 505
Bozho Avatar asked Oct 09 '22 06:10

Bozho


1 Answers

The problem was that I had jamon-xx.jar in my WEB-INF/lib. When I remove it (and have it only in tomcat's lib dir), it is loaded by the tomcat classloader (which I guess is a parent of all application classloaders), and so the two applications can share the static fields.

like image 103
Bozho Avatar answered Oct 13 '22 09:10

Bozho