openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bender1199 <sefr...@googlemail.com>
Subject Re: VerifyError when using IdClass with BigInteger/BigDecimal
Date Mon, 18 Jan 2010 16:49:18 GMT

Hi, thanks for the fast supply. This is my decompiled
pcCopyKeyFieldsToObjectId

public void pcCopyKeyFieldsToObjectId(Object paramObject) {
    EmailAddress.EmailAddressId localEmailAddressId =
(EmailAddress.EmailAddressId)((ObjectId)paramObject).getId();
    Account localAccount = this.account;
    Object localObject;
    if (localAccount != null)
        localObject = ((PersistenceCapable)localAccount).pcFetchObjectId();
localEmailAddressId.account = ((localObject != null) ?
((BigIntegerId)localObject).getId() : null);
    localEmailAddressId.ix = this.ix;
}


Fay Wang wrote:
> 
> I have seen this problem before, but somehow it went away. I am using your
> entity definition but could no longer reproduce the problem. Using java
> decompiler, the following is my pcCopyKeyFieldsToObjectId in EmailAddress.
> Can you post your problematic pcCopyKeyFieldsToObjectId?
> 
>   public void pcCopyKeyFieldsToObjectId(Object paramObject)
>   {
>     Object localObject;
>     EmailAddressId localEmailAddressId =
> (EmailAddressId)((ObjectId)paramObject).getId();
>     Account localAccount = this.account;
>     if (localAccount != null)
>       localObject =
> ((PersistenceCapable)localAccount).pcNewObjectIdInstance();
>     localEmailAddressId.account = ((localObject != null) ?
> ((BigIntegerId)localObject).getId() : null);
>     localEmailAddressId.ix = this.ix;
>   }
> 
> 
> -Fay
> 
> 
> 
> ----- Original Message ----
> From: Bender1199 <sefri09@googlemail.com>
> To: users@openjpa.apache.org
> Sent: Sun, January 17, 2010 1:38:37 PM
> Subject: VerifyError when using IdClass with BigInteger/BigDecimal
> 
> 
> I'm using openjpa-all 2.0.0-M3.
> 
> I've following classes
> 
> @Entity
> public class Account {
> 
>    @Id
>    private BigInteger id;
> 
>    private String name;
> 
>    private String password;
>    ...
> }
> 
> @Entity
> @IdClass(EmailAddress.EmailAddressId.class)
> public class EmailAddress{
>   
>    @Id @ManyToOne
>    private account;
> 
>    @Id
>    private BigInteger ix;
> 
>    private String address;
> 
>    public static class EmailAddressId{
>       public BigInteger account;
>       public BigInteger ix;
>       ...
>    }
> }
> 
> Now when I'm creating an EntityManager this error occures
> 
> java.lang.VerifyError: (class: EmailAddress, method:
> pcCopyKeyFieldsToObjectId signature: (Ljava/lang/Object;)V) Bad type in
> putfield/putstatic
>     at java.lang.Class.forName0(Native Method)
>     at java.lang.Class.forName(Class.java:247)
>     at
> org.apache.openjpa.meta.MetaDataRepository.classForName(MetaDataRepository.java:1448)
>     at
> org.apache.openjpa.meta.MetaDataRepository.loadPersistentTypes(MetaDataRepository.java:1421)
>     at
> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:273)
>     at
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:229)
>     at
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:203)
>     at
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:152)
>     at
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:199)
>     at
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:150)
>     at
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
> 
> Same behaviour when using BigDecimal as ID field. When using Long it
> works!
> 
> Anyone an idea?
> 
> 
> -- 
> View this message in context:
> http://n2.nabble.com/VerifyError-when-using-IdClass-with-BigInteger-BigDecimal-tp4410186p4410186.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
> 
> 
> 
>       
> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/VerifyError-when-using-IdClass-with-BigInteger-BigDecimal-tp4410186p4414695.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message