线程“main”中的异常java.lang.NoClassDefFoundError: sdb/sdbconfig

发布于 2024-10-30 19:32:51 字数 3426 浏览 6 评论 0原文

我想将我的本体(在 Protege 中制作)导出到 MySQL 数据库中。我遵循这些说明: https://jena.apache.org/documentation/sdb/installation.html,和 https://jena.apache.org/documentation/sdb/commands.html。 当我使用命令“bin/sdbconfig --sdb=sdb.ttl --create”时,我收到此错误:

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.

我像这样设置环境变量:

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

这是命令“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

这是是“Store/sdb.ttl”文件: @

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" ;
    .

谁能告诉我我做错了什么?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

野味少女 2024-11-06 19:32:51

这是一个非常基本的错误:sdbconfig 的类路径一定是错误的。不过我根本不懂windows和cygwin。

我的猜测是“My Dropbox”路径中的空格导致了此问题。您可以尝试将 sdb 移动到另一个目录吗?您还可以尝试export SDBROOT="d:/My\ Dropbox/Diplomska/SDB-1.3.3"

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".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文