openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <>
Subject Re: Runtime Enhancement: Problems with Ant Task in Eclipse
Date Wed, 20 May 2009 13:26:55 GMT


I was thinking about this problem some more this morning and since you're
enhancing your Entities at build time, there isn't any reason to have a
Spring weaver configured. I did some digging around and found a forum post
regarding this very issue [1]. 



Naomi-san wrote:
> Hi Rick,
> thank you so much for your time you spent!
> Aww, I knew, that there was a time I did not have that enhance-message,
> but I thought I just imagined it ;)
> I already used the InstrumentationLoadTimeWeaver some time before (that is
> why it was commented out in db.xml), but got warning messages that I had
> to use it with a Java agent. Because configuration examples for Spring and
> OpenJPA which I found in the internet used SimpleLoadTimeWeaver, I also
> did so.
> Thanks to you I had a hint where the problem might be and could search
> more specificly and found this discussion:
> It seems that the LoadTimeWeavers provided by Spring have problems with
> the possible byte code enhancement at runtime (or something like that). 
> There is also an alternative "OpenJpaLoadTimeWeaver" attached, which just
> excludes the org.apache.openjpa package (don't know why this helps...). I
> could not find it in the Spring package where it should reside, so I just
> added the source to my project, and included it in my db.xml as
> LoadTimeWeaver.
> Now it works without the error message but still I have another problem. I
> first thought it was because the classes are not enhanced / the error
> message, but as we found out, this is not the case:
> I can not use lazy fetching for relations where I set the FetchType.LAZY.
> If I want to get the content of the specific attributes, I always get a
> null value (and there definitely should be any content).
> Lazy fetching for attributes that where mapped with FetchType.EAGER but
> reached the MaxFetchDepth does not seem to be a problem.
> Any ideas? ^^"
> Greetings!
> Naomi
> -------- Original-Nachricht --------
>> Datum: Tue, 19 May 2009 11:05:17 -0700 (PDT)
>> Von: Rick Curtis <>
>> An:
>> Betreff: Re: Runtime Enhancement: Problems with Ant Task in Eclipse
>> Naomi --
>> I've spent the better part of my morning trying to figure out what was
>> going
>> on and I finally have an answer for you. Please don't ask me to explain
>> why
>> I did what I did, because honestly I'm not entirely sure what the problem
>> is. Through debugging I found that there was some class definition
>> oddness
>> when your JUnit started running through Spring code. Please let me know
>> if
>> you would like more details, otherwise see below for a 'fix'/workaround.
>> In your db.xml file you define a loadTimeWeaver property for bean
>> id="entityManagerFactory". I noticed that you had two properties and one
>> of
>> them was commented out.  When I switched from
>> org.springframework.instrument.classloading.SimpleLoadTimeWeaver to
>> org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver,
>> the JUnit passed. Please give that a shot. 
>> -Rick
>> -- 
>> View this message in context:
>> Sent from the OpenJPA Users mailing list archive at
> -- 
> Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate +
> Telefonanschluss für nur 17,95 Euro/mtl.!*

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message