Is your OSGi service (datasource) is well exposed/started ?

I tried this yesterday and it works for me.


Arnaud Deprez,


-----Original Message-----
From: [email protected] [mailto:[email protected]] On 
Behalf Of James Carman
Sent: mardi 15 mai 2012 4:29
To: [email protected]
Subject: JNDI URLs services/service

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.



Atos Worldline SA/NV - Chaussee de Haecht 1442 Haachtsesteenweg
- 1130 Brussels - Belgium
RPM-RPR Bruxelles-Brussel - TVA-BTW BE 0418.547.872
Bankrekening-Compte Bancaire-Bank Account 310-0269424-44
BIC BBRUBEBB - IBAN BE55 3100 2694 2444

"The information contained in this e-mail and any attachment thereto is 
confidential and may contain information which is protected by intellectual 
property rights.
This information is intended for the exclusive use of the recipient(s) named 
above.
This e-mail does not constitute any binding relationship or offer toward any of 
the addressees.
If you are not one of the addressees , one of their employees or a proxy holder 
entitled to hand over this message to the addressee(s), any use of the 
information contained herein (e.g. reproduction, divulgation, communication or 
distribution,...) is prohibited.
If you have received this message in error, please notify the sender and 
destroy it immediately after.
The integrity and security of this message cannot be guaranteed and it may be 
subject to data corruption, interception and unauthorized amendment, for which 
we accept no liability."

Reply via email to