Hello,
I've written a small OSGi Declarative Services application to run in Apache Karaf 4.0.7 to persist an entity into an ObjectDB database.
I'm working in C/S model and I have both the ObjectDB server and Karaf running on localhost.
When I try to persist the entity I'm getting the
javax.persistence.PersistenceException: No Persistence provider for EntityManager named objectdb://localhost:6136/technolink.odb;user=admin;password=admin
exception in the Karaf log.
I have deployed the objectdb.jar file that I fixed in order to make it a valid OSGi bundle.
I have attached:
1) my bundle to deploy to Karaf
2) the objectdb bundle I use
3) a zip file containing the source project (Eclipse Neon.1, Bndtools 3.3.0).
In order to build the code, you need to have lombok in the classpath (https://projectlombok.org) and lombok enabled in Eclipse (https://projectlombok.org/download.html).
I saw a thread in the forum (form 2011 - http://www.objectdb.com/database/forum/286) that refers to the same exception and the workaround is to change the classloader. I suppose in that case, the objectdb.jar file was included in the bundle that is supposed to reference it.
I want to deploy objectdb.jar file only once to my karaf and use it like any other OSGi bundle.
Many thanks in advance for your precious feedback,
Alex