On Mar 31, 2008, at 8:32 AM, luoluo wrote:


Hi,

I have an application using JPA with hibernate. I changed the persistence provider to hibernate and trying to using db-pools. It works perfectly fine in Geronimo 2.02. But when I tried to deploy it to Geronimo 2.1. It throw
out an exception with can not find JNDI entry for the data source when
Geronimo try to start the application.

I found the different between 2.0.2 and 2.1. In 2.0.2, the entity manager was initialized when first time db-access. At that time, the data source is
already be registered in JNDI as /comp/env/jdbc/...DS.

In 2.1, Geronimo try to initialize the entity manager when starting the application. The sequence is wrong. It tried to find the data source before
the reference in Web.xml been registered. So the JNDI entry not find
exception was thrown out.

Is that a bug of Geronimo 2.1? Is there any way to work around this issue in
2.1?

I'm a little confused about how you are using Hibernate. Geronimo jpa support does not use jndi at all. How are you getting Hibernate to use jndi rather than the configured jta-datasource and non-jta- datasource specified in persistence.xml?

thanks
david jencks



Thanks!

Bill

--
View this message in context: http://www.nabble.com/Persistence- unit-deploy-error-in-2.1-but-works-in-2.02- tp16396504s134p16396504.html Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Reply via email to