persistence@glassfish.java.net

Re: EntityManagerSetupException when accessing db data from session bean

From: Tom Ware <tom.ware_at_oracle.com>
Date: Tue, 13 Feb 2007 10:11:28 -0500

Hi Ivan,

  I am not a Sun AS Expert, so maybe someone with more expertise in that
area can provide more input, but I can give you an idea of why that
error shows up in TopLink Essentials.

  That error occurs when something in the early initialization of the
persistence unit fails. Usually this indicates some kind of packaging
or configuration error. Is it possible there is some earlier error
message in your log file?

-Tom

Ivan Matavulj wrote:

>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
>
>