I got the following exception:

Caused by: javax.naming.NameNotFoundException: Unrecognized name, does
not start with expected 'services':
service/javax.sql.DataSource/(osgi.jndi.service.name=h2Database)
        at org.apache.servicemix.naming.OSGiContext.lookup(OSGiContext.java:67)
        at 
org.apache.servicemix.naming.InitialContextWrapper.lookup(InitialContextWrapper.java:173)
        at 
javax.naming.InitialContext.lookup(InitialContext.java:392)[:1.6.0_31]
        at 
org.apache.aries.jpa.container.unit.impl.DelayedLookupDataSource.getDs(DelayedLookupDataSource.java:55)

This code used to work in the past, though.  I do remember changing it
to make it work.  Is it supposed to be "service" or is it supposed to
be "services"?  The Aries JPA documentation gives the following
example:

<persistence-unit name="ReportIncident" transaction-type="JTA">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>

<jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/reportincidentdb)</jta-data-source>

which is the structure I'm using.

Reply via email to