openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Linskey <>
Subject Re: OpenJPA enhancement in classloader
Date Tue, 22 Jul 2008 22:41:12 GMT

Can you describe the classloader requirements of your environment in a  
bit more detail? In particular, I'm wondering whether or not you can  
just run the app in the classloader that has the transformed classes.  
Does that make sense?

Also, what JVM are you using?


On Jul 21, 2008, at 9:53 AM, Simone Gianni wrote:

> Hi All,
> for a number of reasons I cannot explain right now ( :) ), I need to
> load JPA annotated classes, and enhance them with OpenJPA, from a
> ClassLoader, and not from an agent or a J2EE environment. I wrote a
> classloader that calls the PCClassFileTransformer inside the  
> defineClass
> method, I used the code in the PCEnhancerAgent class to do this, and I
> see the classes being (properly ?) rewritten.
> BUT, when the class is then used by OpenJPA, it uses a different
> OpenJPAConfiguration, which returns a different MetadataFactory
> (different instance), and an error is raised as if the class was not
> enhanced.
> I don't see how to force OpenJPA to use the same configuration/ 
> metadata
> used by the PCClassFileTransformer, and don't even understand if  
> this is
> somehow a way to proceed or if there is another (maybe simpler and
> smarter) solution.
> Got any idea?
> Thanks in advance,
> Simone
> -- 
> Simone Gianni
> CEO Semeru s.r.l.
> Apache Committer

Patrick Linskey
202 669 5907

View raw message