Skip to content

Commit 08fb625

Browse files
committed
Explicit notes for load-time weaving on Tomcat 7.0.63+ and WildFly 9
Issue: SPR-13210
1 parent 5e24ee9 commit 08fb625

File tree

3 files changed

+33
-18
lines changed

3 files changed

+33
-18
lines changed

spring-context/src/main/java/org/springframework/instrument/classloading/jboss/JBossLoadTimeWeaver.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@
2626
/**
2727
* {@link LoadTimeWeaver} implementation for JBoss's instrumentable ClassLoader.
2828
* Autodetects the specific JBoss version at runtime: currently supports
29-
* JBoss AS 6 and 7, as well as WildFly 8 (as of Spring 4.0).
29+
* JBoss AS 6 and 7, as well as WildFly 8 and 9 (as of Spring 4.2).
3030
*
3131
* <p><b>NOTE:</b> On JBoss 6, to avoid the container loading the classes before the
3232
* application actually starts, one needs to add a <tt>WEB-INF/jboss-scanning.xml</tt>
@@ -62,7 +62,7 @@ public JBossLoadTimeWeaver() {
6262
public JBossLoadTimeWeaver(ClassLoader classLoader) {
6363
Assert.notNull(classLoader, "ClassLoader must not be null");
6464
if (classLoader.getClass().getName().startsWith("org.jboss.modules")) {
65-
// JBoss AS 7 or WildFly 8
65+
// JBoss AS 7 or WildFly
6666
this.adapter = new JBossModulesAdapter(classLoader);
6767
}
6868
else {

spring-instrument-tomcat/src/main/java/org/springframework/instrument/classloading/tomcat/TomcatInstrumentableClassLoader.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -44,13 +44,17 @@
4444
* in the LoadTimeWeaver interface, as expected by ReflectiveLoadTimeWeaver.
4545
*
4646
* <p><b>NOTE:</b> Requires Apache Tomcat version 6.0 or higher, as of Spring 4.0.
47+
* This class does not work on Tomcat 7.0.63 and higher; please rely on Tomcat's own
48+
* {@code InstrumentableClassLoader} facility instead, as autodetected by Spring's
49+
* {@link org.springframework.instrument.classloading.tomcat.TomcatLoadTimeWeaver}.
4750
*
4851
* @author Costin Leau
4952
* @author Juergen Hoeller
5053
* @since 2.0
5154
* @see #addTransformer
5255
* @see #getThrowawayClassLoader
5356
* @see org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver
57+
* @see org.springframework.instrument.classloading.tomcat.TomcatLoadTimeWeaver
5458
*/
5559
public class TomcatInstrumentableClassLoader extends WebappClassLoader {
5660

src/asciidoc/core-aop.adoc

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3332,21 +3332,22 @@ environment (summarized in the following table).
33323332
|===
33333333
| Runtime Environment| `LoadTimeWeaver` implementation
33343334

3335-
| Running in
3336-
http://www.bea.com/framework.jsp?CNT=index.htm&FP=/content/products/weblogic/server[BEA's
3337-
Weblogic 10]
3335+
| Running in Oracle's
3336+
http://www.oracle.com/technetwork/middleware/weblogic/overview/index-085209.html[WebLogic]
33383337
| `WebLogicLoadTimeWeaver`
33393338

3340-
| Running in http://www-01.ibm.com/software/webservers/appserv/was/[IBM WebSphere
3341-
Application Server 7]
3342-
| `WebSphereLoadTimeWeaver`
3343-
3344-
| Running in http://glassfish.dev.java.net/[GlassFish]
3339+
| Running in Oracle's http://glassfish.dev.java.net/[GlassFish]
33453340
| `GlassFishLoadTimeWeaver`
33463341

3347-
| Running in http://www.jboss.org/jbossas/[JBoss AS]
3342+
| Running in http://tomcat.apache.org/[Apache Tomcat]
3343+
| `TomcatLoadTimeWeaver`
3344+
3345+
| Running in Red Hat's http://www.jboss.org/jbossas/[JBoss AS] or http://www.wildfly.org/[WildFly]
33483346
| `JBossLoadTimeWeaver`
33493347

3348+
| Running in IBM's http://www-01.ibm.com/software/webservers/appserv/was/[WebSphere]
3349+
| `WebSphereLoadTimeWeaver`
3350+
33503351
| JVM started with Spring `InstrumentationSavingAgent` __(java
33513352
-javaagent:path/to/spring-instrument.jar)__
33523353
| `InstrumentationLoadTimeWeaver`
@@ -3443,12 +3444,22 @@ containers.
34433444

34443445
[[aop-aj-ltw-environment-tomcat]]
34453446
===== Tomcat
3446-
http://tomcat.apache.org/[Apache Tomcat]'s default class loader does not support class
3447-
transformation which is why Spring provides an enhanced implementation that addresses
3448-
this need. Named `TomcatInstrumentableClassLoader`, the loader works on Tomcat 5.0 and
3449-
above and can be registered individually for __each__ web application as follows:
3447+
Historically, http://tomcat.apache.org/[Apache Tomcat]'s default class loader did not
3448+
support class transformation which is why Spring provides an enhanced implementation
3449+
that addresses this need. Named `TomcatInstrumentableClassLoader`, the loader works on
3450+
Tomcat 6.0 and above.
3451+
3452+
[TIP]
3453+
====
3454+
Do not define `TomcatInstrumentableClassLoader` anymore as of Tomcat 7.0.44+ / 8.0.
3455+
Instead, let Spring automatically use Tomcat's new native `InstrumentableClassLoader`
3456+
facility through the `TomcatLoadTimeWeaver` strategy, in particular on Tomcat 7.0.63+
3457+
where `TomcatInstrumentableClassLoader` does not work at all anymore.
3458+
====
3459+
3460+
If you still need to use `TomcatInstrumentableClassLoader`, it can be registered
3461+
individually for __each__ web application as follows:
34503462

3451-
* Tomcat 6.0.x or higher
34523463
* Copy `org.springframework.instrument.tomcat.jar` into __$CATALINA_HOME__/lib, where
34533464
__$CATALINA_HOME__ represents the root of the Tomcat installation)
34543465
* Instruct Tomcat to use the custom class loader (instead of the default) by editing the

0 commit comments

Comments
 (0)