Apache jena SPARQL endpoint 实践异常解决

1.

在linux下部署的,发现了一个问题:fuseki-server进程结束过一次(kill或者是ctrl+z或者是终端被关掉),再次启动时会报错:DatasetPrefixesTDB WARN Mangled prefix map: graph name=

java.lang.NullPointerException

XXXX

......

org.apache.jena.assembler.exceptions.AssemblerException: caught: null

xxxx

.......

然后就访问不了了。

我发现每次重启如果重新用jena做一次tdbloader,就不会有这个问题,这是怎么回事呢?

解决:

删除tdb路径下所有prefixXXX文件,再次启动会重新生成这些文件。我之前也被这个问题搞了很久,在jena社区提问,有人给的回答某种程度解决了这个问题,如下:“where it is building the base graph.

The TDB database has a corrupted prefix table. At the warning, this was mentioned then ignored. On this path through the code, it is an error.

Using inference means that TDB is not running transactionally.

At some time in the past, that DB has not been closed cleanly.

As it's the prefixes, often you can delete the prefix table files but if

it is a small DB, it's better to rebuild it.”

2.

在配置好fuseki_conf.ttl后,第二次运行fuseki-server.bat时,出现以下错误:

[2018-03-09 15:41:33] Server ERROR Exception in initialization: Failed reading assembler description: java.nio.charset.MalformedInputException: Input length = 1

[2018-03-09 15:41:33] WebAppContext WARN Failed startup of context o.e.j.w.WebAppContext@30ed9c6c{/,file:///D:/environment/apache-jena-fuseki-3.6.0/webapp/,UNAVAILABLE}

org.apache.jena.sparql.ARQException: Failed reading assembler description: java.nio.charset.MalformedInputException: Input length = 1

解决:

同上,删除tdb路径下所有的prefix文件

3.

 Server ERROR Exception in initialization: the loading of content into file:///D:/AppsPath/apache-jena-fuseki-3.8.0/run/configuration/fuseki_conf.ttl#model_inf was aborted because of Read-only object file

解决:

版本问题,这是由于fuseki版本升级所导致的问题,ja:baseModel <#tdbGraph> ;改为 ja:MemoryModel <#tdbGraph> ;即可顺利运行。

4.

jena好像只能在本地访问,其他地址访问不到?

解决:

需要将apache-jena-fuseki-3.9.0中run文件下的shiro.ini里面的/$/** = localhostFilter注释掉(#/$/** = localhostFilter)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章