You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Thierry Templier <te...@yahoo.fr> on 2009/07/31 11:36:28 UTC

OpenJPA and load timpe weaving

Hello,

I'm using OpenJPA 1.1.0 and I wonder if it's possible to explicitly specify that we want to load time weaving.

Thanks for your help,
Thierry


      

Re: OpenJPA and load timpe weaving

Posted by Thierry Templier <te...@yahoo.fr>.
Hello Kevin,

I think that the problem comes from the fact I use OpenJPA with Spring and Spring DM within an OSGi environment. That's the reason for the bundleresource protocol...
I'd pleased to help you to address this problem! I'll have a look...
Thierry

> Thierry,
> My guess here is that we're having a problem with the classloader 
> accessing the root URL...  The type on this URL (bundlesource:) is not 
> what we're expecting.  We're only expecting "file:" or "jar:" for the 
> Root URL type.
> But, I know from past postings on our forum, that the use of Spring with
> OpenJPA does work just fine.  So, are you doing anything new or unique 
> with Spring that is causing this alternate URL type?  We might to adjust 
> our processing in this area, but I'd like to understand what's being 
> requested and why before making blind changes.
> 
> Thanks,
> Kevin


      

Re: OpenJPA and load timpe weaving

Posted by Kevin Sutter <kw...@gmail.com>.
Thierry,
My guess here is that we're having a problem with the classloader accessing
the root URL...  The type on this URL (bundlesource:) is not what we're
expecting.  We're only expecting "file:" or "jar:" for the Root URL type.
But, I know from past postings on our forum, that the use of Spring with
OpenJPA does work just fine.  So, are you doing anything new or unique with
Spring that is causing this alternate URL type?  We might to adjust our
processing in this area, but I'd like to understand what's being requested
and why before making blind changes.

Thanks,
Kevin

On Fri, Jul 31, 2009 at 9:24 AM, Thierry Templier <te...@yahoo.fr> wrote:

>
> Thanks very much Kevin and Jeremy for hints!
>
> I investigate further this aspect and it appears that OpenJPA tries to use
> first load time weaver. I see the message in log if the feature isn't
> available:
>
> openjpa.Runtime - An error occurred while registering a ClassTransformer
> with PersistenceUnitInfo: name 'myUnit', root URL [bundleresource://59/].
> The error has been consumed. To see it, set your openjpa.Runtime log level
> to TRACE. Load-time class transformation will not be available.
>
> Thierry
>
> > Hi Thierry,
> >
> > I did not see this in the blog post that Kevin referred to,
> > but it may be helpful as well.  You can explicitly turn off
> > OpenJPA's subclassing-based enhancement by specifying this
> > option in your persistence.xml:
> >
> >           <property
> > name="openjpa.RuntimeUnenhancedClasses"
> > value="unsupported"/>
> >
> > If your app is configured properly, classes (which are not
> > pre-enhanced) should get enhanced by the enhancer agent.  But, if
> > there are those that are not, subclassing will not occur and OpenJPA
> > will throw an exception stating that an entity was not enhanced.
> >
> > hth,
> >
> > -Jeremy
>
>
>
>

Re: OpenJPA and load timpe weaving

Posted by Thierry Templier <te...@yahoo.fr>.
Thanks very much Kevin and Jeremy for hints!

I investigate further this aspect and it appears that OpenJPA tries to use first load time weaver. I see the message in log if the feature isn't available:

openjpa.Runtime - An error occurred while registering a ClassTransformer with PersistenceUnitInfo: name 'myUnit', root URL [bundleresource://59/]. The error has been consumed. To see it, set your openjpa.Runtime log level to TRACE. Load-time class transformation will not be available.

Thierry

> Hi Thierry,
> 
> I did not see this in the blog post that Kevin referred to,
> but it may be helpful as well.  You can explicitly turn off
> OpenJPA's subclassing-based enhancement by specifying this
> option in your persistence.xml:
> 
>           <property
> name="openjpa.RuntimeUnenhancedClasses"
> value="unsupported"/>
> 
> If your app is configured properly, classes (which are not
> pre-enhanced) should get enhanced by the enhancer agent.  But, if
> there are those that are not, subclassing will not occur and OpenJPA 
> will throw an exception stating that an entity was not enhanced.
> 
> hth,
> 
> -Jeremy


      

Re: OpenJPA and load timpe weaving

Posted by Jeremy Bauer <te...@gmail.com>.
Hi Thierry,

I did not see this in the blog post that Kevin referred to, but it may be
helpful as well.  You can explicitly turn off
OpenJPA's subclassing-based enhancement by specifying this option in your
persistence.xml:

          <property name="openjpa.RuntimeUnenhancedClasses"
value="unsupported"/>

If your app is configured properly, classes (which are not pre-enhanced)
should get enhanced by the enhancer agent.  But, if there are those that are
not, subclassing will not occur and OpenJPA will throw an exception stating
that an entity was not enhanced.

hth,

-Jeremy

On Fri, Jul 31, 2009 at 8:17 AM, Kevin Sutter <kw...@gmail.com> wrote:

> Thierry,
> I would first reference this blog posting [1] on our Enhancement processing
> (load time weaving) and see if that helps answer your questions.  Or, at
> least it should help narrow the scope of the question...
>
> Thanks,
> Kevin
>
> [1]
> http://webspherepersistence.blogspot.com/2009/02/openjpa-enhancement.html
>
> On Fri, Jul 31, 2009 at 4:36 AM, Thierry Templier <te...@yahoo.fr>
> wrote:
>
> >
> > Hello,
> >
> > I'm using OpenJPA 1.1.0 and I wonder if it's possible to explicitly
> specify
> > that we want to load time weaving.
> >
> > Thanks for your help,
> > Thierry
> >
> >
> >
> >
>

Re: OpenJPA and load timpe weaving

Posted by Kevin Sutter <kw...@gmail.com>.
Thierry,
I would first reference this blog posting [1] on our Enhancement processing
(load time weaving) and see if that helps answer your questions.  Or, at
least it should help narrow the scope of the question...

Thanks,
Kevin

[1]
http://webspherepersistence.blogspot.com/2009/02/openjpa-enhancement.html

On Fri, Jul 31, 2009 at 4:36 AM, Thierry Templier <te...@yahoo.fr> wrote:

>
> Hello,
>
> I'm using OpenJPA 1.1.0 and I wonder if it's possible to explicitly specify
> that we want to load time weaving.
>
> Thanks for your help,
> Thierry
>
>
>
>