Thanks for you response Tim. Indeed this is the root cause of the problem.
I tried to deploy the blueprint xml snippet directly into karaf and it didn't work. I got some errors about class not found etc (I think that it should work). I will try to add it inside the data nucleus bundle to see if I have better luck. I wil let you know ... Thanks again. On Wed, Nov 17, 2010 at 9:03 PM, Timothy Ward <timothyjw...@apache.org>wrote: > > Also, if this does fix your problem, please raise a JIRA against > DataNucleus to get their JPA provider registered according to the JPA > service specification. We want Aries to work with every JPA provider out > there! > > Regards, > > Tim > > ---------------------------------------- > > From: timothyjw...@apache.org > > To: aries-user@incubator.apache.org > > Subject: RE: Aries JPA Issue > > Date: Wed, 17 Nov 2010 19:01:15 +0000 > > > > > > Hi, > > > > The error you are seeing is because there are no OSGi compatible JPA > providers in your OSGi framework. By OSGi compatible, I mean providers that > register their PersistenceProvider implementation in the OSGi service > registry as defined in the JPA service specification. > > > > I see that you are choosing to use DataNucleus. I have not tried this > provider with Aries, and whilst there is no reason that it should not work I > am unsure as to whether they correctly expose their PersistenceProvider > implementation in the OSGi service registry. > > > > This problem should be simple to fix. If you change the DataNucleus > bundle to include blueprint metadata that exposes the > "org.datanucleus.jpa.PersistenceProviderImpl" class as a service using the > javax.persistence.spi.PersistenceProvider interface, and with a service > property of "javax.persistence.provider" with a value of > "org.datanucleus.jpa.PersistenceProviderImpl". > > > > An example blueprint snippet would be as follows: > > > > > > > > > > > > > > > > > > > > > > Regards, > > > > Tim > > > > > > > > ________________________________ > > > Date: Wed, 17 Nov 2010 19:51:35 +0200 > > > Subject: Aries JPA Issue > > > From: ioca...@gmail.com > > > To: aries-user@incubator.apache.org > > > > > > Hi, > > > > > > I am trying to build an application that uses aries jpa and deploy it > > > to karaf. > > > My application is similar to the blog sample application provided by > aries. > > > Inside my application I have a bundle that contains the persistence > > > unit, my entities and a DAO (as an OSGi service via bleuprint xml). > > > > > > This bundle falls in GracePeriod status, beacause it can't find the > > > EntityManagerFactory(?): > > > > > > Here is what I get in my log: > > > > > > Found initial references null for OSGi service > > > (&(&(org.apache.aries.jpa.proxy.factory=*)(osgi.unit.name > =wicket-osgi-pu))(objectClass=javax.persistence.EntityManagerFactory)) > > > > > > 18:36:45,823 | WARN | l Console Thread | > > > container | er.impl.PersistenceBundleManager > > > 564 | 171 - org.apache.aries.jpa.container - 0.2.0.incubating | There > > > are no providers available. > > > > > > My 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_2_0.xsd"> > > > > > > org.datanucleus.jpa.PersistenceProviderImpl > > > > > > aries:services/javax.sql.DataSource/(osgi.jndi.service.name > =jdbc/blogdb) > > > net.iocanel.database.entities.Person > > > > > > > > > > > > My blueprint.xml > > > > > > > > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > > xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.0.0" > > > xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.0.0" > > > xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 > > > http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd" > > > default-activation="lazy"> > > > > > > > class="net.iocanel.database.dao.PersonJpaDAO"> > > > > > > > unitname="wicket-osgi-pu" /> > > > > > > > > > > interface="net.iocanel.database.dao.PersonDAO"> > > > > > > > > > > > > -- > > > Ioannis Canellos > > > http://iocanel.blogspot.com > > > Integration Engineer @ Upstream S.A. > > > > > > > > > > -- *Ioannis Canellos* http://iocanel.blogspot.com Integration Engineer @ Upstream S.A. <http://www.upstreamsystems.com>