openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <curti...@gmail.com>
Subject Re: @Externalizer in 1.0.1 does not work on persist
Date Fri, 03 Jun 2011 18:14:32 GMT
This is slightly tangental, but I'm going to recommend staying far far away
from RuntimeEnhancement. There are numerous known issues with that
enhancement strategy and you'll save yourself a number of headaches if you
stay away from it. I'd set the following property[1] to disable this
support.

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

Thanks,
Rick

On Fri, Jun 3, 2011 at 12:10 PM, infinity2heaven
<infinity2heaven@gmail.com>wrote:

> I get two very different errors when using the default RuntimeEnhancement
> and
> using build-time enhancements:
>
> Runtime:
> I get a classCast for my entity Foo.
> java.lang.ClassCastException:
> org.apache.openjpa.enhance.ReflectingPersistenceCapable incompatible with
> xxx.entity.Foo
>
> Build-time:
> App doesn't load.
> java.lang.NoSuchMethodError: xxx/BaseEntity.pcGetManagedFieldCount()I
>        at xxx.entity.ProfileLoadError.<clinit>(ProfileLoadError.java)
>        at java.lang.J9VMInternals.initializeImpl(Native Method)
>        at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
>        at java.lang.Class.forNameImpl(Native Method)
>        at java.lang.Class.forName(Class.java:136)
>
> My persistence.xml
> <persistence xmlns="http://java.sun.com/xml/ns/persistence"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
>        http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
>        version="1.0">
>
>        <persistence-unit name="tcms-profile"
> transaction-type="RESOURCE_LOCAL" >
>
> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
>
>                <class>xxx.jpa.BaseEntity</class>
>        <class>xxx.entity.Foo</class>
>                <class>xxx.entity.ProfileAudit</class>
>                <class>xxx.entity.ProfileAuditDetail</class>
>
>                <properties>
>                        <property name="openjpa.jdbc.Schema" value="xyz"/>
>                </properties>
>        </persistence-unit>
> </persistence>
>
> What am I missing?
>
> Really. Two different errors based on openjpa's "enhancement."
>
-- 
*Rick Curtis*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message