• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Professional Apache Tomcat 6 - Class transformation at classloader level

 
Olivier Croisier
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !

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).

Thanks for your reply !

Olivier Croisier
 
Jeff Genender
author
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Olivier Croisier
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

Olivier Croisier
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic