Lib Spring Instrument Java <> Tomcat8

Just to notice,

As stated in Spring Documentation about TomcatInstrumentableClassLoader, spring-instrument-tomcat.jar can only be used with Tomcat 6 or Tomcat 7.

From Tomcat 8, one’s got to use Tomcat’s own InstrumentableClassLoader

NOTE: Requires Apache Tomcat version 6.0 or higher, as of Spring 4.0. This class is not intended to work on Tomcat 8.0+; please rely on Tomcat’s own InstrumentableClassLoader facility instead, as autodetected by Spring’s TomcatLoadTimeWeaver.

1 Like

For Contrast-Finder, I tested with docker and Tomcat 8.5 (Ubuntu 18.04 image : next LTS release). Just remove the following line from the webapp/src/main/webapp/META-INF/context.xml file and it’s works:

<Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader" useSystemClassLoaderAsParent="false"/>

But, I have no idea how to provide Contrast-finder for Tomcat 7 and Tomcat 8.


some links:


`

@koj, can you explain what TomcatInstrumentableClassLoader is for? To contrast-finder the following line does not seem necessary with Tomcat7.

<Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader" useSystemClassLoaderAsParent="false"/>

Build-Jdk: 1.8.0_151
##############################

Docker ubuntu:14.04 Tomcat7
----> libspring-instrument-java not needed

Docker ubuntu:16.04 Tomcat7
----> libspring-instrument-java not needed

Build-Jdk: 1.7.0_151
##############################

Docker ubuntu:14.04 Tomcat7
----> libspring-instrument-java not needed

Docker ubuntu:16.04 Tomcat7
----> libspring-instrument-java not needed

since Contrast-Finder 0.8.4, TomcatInstrumentableClassLoader was removed by the following commit.

For Asqatasun, libspring-instrument-java is not required since the following commit : fd1ebfe (10 Apr 2014, before the fork). See the context.xml file on the master branch.

Documentation and pre-requisites is fixed by: prerequisites - libspring-instrument-java is not needed #200