geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phani Madgula" <>
Subject Re: Trying to create EntityManager in web application
Date Tue, 03 Jun 2008 09:52:03 GMT

I was able to inject EntityManager in a servlet class by placing
META-INF/persistence.xml in WEB-INF/classes. Only when
META-INF/peristence.xml is placed in WEB-INF/classes does the web
application is able to read the persistence.xml (application
classloader is able to find it).

I felt it's quite offbeat to have META-INF/persistence.xml in
WEB-INF/classes?? We usually have this META-INF folder at the root of
archive (as a sibling to WEB-INF folder). Would this be a right


On 5/29/08, Viet Nguyen <> wrote:
> I figure that you would have an EJB app that defines some entity beans
> because you have a persistence.xml and you refer to this xml so that
> you can get a hold of some Entity Beans via the EntityManagerFactory.
> -Viet

View raw message