MySQL configuration for FUSEKI

I need to test a particular database solution against an old one that used fuseki+mysql as a triple store. Basically all I need to do is some query against a database, that i previously created, with SPARQL. The problem is that I don't seem to be able to configure fuseki to give me an endpoint of this database. I've created the database with normal standard java coding (JDBC without using Jena SDB Component). The version of mysql I'm using is:

mysql  Ver 14.14 Distrib 5.5.37, for debian-linux-gnu (x86_64) using readline 6.3

Basically I've a ClassNotFoundException that i can't solve. Here the details of the exception:

    com.hp.hpl.jena.shared.JenaException: java.lang.ClassNotFoundException: net.rootdev.fusekisdbconnect.SDBConnect
    at com.hp.hpl.jena.assembler.AssemblerHelp.loadClassNamedBy(
    at com.hp.hpl.jena.assembler.AssemblerHelp.loadArbitraryClass(
    at com.hp.hpl.jena.assembler.AssemblerHelp.loadArbitraryClasses(
    at com.hp.hpl.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.loadClasses(
    at com.hp.hpl.jena.assembler.assemblers.AssemblerGroup$
    at org.apache.jena.fuseki.server.FusekiConfig.processService(
    at org.apache.jena.fuseki.server.FusekiConfig.configure(
    at org.apache.jena.fuseki.FusekiCmd.exec(
    at arq.cmdline.CmdMain.mainMethod(
    at arq.cmdline.CmdMain.mainRun(
    at arq.cmdline.CmdMain.mainRun(
    at org.apache.jena.fuseki.FusekiCmd.main(
Caused by: java.lang.ClassNotFoundException: net.rootdev.fusekisdbconnect.SDBConnect
    at Method)
    at java.lang.ClassLoader.loadClass(
    at sun.misc.Launcher$AppClassLoader.loadClass(
    at java.lang.ClassLoader.loadClass(
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(
    at com.hp.hpl.jena.assembler.AssemblerHelp.loadClassNamedBy(
    ... 13 more

The invocation of fuseki adds the libraries needed to the classpath (i stored them in a lib dir inside the fuseki main dir):

java -cp lib/arq-2.8.8.jar:lib/arq-2.8.9-SNAPSHOT.jar:lib/jena-iri-0.9.0-incubating.jar:lib/mysql-connector-java-5.1.19.jar:lib/ReconnectingSDB-0.1-SNAPSHOT.jar:lib/sdb-1.3.4.jar -jar fuseki-server.jar --config=fuseki-mysql.ttl

My configuration file:

    # Licensed under the terms of

@prefix :        <#> .
@prefix fuseki:  <> .
@prefix rdf:     <> .
@prefix rdfs:    <> .
@prefix tdb:     <> .
@prefix ja:      <> .
@prefix jumble:  <> .
@prefix sdb:     <> .

[] rdf:type fuseki:Server ;
   # Timeout - server-wide default: milliseconds.
   # Format 1: "1000" -- 1 second timeout
   # Format 2: "10000,60000" -- 10s timeout to first result, then 60s timeout to for rest of query.
   # See java doc for ARQ.queryTimeout
   ja:context [ ja:cxtName "arq:queryTimeout" ;  ja:cxtValue "10000,60000" ] ;

   fuseki:services (
   ) .

[] ja:loadClass "net.rootdev.fusekisdbconnect.SDBConnect" .
jumble:SDBConnect rdfs:subClassOf ja:RDFDataset .

<#service_MySQL_read_only> rdf:type fuseki:Service ;
    rdfs:label                      "UF MySQL Service (R)" ;
    fuseki:name                     "MySQL" ;
    fuseki:serviceQuery             "query" ;
    fuseki:serviceQuery             "sparql" ;
    fuseki:serviceUpdate            "update" ;
    fuseki:serviceUpload            "upload" ;
    fuseki:serviceReadWriteGraphStore      "data" ;
    # A separate read-only graph store endpoint:
    fuseki:serviceReadGraphStore       "get" ;
    fuseki:dataset           <#ufmysql_dataset_read> ;
    #fuseki:dataset           <#MySQLStore> ;
<#ufmysql_dataset_read> rdf:type      sdb:DatasetStore ;
    sdb:store <#MySQLStore>
<#MySQLStore> rdf:type jumble:SDBConnect;
    rdfs:label                  "UF MySQL SDB Store";
    sdb:layout                  "layout2";
    [ rdf:type sdb:SDBConnection;
        sdb:sdbHost "localhost";
        sdb:sdbType "MySQL";
        sdb:sdbName "EA_db_test";
        sdb:sdbUser "*****";
        sdb:sdbPassword "*****";
        sdb:driver "com.mysql.jdbc.Driver";

If i put instead of ja:loadClass "net.rootdev.fusekisdbconnect.SDBConnect" (that i think is a bit of an old one) ja:loadClass "com.hp.hpl.jena.sdb.SDB" I get the same exception but with SDB class

com.hp.hpl.jena.shared.JenaException: java.lang.ClassNotFoundException: com.hp.hpl.jena.sdb.SDB

The list of jar that I've inside the lib folder in fuseki is:

2247124 mag 12  2012 arq-2.8.8.jar
2259436 mag 12  2012 arq-2.8.9-SNAPSHOT.jar
154157 mag 12  2012 jena-iri-0.9.0-incubating.jar
801912 mag 12  2012 mysql-connector-java-5.1.19.jar
6657 mag 12  2012 ReconnectingSDB-0.1-SNAPSHOT.jar
529092 mag 12  2012 sdb-1.3.4.jar

My version of FUSEKI:

Jena:       VERSION: 2.7.1-incubating-SNAPSHOT
Jena:       BUILD_DATE: 20120426-0201
ARQ:        VERSION: 2.9.1-incubating-SNAPSHOT
ARQ:        BUILD_DATE: 20120430-1956
TDB:        VERSION: 0.9.1-incubating-SNAPSHOT
TDB:        BUILD_DATE: 20120430-2052
Fuseki:     VERSION: 0.2.2-incubating-SNAPSHOT
Fuseki:     BUILD_DATE: 20120501-1232

There's any particular combination of jar version I should use? Any pointer on where I can find the jar missing (if something is missing or if I need a different version). Or am I just wrong with the configuration file and I should use something different?

Thx for the help


  1. Don't mix versions of Jena jars - use a set of jars from a single distribution
  2. -cp and -jar don't work togther - the classpath setting will be ignored.

because of (2) net.rootdev.fusekisdbconnect.SDBConnect isn't coming from the jar.

it looks like it is pure classpath issue, has nothing to do with any other stuff you have. I found awesome link on classpaths. Main point there:

Its also worth noting that when you use the java -jar command line option to run your Java program as an executable JAR, then the CLASSPATH environment variable will be ignored, and also the -cp and -classpath switches will be ignored. In this case you can set your Java classpath in the META-INF/MANIFEST.MF file by using the Class-Path attribute. In short Class-path attribute in manifest file overrides classpath specified by -cp, -classpath or CLASSPATH environment variable.

Hope this helps.

Need Your Help

what is the meaning of $(this) in javascript

javascript jquery calendar

I have following code for Calendar Pop-Up which is working fine

Bootstrap Affix plugin with fluid layout

twitter-bootstrap fluid-layout

If I would like to use the affix plugin for sidebar in fluid layout but the width of the sidebar always change when it is affixed and the responsive design don't work too.