-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Konstantin,
On 4/29/14, 7:17 PM, Konstantin Kolinko wrote: > 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. Actually, I'd like an explanation of the above. I'm not saying it's wrong or makes no sense, but I don't quite understand how it could interfere: The javaagent should be loaded at JVM launch, which is before any web applications exist, so no ClassLoader conflict should occur. When a remote process connects to the agent, it should do so out of context of any web application (that is, the thread that handles the connection should not have its ClassLoader set to the WebappClassLoader of any deployed web application), so no classes should be loaded from the WebappClassLoader. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTYQIIAAoJEBzwKT+lPKRY3WUP/3y/rRw6Bd+bvHm8SY/t1fHh 4cnCvjbjTSluRNNl0/QrwpSev0NrTtyGn40aTSP5OM7QQfhK3DK70uBrlwZENAiY zcsCTXRe9IuVSlQPdvXLnq59E3ZXYyUVIRlge5Wh9ucg6onYFmCFQPmOBpBYppix MWKrbAkaxeTxY2iD73DQeX02cda9N9YeC0FtGI+i3p3x9gGQ/1BcJZAH3sV7gz9s T/zgZ72WYnRQJ5h5zBhCIGQCUKiA6uR7DzPAuB5L8JXybnQ5OvKjrJS03169G3AX PEMFCzLbImaKy8sttJNWNb4JyjKAZE26lmPWHK7Hop27FWGAobjogb5vEQ5XDJWh exV+VRpT2OyWFUfJWF5scM23iKR1JzZz/S433YpAXQC2g/8Q+qbZLB//q0D7T8TW VbmHxBjYPFcN2DkGYtm8uFGVRxDbNNJMvUG+7+oCX3B3bF4sr3roD2FGVrkN4qlL HEG0pCxPmiZ8wEQWHem/9VPCMHKNW36eX7KllW8M+35GAQURXKgayxGPGn20zDc7 Nn1exxKzcFjawTKt1LlR3aHEsGYKyXbsEOb1Ivgmm7YYz5vGiIunkYS1V1jfdUGz 68NwB67EZg93cA4BVpEjsorxAlWYg0vvmlwa2/poFKJGG3XRABRPe6PWIvoz23Yg 9TlEwIFdtBlMbQoY71NN =ZgaK -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org