openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Sutter (JIRA)" <>
Subject [jira] Commented: (OPENJPA-1860) How do I get OpenJPA to use my custom classloader to load Entity classes?
Date Thu, 28 Oct 2010 15:12:19 GMT


Kevin Sutter commented on OPENJPA-1860:

Application Entity code gets loaded by either Container or OpenJPA specific classloaders.
 We do this because OpenJPA does its own byte code enhancement and we need some control over
how these classes are loaded.

>From your description, it sounds like you are running outside of a Container environment,
correct?  When do you perform the OpenJPA Enhancement processing of the Entities?  Do you
do this as part of your build process?  Or, do you rely on using OpenJPA as a java agent?

Not sure if this would work or not, but have you considered using a java agent for your byte
code enhancement?  Depending on your environment, we may get into a race condition.  That
is, who gets to do their enhancement first...

No easy answers on this one...

> How do I get OpenJPA to use my custom classloader to load Entity classes?
> -------------------------------------------------------------------------
>                 Key: OPENJPA-1860
>                 URL:
>             Project: OpenJPA
>          Issue Type: Question
>          Components: jpa
>    Affects Versions: 2.0.1
>         Environment: OpenJPA 2.0.1 Java 1.6-22
>            Reporter: Hugh
> I have written a custom classloader and I can't work out how to get OpenJPA to use it
to load my entity classes.
> I've followed instructions I found to set Thread.currentThread().setContextClassLoader()
at startup before loading any EntityManager and it seems to load the OpenJPA classes and a
lot of others, but not the class I'm interested in.
> Is this the right approach?
> If so, where have I gone wrong? (
> If not, how should this be done?
> Is there some sort of guide to accomplishing this that someone could point me to?
> Thanks.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message