geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From luoluo <luow...@hotmail.com>
Subject Persistence unit deploy error in 2.1 but works in 2.02
Date Mon, 31 Mar 2008 20:25:46 GMT

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.

in persistence.xml, I use below to refer the data source:

<persistence-unit name="CMWS">
	<provider>org.hibernate.ejb.HibernatePersistence</provider>
	<properties>
		<property name="hibernate.archive.autodetection"
				value="class" />

	        <property name="hibernate.connection.datasource"
				value="java:/comp/env/jdbc/CmwsDS" />
...

The data source is created and defined in web.xml too.

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?

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.


Mime
View raw message