openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <d...@iq80.com>
Subject Re: Do mapped superclasses work at all in OpenJPA?
Date Tue, 13 Feb 2007 19:14:42 GMT
On Feb 13, 2007, at 9:59 AM, Craig L Russell wrote:

> Hi Dain,
>
> Sounds like a jackpot full of issues here.
>
> On Feb 13, 2007, at 9:17 AM, Dain Sundstrom wrote:
>
>> I found the problem.  In my entity mappings file, I had a mapping  
>> for a bean that no longer exists.  When I comment out that  
>> mapping, the problem goes away.  I only fond the problem by  
>> turning the debug level up
>
> The WARN messages should "usually" print. You have to dial *down*  
> the log level to not see them. What was your log level when WARN  
> didn't print? Issue #1?

I think it might be ERROR when integrated into OpenEJB.  I'll have to  
verify and adjust down to WARN so we can see these errors.

>>   (the full log is attached).  In the log we do warn that the  
>> class was not found, but we say we are going to ignore it:
>>
>> 299  CMP  WARN   [main] openjpa.MetaData - The class  
>> "openejb.org.apache.openejb.test.entity.cmr.cmrmapping.OneOwningSideB 
>> ean" listed in the openjpa.MetaDataFactory configuration property  
>> could not be loaded; ignoring.
>>
>> But later we get a transformation exception due to the missing class:
>>
>> 1243  CMP  WARN   [main] openjpa.Enhance - An exception was thrown  
>> while attempting to perform class file transformation on  
>> "org.apache.openejb.test.entity.cmp.BasicCmpBean":
>> <0|false|0.9.7-incubating-SNAPSHOT>  
>> org.apache.openjpa.util.GeneralException:  
>> org.xml.sax.SAXException: file:/Users/dain/work/openejb/trunk/ 
>> openejb3/container/openejb-core/target/test-classes/META-INF/jpa- 
>> test-mappings.xml [Location: Line: 45, C: 118]: Type  
>> "openejb.org.apache.openejb.test.entity.cmr.cmrmapping.OneOwningSideB 
>> ean" could not be instantiated.
>>
>>
>> I think we should either ignore the missing class everywhere or  
>> throw an exception on the first time we notice the missing class  
>> (I prefer the former).
>
> I also prefer ignoring it consistently. But considering that  
> enhancement fails, this seems like more than a WARN. More like a  
> SEVERE. And if you get a SEVERE during enhancement, should we  
> really put the EMF into service at all? Issue #2?

I agree.  If we get an enhancement error, I think we should throw an  
exception from the EMF consturctor.  The problem is that enhancement  
seems to happen only as beans are used (loaded into memory), so the  
EMF doesn't know that enhancement won't work.

>>
>> Secondly, are we parsing the XML file multiple times?  The only  
>> way for the first warning to be fired is if OpenJPA has read my  
>> entity mappings, but the exception that is thrown later is a SAX  
>> exception which implies that OpenJPA is reading the file again.
>
> Sounds like an inefficient startup algorithm that we should fix.  
> Issue #3?

:)

-dain

Mime
View raw message