Using OrientDB in OSGi environment

65 views
Skip to first unread message

t...@quarendon.net

unread,
Jun 10, 2016, 9:28:02 AM6/10/16
to OrientDB

There are a number of questions relating to this in this group, but they all seem pretty old, so I'll ask a fresh question.

I'm trying to use OrientDB as an embedded database ("memory:" at the moment) within a java application I'm writing using Eclipse and bndtools, so using osgi.

I have various osgi bundles downloaded from JPM, OrientDB version 2.2. 

I'm using the OrientDB blueprint API, so OrientGraph etc.

I have added orientdb-core and orientdb-graphdb as build dependencies of my project, however that on its own isn't enough, I need access to the tinkerpop blueprint code otherwise I get compile errors, but that doesn't seem to be available as an osgi bundle that I can see. 
I can make the compile errors go away by just adding the tinkerpop blueprints-core jar to my bundle as a build dependency, but then I get into all sorts of issues with packaging, and "resolving" the bundle so that it has everything at runtime, I end up having to add all of the blueprints stiff as private packages to my bundle which just seems wrong. 


Surely the orientdb bundles either need to have a dependency on a suitable blueprints bundle, or contain and export the relevant packages?

Is there a good way forward for this? 

Thanks.

odbuser

unread,
Jun 11, 2016, 2:17:59 AM6/11/16
to OrientDB
Here's what I do...

I make my own bundles for blueprints-core and orientdb.  The one for orientdb includes hazelcast and as many of the orientdb jars that I need.  I make sure to include all of the META-INF/services and use spifly with Require-Capability and Provide-Capability to make them work.

After going down the path of having separate jars, I ended up doing this to solve weird classloading issues.  Having hazelcast inside the orientdb jar may not be necessary anymore but I haven't had time to go back and figure out how to make it work that way.  It may be possible to separate out some but not all of the orientdb jars but again, it was just easier to combine them into one jar.  I have no need for that granularity in orientdb.

There are details that I'm leaving (such as possibly needing compendium from osgi, adding extras in the osgi startup instead of using a profile, and adding some additional or custom bundles depending on what you are doing) but at least you that you can go down that path and make it work.

t...@quarendon.net

unread,
Jun 13, 2016, 4:04:08 AM6/13/16
to OrientDB
OK, thanks. I'll try and do something similar.

Shame I have to do that myself though. Seems a curious situation that OrientDB appears to provide osgi bundles, but they are essentially useless.

Reply all
Reply to author
Forward
0 new messages