persistence@glassfish.java.net

EntityManagerSetupException when accessing db data from session bean

From: Ivan Matavulj <matavulj_at_yahoo.com>
Date: Mon, 12 Feb 2007 03:27:17 -0800 (PST)

Hello,
I have a problem accessing data in db table from a ejb
3.0 session bean.
I can successfully instantiate EntityManager for
OrderPU persistence unit, but execution fails when I
try to make a query:

@PersistenceContext(unitName="OrderPU")
EntityManager em;
...
public List findAll() {
Query q = em.createQuery("select object(o) from Line
as o");
...
}


with the following exception:

Caused by:
javax.ejb.TransactionRolledbackLocalException:
Exception thrown from bean; nested exception is:
javax.persistence.PersistenceException: Exception
[TOPLINK-28013] (Oracle TopLink Essentials - 2006.8
(Build 060830)):
oracle.toplink.essentials.exceptions.EntityManagerSetupException
Exception Description: Attempted to deploy
PersistenceUnit [OrderPU] for which predeploy method
either had not called or had failed
at
com.sun.ejb.containers.BaseContainer.checkExceptionClientTx(BaseContainer.java:3588)
at
com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3436)
at
com.sun.ejb.containers.StatefulSessionContainer.postInvokeTx(StatefulSessionContainer.java:2583)
at
com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
... 30 more

I'm using Sun Java System Application Server Platform
Edition 9.0_01 (build b14) on Win XP, and building &
running the example in Netbeans 5.5 (tried also 551dev
& 6dev).

I've been stuck with this problem for days, so any
help is appreciated ! .
Thanks a lot !


 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com