Konstantin Kolinko skrev 2014-04-30 01:17:
2014-04-29 12:28 GMT+04:00 Fredrik <fredrik.l.stigb...@sitevision.se>:
Hello.
We're using jamm (https://github.com/jbellis/jamm) a java agent for
measuring object memory usage, passing the javaagent argument
to tomcat as
"-javaagent:../../tomcat/webapps/ROOT/WEB-INF/lib/jamm-0.2.3.jar".
When running 7.0.50 everything works as expected but after upgrading to
7.0.52 the initialization code of the agent (premain-method) isn't called
anymore.
Any ideas?

I understand that that means that you have the same jar present in
both the System classloader and the Webapp classloader.

You should remove that jar from WEB-INF/lib directory of that webapp.

IIRC, in 7.0.50 and earlier Tomcat preferred the class from the system
classloader (effectively ignoring the webapp's jar).

In 7.0.52 it does load the class provided by web application.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

I only have one jar which is placed at (webapps/ROOT/WEB-INF/lib/jamm-0.2.3.jar). A little bit strange but when I moved the jar to tomcat/lib then the agent starts working as expected.

Regards
/Fredrik


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to