openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wahoobill <>
Subject OpenJPA throws persistence exception when tryin to persist WAS7.0 entities
Date Mon, 18 Jan 2010 19:08:37 GMT

We are running WAS and OpenJPA 1.2.2 on our application. When we
attempt to perform a query to retrieve a list
of a table which has foreign keys, it fails with the attached exception.

the Entitys are as follows:

public class TbUser implements Serializable {
private int userId;
private Set<TbAccount> tbAccountCollection;
public class TbAccount implements Serializable {
private int accountId;

@ManyToOne(targetEntity = TbUser.class, optional = false)
private TbUser uid;

The business logic code is :

public List<TbAccount> getTbAccountByUserId(TbUser user) {
EntityManager em = getEntityManager();
List<TbAccount> results = null;
try {
Query query = em.createNamedQuery("getTbAccountByUserId");
query.setParameter("uid_userid", user.getUserId());
results = (List<TbAccount>) query.getResultList();
} finally {
return results;

and finally the query from above is:

@NamedQuery(name="getTbAccountByUserId", query = "SELECT t FROM TbAccount t
WHERE t.uid.userId = :uid_userId")})
A snipit of the exception is :

11:43:34:984 EST] 0000001a servlet I init SRVE0242I: KermitEAR
[/KermitWeb] [/DisplayDeviceSettings.jsp]: Initialization successful.
1/12/10 11:43:34:828 EST 0000001a SystemErr R
<openjpa-1.2.2-SNAPSHOT-r422266:778978M-OPENJPA-975 nonfatal general error>
org.apache.openjpa.persistence.PersistenceException: null
1/12/10 11:43:34:828 EST 0000001a SystemErr R at
1/12/10 11:43:34:828 EST 0000001a SystemErr R at

The complete exception is attached.
Stuck -- any help would be very appreciated

Bill entity_excp.rtf 
View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message