aspose file tools*
The moose likes Tomcat and the fly likes Professional Apache Tomcat 6 - Class transformation at classloader level Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Professional Apache Tomcat 6 - Class transformation at classloader level" Watch "Professional Apache Tomcat 6 - Class transformation at classloader level" New topic
Author

Professional Apache Tomcat 6 - Class transformation at classloader level

Olivier Croisier
Greenhorn

Joined: Mar 14, 2006
Posts: 29
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


SCJP 5.0 (100%)<br />SCWCD (getting ready...)
Jeff Genender
author
Greenhorn

Joined: Sep 06, 2007
Posts: 14
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

Joined: Mar 14, 2006
Posts: 29
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Professional Apache Tomcat 6 - Class transformation at classloader level