Hibernate v3.2.1
I have a webapp that will optionally load (via a custom classloader) classes that export data from the webapp to a warehouse. Since the exporting code is optional, one of the Hibernate classes (or cglib) are in the appserver's system classpath or the webapp's classpath.
The problem I see is with the interaction between CGLIBLazyInitializer and classpath. CGLIBLazyInitializer assumes (by it's use of Enhancer) that all necessary classes will be available in the classloader for the pojo - but in my case that's not true. The pojo classloader is unaware of hibernate/cglib.
What I need to be able to do is tell CGLIBLazyInitializer to use a different classloader. My situation is resolved is CGLIBLazyInitializer.getProxyFactory() sets the classloader for CGLIBLazyInitializer.class on the newly instantiated Enhancer object, but that may be too specific a solution. It seems that Hibernate should allow classloader configuration of the LazyInitializer.
|