Geronimo doesn't use jndi for the datasources in persistence.xml. You don't need to configure resource-refs for the datasources. You do need to make sure they are in ancestor plugins to the app and that you use the name from the datasource configuration. In this case I think that would be SystemDatabase In my experience, at least with derby, you need both jta and non-jta datasource. I guess if you aren't using jta transactions at all you might be able to use just a non-jta-data-source, but I haven't tried this. thanks david jencks On Feb 12, 2010, at 6:53 AM, Alexandros Karypidis wrote: > Hello, > > My scenario is this: > > I have a library with entities (as in @Entity objects) containing my > domain model. I want to declare a container-managed persistence unit > in a standalone WAR (not EAR), using that library (the > persistence.xml must NOT be in the library, but the WAR). So, I > proceed as follows (this is valid as far as I know, base on J2EE5 > specs): > > 1) I have declared a data source in geronimo-web.xml and web.xml > (see below for file contents). > 2) I put my library (as a jar) in my WAR's WEB-INF/lib and added a > WEB-INF/classes/META-INF/persistence.xml in the WAR (see below for > file contents). > > Deployment after performing step (1) worked and I could see the data > source registered in the console. > > Deployment after performing step (2) fails; from what I understand > from the error (see below), geronimo claims the data-source from > step (1) does not exist. I assume that geronimo tries to create the > persistence context prior to registering the data source? (i.e. it > processes persistence.xml prior to apply the configuration from > web.xml and geronimo-web.xml). > > What do I need to configure this properly. My deployment descriptors > and the error trace follow: > > persistence.xml > ------------------------------------------------------------------------------------------------------------------------------------------------- > > xmlns="http://java.sun.com/xml/ns/persistence" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation=" > http://java.sun.com/xml/ns/persistence > http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" > version="1.0"> > > jdbc/AppDataSource > app-entities.jar > > > > > web.xml > ------------------------------------------------------------------------------------------------------------------------------------------------- > > xmlns="http://java.sun.com/xml/ns/j2ee" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation=" > http://java.sun.com/xml/ns/j2ee > http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd" > version="2.4"> > > App > > > > > jdbc/AppDataSource > javax.sql.DataSource > Container > Shareable > > > > > > geronimo-web.xml > ------------------------------------------------------------------------------------------------------------------------------------------------- > > xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2" > xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0" > xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"> > > > > app > app-frontend > 0.0.1 > car > > > > > org.apache.geronimo.configs > > system-database > > > > > > /app > > > > > jdbc/AppDataSource > SystemDatasource > > > > __________________________________________________ > Χρησιμοποιείτε Yahoo!; > Βαρεθήκατε τα ενοχλητικά μηνύματα > (spam); Το Yahoo! Mail διαθέτει την καλύτερη > δυνατή προστασία κατά των > ενοχλητικών μηνυμάτων > http://mail.yahoo.gr