I'd like to know, will class transformation at classloader level be available in future releases of Tomcat ? I currently need to replace tomcat's webapp classloader by a custom one to be able to use JPA persistence with Tomcat (this isn't needed with Glassfish, for example).
I don't know the plans the Tomcat team has regarding the classloader transformation. But JPA certainly works in Tomcat w/o the need to swap classloaders (i.e OpenJPA, Hibernate).
Joined: Mar 14, 2006
I'm using Tomcat 5.5 + Spring + Toplink JPA, and Spring's documentation states that :
Jakarta Tomcat's default classloader does not support class transformation but allows custom classloaders to be used. Spring offers the TomcatInstrumentableClassLoader which extends the Tomcat classloader (WebappClassLoader) and allows JPA ClassTransformer instances to 'enhance' all classes loaded by it. In short, JPA transformers will be applied only inside a specific web application (which uses the TomcatInstrumentableClassLoader).
This step isn't necessary with Resin or Glassfish, whose classloaders provide native bytecode transformation support.
Replacing a classloader isn't big deal if I distribute a preconfigured Tomcat bundled with my web application, but it may be a deployment issue if I provide only a .war archive...
So I was just wondering about future improvements in my favorite servlet container