开发者

Exception in thread "main" java.lang.NoClassDefFoundError: sdb/sdbconfig

I want to export my ontology (made in Protege) into MySQL database. I was following these instructions: https://jena.apache.org/documentation/sdb/installation.html, and https://jena.apache.org/documentation/sdb/commands.html. And when I use the command "bin/sdbconfig --sdb=sdb.ttl --create", I get this error:

Exception in thread "main" java.lang.NoClassDefFoundError: sdb/sdbconfig
Caused by: java.lang.ClassNotFoundException: sdb.sdbconfig
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
开发者_开发问答        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: sdb.sdbconfig.  Program will exit.

I set the environment variables like this:

Viktor@Pepe /cygdrive/d/My Dropbox/Diplomska/SDB-1.3.3
$ export SDBROOT="d:/My Dropbox/Diplomska/SDB-1.3.3"

Viktor@Pepe /cygdrive/d/My Dropbox/Diplomska/SDB-1.3.3
$ export SDB_USER="root"

Viktor@Pepe /cygdrive/d/My Dropbox/Diplomska/SDB-1.3.3
$ export SDB_PASSWORD=""

Viktor@Pepe /cygdrive/d/My Dropbox/Diplomska/SDB-1.3.3
$ export SDB_JDBC="d:/Fakultet/jars/mysql-connector-java-5.1.7-bin.jar"

Viktor@Pepe /cygdrive/d/My Dropbox/Diplomska/SDB-1.3.3
$ export PATH=$SDBROOT/bin:$PATH

This is the output of the command "bin/sdb_path":

Viktor@Pepe /cygdrive/d/My Dropbox/Diplomska/SDB-1.3.3
$ bin/sdb_path
d:/My Dropbox/Diplomska/SDB-1.3.3/lib/arq-2.8.7-tests.jar;d:/My Dropbox/Diplomsk
a/SDB-1.3.3/lib/arq-2.8.7.jar;d:/My Dropbox/Diplomska/SDB-1.3.3/lib/hsqldb-1.8.0
.10.jar;d:/My Dropbox/Diplomska/SDB-1.3.3/lib/icu4j-3.4.4.jar;d:/My Dropbox/Dipl
omska/SDB-1.3.3/lib/iri-0.8.jar;d:/My Dropbox/Diplomska/SDB-1.3.3/lib/jena-2.6.4
-tests.jar;d:/My Dropbox/Diplomska/SDB-1.3.3/lib/jena-2.6.4.jar;d:/My Dropbox/Di
plomska/SDB-1.3.3/lib/junit-4.5.jar;d:/My Dropbox/Diplomska/SDB-1.3.3/lib/log4j-
1.2.13.jar;d:/My Dropbox/Diplomska/SDB-1.3.3/lib/lucene-core-2.3.1.jar;d:/My Dro
pbox/Diplomska/SDB-1.3.3/lib/sdb-1.3.3-tests.jar;d:/My Dropbox/Diplomska/SDB-1.3
.3/lib/sdb-1.3.3.jar;d:/My Dropbox/Diplomska/SDB-1.3.3/lib/slf4j-api-1.5.8.jar;d
:/My Dropbox/Diplomska/SDB-1.3.3/lib/slf4j-log4j12-1.5.8.jar;d:/My Dropbox/Diplo
mska/SDB-1.3.3/lib/stax-api-1.0.1.jar;d:/My Dropbox/Diplomska/SDB-1.3.3/lib/wstx
-asl-3.2.9.jar;d:/My Dropbox/Diplomska/SDB-1.3.3/lib/xercesImpl-2.7.1.jar

And this is the "Store/sdb.ttl" file: @

prefix sdb:     <http://jena.hpl.hp.com/2007/sdb#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .

# MySQL - InnoDB


<#store> rdf:type sdb:Store ;
    sdb:layout     "layout2/index" ;
    sdb:connection <#conn> ;
    sdb:engine     "InnoDB" ;      # MySQL specific
.

<#conn> rdf:type sdb:SDBConnection ;
    sdb:sdbType       "MySQL" ;    # Needed for JDBC URL
    sdb:sdbHost       "localhost" ;
    sdb:sdbName       "SDB" ;
    sdb:driver        "com.mysql.jdbc.Driver" ;
    .

Can anyone tell me what am I doing wrong?


This is a really basic error: sdbconfig's classpath must be wrong. However I don't know windows and cygwin at all.

My guess is that the space in the path 'My Dropbox' is causing this. Could you try moving sdb to another directory? You could also try export SDBROOT="d:/My\ Dropbox/Diplomska/SDB-1.3.3".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜