Hi Ionnis, Charles The aries:services URL scheme is actually still supported - it was originally developed by the aries team and then we helped to standardise support for it in the OSGi JNDI specification. The standard version obviously uses the OSGi name, but the correct syntax according to the specification would actually be:
osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/blogdb) Note that this uses "service" not "services" in the lookup. I agree this is a confusing difference between the URL schemes, but arguably we made the wrong choice originally with aries as the lookup returns a single service, not multiple services. Obviously since this has been through two releases we can't change the aries URL scheme now, so we're stuck with the mismatch I'm afraid. It is obviously preferrable for applications to use the standard syntax where possible, and the Aries JNDI code supports both URL schemes. Regards, Tim ________________________________ > Date: Thu, 18 Nov 2010 09:40:38 +0100 > From: [email protected] > To: [email protected] > Subject: Re: Aries JPA Issue > > Hi Ionnis, > > There is an error in your syntax : > > aries:services/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/blogdb) > > This shoud be --> > > osgi:services/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/blogdb) > > Regards, > > Charles > > On 17/11/10 18:51, Ioannis Canellos wrote: > 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. > >
