Hi,

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?

-Patrick

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


--
Patrick Linskey
202 669 5907

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to