openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Goodenough <david.goodeno...@btconnect.com>
Subject How to diagnose rather cryptic error messages
Date Tue, 01 Apr 2008 14:04:03 GMT
I am relatively new to JPA, and trying to get to grips with what I can 
and can not do with it.

So I thought I would try creating a small system (which will grow) which
has amongst other things User objects and Role objects in it.

OpenJPA has successfully taken my list of Entities and created the
relevant tables.  The Entity classes have all been enhanced.  I am using
OpenJPA 1.0.2.

I create a Role object (which does not contain a reference to other 
objects) and persist it.  No errors are reported, but the object does
not appear as a record in the DB.  Does a persist have to be inside 
a Transaction?  The manual is confusing as it says that "this action can
only be performed in the context of an active transaction" right at the
end of the description of persist, but I read it (given the way it was 
laid out) to apply to the remove action which immediately follows it.

Then create a User object, which amongst other things has a List of
Role objects in it, so I add the Role object I just create to it, fill in all 
the other fields, and try to persist it.  

I get back an exception which says:-

Exception in thread "main" <openjpa-1.0.2-r420667:627158 fatal general error> 
org.apache.openjpa.persistence.PersistenceException: null
        at 
org.apache.openjpa.meta.ProxySetupStateManager.providedStringField(ProxySetupStateManager.java:234)
        at uk.co.dga.bm.jpa.User.pcProvideField(User.java)
        at 
org.apache.openjpa.meta.ProxySetupStateManager.setProxyData(ProxySetupStateManager.java:58)
        at 
org.apache.openjpa.meta.ClassMetaData.resolveMeta(ClassMetaData.java:1731)
        at 
org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1613)
        at 
org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:675)
        at 
org.apache.openjpa.meta.MetaDataRepository.resolveMeta(MetaDataRepository.java:575)
        at 
org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:500)
        at 
org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:302)
        at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2372)
        at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2225)
        at 
org.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java:1005)
        at 
org.apache.openjpa.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:541)
        at uk.co.dga.bm.loader.CreateUser.run(CreateUser.java:34)
        at uk.co.dga.bm.loader.CreateUser.main(CreateUser.java:41)

which is not very helpful.  How do I get more information on exactly what it 
is trying to do so that I can fix it?

David

Mime
View raw message