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
http://www.simonegianni.it/
CEO Semeru s.r.l.
Apache Committer

Reply via email to