The OSGi Enterprise Expert Group has released a specification around using JPA in OSGi. You may want to have a look at the Aries project ( http://incubator.apache.org/aries/) which provides an implementation of this spec. You should be able to find some examples along with the implementation.
On Wed, May 5, 2010 at 22:37, Jason Reilly <jdr0...@renci.org> wrote: > Hi all, > > I am trying to get a project that uses OpenJPA deployed as a Service in > the Apache Karaf OSGi container. I am getting an exception when I do an > osgi:install of my project. The exception message is: > > javax.persistence.PersistenceException: No persistence providers for "rsp" > after trying the following discovered implementations: NONE > > > This is what my META-INF/persistence.xml looks like: > > <?xml version="1.0"?> > > <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi=" > http://www.w3.org/2001/XMLSchema-instance" version="1.0"> > > <persistence-unit name="rsp"> > > > <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider> > > ....snip classes.... > > <properties> > > <property name="openjpa.ConnectionURL" > value="jdbc:postgresql://localhost:5432/rsp"/> > > <property name="openjpa.ConnectionDriverName" > value="org.postgresql.Driver"/> > > <property name="openjpa.ConnectionUserName" value=""/> > > <property name="openjpa.ConnectionPassword" value=""/> > > <property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO"/> > > </properties> > > </persistence-unit> > > </persistence> > > > Here is a list of relevant installed bundles: > > [ 95] [Active ] [ ] [ 60] Commons Lang (2.4) > > [ 102] [Active ] [ ] [ 60] Commons Collections (3.2.1) > > [ 103] [Active ] [ ] [ 60] Commons Pool (1.5.3) > > [ 122] [Active ] [ ] [ 60] postgresql-8.4-701.jdbc4 (0) > > [ 145] [Active ] [ ] [ 60] Apache Geronimo JSR-317 JPA 2.0 > Spec API (1.1) > > [ 146] [Active ] [ ] [ 60] Apache Geronimo JSR-303 Bean > Validation Spec API (1.1) > > [ 148] [Active ] [ ] [ 60] > mvn:org.apache.openjpa/openjpa-all/2.1.0-SNAPSHOT > > > The Karaf version is 1.5.0-SNAPSHOT. > > Any insight on how to remedy this error would be great &, of course, let > me know if I need to provide more info. > > Thanks, > Jason > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@felix.apache.org > For additional commands, e-mail: users-h...@felix.apache.org > > -- Cheers, Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ Open Source SOA http://fusesource.com