Hello everyone,
I am working on a plugin for
Protege 4.3 in which I would like to use Stardog. I'm starting a Stardog server manually on my machine and try to connect to it via HTTP or SNARL from within my plugin code.
Since I'm not very experienced in coding, I ran into some problems.
I am coding the plugin in Eclipse where I put stardog client .jars in the build path and compile it with an ant script that was provided to build protege plugins. To include the stardog client libraries needed for the connection I modified the ant script to simply extract all needed stardog library .jars into the root directory of my plugin .jar.
Since I did this, there are no "ClassNotFound" Exceptions anymore when using the plugin. However, I am getting the Stardog exception that says "No Driver was found which supports the connection string 'snarl://localhost:5820'" which seems to happen if .jars are missing from the class path as I read in a thread about it.
I'm guessing that this has something to do with the way Protege is loading the plugins. I guess it loads the classes that I use in my code but not the ones that those classes reference, even though they are included as well in my plugin .jar.
Can you point me to the right direction to solve this? I think extracting the stardog .jars into my .jar is not good practice to begin with. I think you can state "required packages" in the manifest file of the plugin but for this to work, the stardog libraries would have to be OSGI packages I think (again: I'm not really experienced with this).
I am including all *.jar files from these directories:
stardog-2.2.4/client/snarl
stardog-2.2.4/client/http
stardog-2.2.4/client/jena
stardog-2.2.4/client/api
My code that causes the exception looks like this:
AdminConnection aAdminConnection = AdminConnectionConfiguration.toServer("snarl://localhost:5820").credentials("admin", "admin").connect();
(Using http to connect results in the same exception for http driver)
If I try this code in a fresh eclipse project including the same .jars from the directories mentioned above it connects just fine.
Thanks in advance!
Manuel