stain / jena-docker

Docker image for Apache Jena riot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

failed with message "SyntaxError: Unexpected token < in JSON at position 0"

mhabsaoui opened this issue · comments

Hi,

I had experienced an error message when tried to upload an rdf file, any clue ?

image

Some logs on fisuki container (I renamed /fuseki volume to /database) :

image

BTW, if I add a 'COPY inist.ttl $FUSEKI_BASE/configuration/inist.ttl' command to the Dockerfile in order to configure a Dataset on startup of Fuseki, it seems this file 'inist.ttl' is somehow not copied (or just deleted/overwritten). I had to add a 'cp "/inist.ttl" "$FUSEKI_BASE/configuration"' command to the 'docker-entrypoint.sh' file to make the Dataset appear on the jena-fuseki admin. interface !!
What am I missing ?

And here some other logs for docker command :

docker run --rm --name jena-fuseki -p 3030:3030 -e ADMIN_PASSWORD=123pw123 -e JVM_ARGS=-Xmx2g -v $(pwd)/fuseki-data:/fuseki jena-fuseki

`###################################
Initializing Apache Jena Fuseki

###################################
[2017-10-10 13:53:40] Server INFO Apache Jena Fuseki 3.4.0
[2017-10-10 13:53:40] Config INFO FUSEKI_HOME=/jena-fuseki
[2017-10-10 13:53:40] Config INFO FUSEKI_BASE=/fuseki
[2017-10-10 13:53:40] Config INFO Shiro file: file:///fuseki/shiro.ini
[2017-10-10 13:53:40] Config INFO Load configuration: file:///fuseki/configuration/inist.ttl
[2017-10-10 13:53:40] AssemblerHelp WARN ja:loadClass: Migration to Jena3: Converting com.hp.hpl.jena.tdb.TDB to org.apache.jena.tdb.TDB
[2017-10-10 13:53:40] info ERROR Does not exist: /database/databases/db1/
[2017-10-10 13:53:40] Server ERROR Exception in initialization: caught: Does not exist: /database/databases/db1/
[2017-10-10 13:53:40] WebAppContext WARN Failed startup of context o.e.j.w.WebAppContext@c1a4620{/,file:///jena-fuseki/webapp/,UNAVAILABLE}
org.apache.jena.assembler.exceptions.AssemblerException: caught: Does not exist: /database/databases/db1/
doing:
root: file:///fuseki/configuration/inist.ttl#dataset with type: http://jena.hpl.hp.com/2008/tdb#DatasetTDB assembler class: class org.apache.jena.tdb.assembler.DatasetAssemblerTDB
root: file:///fuseki/configuration/inist.ttl#text_dataset with type: http://jena.apache.org/text#TextDataset assembler class: class org.apache.jena.query.text.assembler.TextDatasetAssembler

at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:165)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:144)
at org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:93)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
at org.apache.jena.query.text.assembler.TextDatasetAssembler.open(TextDatasetAssembler.java:61)
at org.apache.jena.query.text.assembler.TextDatasetAssembler.open(TextDatasetAssembler.java:42)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:157)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:144)
at org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:93)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
at org.apache.jena.fuseki.build.FusekiBuilder.getDataset(FusekiBuilder.java:111)
at org.apache.jena.fuseki.build.FusekiBuilder.buildDataService(FusekiBuilder.java:70)
at org.apache.jena.fuseki.build.FusekiBuilder.buildDataAccessPoint(FusekiBuilder.java:61)
at org.apache.jena.fuseki.build.FusekiConfig.readConfiguration(FusekiConfig.java:214)
at org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:184)
at org.apache.jena.fuseki.server.FusekiSystem.initializeDataAccessPoints(FusekiSystem.java:207)
at org.apache.jena.fuseki.server.FusekiServerListener.serverInitialization(FusekiServerListener.java:88)
at org.apache.jena.fuseki.server.FusekiServerListener.contextInitialized(FusekiServerListener.java:52)
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:890)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:532)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:853)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:344)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1501)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1463)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:785)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:272)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
at org.eclipse.jetty.server.Server.start(Server.java:452)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.Server.doStart(Server.java:419)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.apache.jena.fuseki.jetty.JettyFuseki.start(JettyFuseki.java:139)
at org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:367)
at org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:351)
at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
at org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:103)
at org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)

Caused by: org.apache.jena.tdb.TDBException: Does not exist: /database/databases/db1/
at org.apache.jena.tdb.setup.DatasetBuilderStd.error(DatasetBuilderStd.java:319)
at org.apache.jena.tdb.setup.DatasetBuilderStd.checkLocation(DatasetBuilderStd.java:147)
at org.apache.jena.tdb.setup.DatasetBuilderStd.build(DatasetBuilderStd.java:161)
at org.apache.jena.tdb.setup.DatasetBuilderStd.create(DatasetBuilderStd.java:90)
at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:213)
at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:220)
at org.apache.jena.tdb.transaction.DatasetGraphTransaction.(DatasetGraphTransaction.java:70)
at org.apache.jena.tdb.sys.TDBMaker._create(TDBMaker.java:55)
at org.apache.jena.tdb.sys.TDBMaker.createDatasetGraphTransaction(TDBMaker.java:42)
at org.apache.jena.tdb.TDBFactory._createDatasetGraph(TDBFactory.java:89)
at org.apache.jena.tdb.TDBFactory.createDatasetGraph(TDBFactory.java:71)
at org.apache.jena.tdb.assembler.DatasetAssemblerTDB.make(DatasetAssemblerTDB.java:57)
at org.apache.jena.tdb.assembler.DatasetAssemblerTDB.createDataset(DatasetAssemblerTDB.java:48)
at org.apache.jena.sparql.core.assembler.DatasetAssembler.open(DatasetAssembler.java:43)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:157)
... 48 more
[2017-10-10 13:53:40] Server INFO Started 2017/10/10 13:53:40 GMT on port 3030`

Thanks.

When testing directly (without rebuilding image) with your image stain/jena-fuseki => gives this on Dataset creation : 'Not Found' !

image

On dataset creation, we get this in browser console about http request ! :

image

image

Thanks for help

Thanks for your report!

What is the content of your inist.ttl? It seems to make references to /database/ - how do you overridde the FUSEKI_BASE in your Dockerfile? This is also used by the entrypoint to set the password.

Do you have the content of your .rdf file publicly available? Are you sure it's RDF/XML format?

I am running with just docker run -p 3030:3030 stain/jena-fuseki and am able to make db1 as In Memory and db2 as Persistent. I tested uploading a .rdf file which parsed well (even if it has broken namespaces! :-)

Note when you are testing different images locally you should do a Ctrl-Shift-R reload to make sure the Fuseki web UI is not confused.

Hi and thanks for your feedback !

  1. jena-fuseki without building it:

I am running with just docker run -p 3030:3030 stain/jena-fuseki and am able to make db1 as In Memory and db2 as Persistent.

The same here. Actually, it works well on my peronnal PC (non Professionnal). But it seems to work weird on my Professionnal PC (Ubuntu 16.04 LTS). Maybe something to do with POST requests (from UI to Jena API) bloqued somehow... ?

  1. jena-fuseki with building it (I tried to adapt our old version jena-fuseki's v230 Dockerfile to yours v340, by adding the .ttl file config / Proxy settings...etc):

how do you overridde the FUSEKI_BASE in your Dockerfile?

Simply like that (/fueki becomes /database):

# Config and data
VOLUME /database
ENV FUSEKI_BASE /database

Do you have the content of your .rdf file publicly available? Are you sure it's RDF/XML format?

An internal rdf file, so not publically, but it already worked for sure on v230. Maybe v340 is more strict on parsing ?

What is the content of your inist.ttl?

TDB dataset and text index published using Fuseki for INIST

#----SSC

@Prefix : <#> .
@Prefix fuseki: http://jena.apache.org/fuseki# .
@Prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# .
@Prefix rdfs: http://www.w3.org/2000/01/rdf-schema# .
@Prefix tdb: http://jena.hpl.hp.com/2008/tdb# .
@Prefix ja: http://jena.hpl.hp.com/2005/11/Assembler# .
@Prefix text: http://jena.apache.org/text# .
@Prefix skos: http://www.w3.org/2004/02/skos/core# .

[] rdf:type fuseki:Server ;
fuseki:services (
<#service_text_tdb>
) .

TDB

[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .

Text

[] ja:loadClass "org.apache.jena.query.text.TextQuery" .
text:TextDataset rdfs:subClassOf ja:RDFDataset .
#text:TextIndexSolr rdfs:subClassOf text:TextIndex .
text:TextIndexLucene rdfs:subClassOf text:TextIndex .

---------------------------------------------------------------

<#service_text_tdb> rdf:type fuseki:Service ;
rdfs:label "TDB/text service" ;
fuseki:name "db1" ; # la base
fuseki:serviceQuery "query" ;
fuseki:serviceQuery "sparql" ;
fuseki:serviceUpdate "update" ;
fuseki:serviceUpload "upload" ;
fuseki:serviceReadGraphStore "get" ;
fuseki:serviceReadWriteGraphStore "data" ;
fuseki:dataset <#text_dataset> ;
.

<#text_dataset> rdf:type text:TextDataset ;
text:dataset <#dataset> ;
##text:index <#indexSolr> ;
text:index <#indexLucene> ;

.

<#dataset> rdf:type tdb:DatasetTDB ;
# emplacement de la base
tdb:location "/database/databases/db1" ;
tdb:unionDefaultGraph true ;
ja:context [ ja:cxtName "arq:queryTimeout" ; ja:cxtValue "60000" ] ;
.

<#indexSolr> a text:TextIndexSolr ;
#text:server http://localhost:8983/solr/COLLECTION ;
text:server embedded:SolrARQ ;
text:entityMap <#entMap> ;
.

<#indexLucene> a text:TextIndexLucene ;
# emplacement des index lucene
text:directory file:/database/lucene ;
##text:directory "mem" ;
text:entityMap <#entMap> ;
text:storeValues true ; ## required for Skosmos 1.4
.

Text index configuration for Skosmos 0.6 and above (requires Fuseki 1.1.1+)

definition des proprites des index

<#entMap> a text:EntityMap ;
text:entityField "uri" ;
text:graphField "graph" ; ## enable graph-specific indexing
text:defaultField "pref" ; ## Must be defined in the text:map
text:uidField "uid" ; ## recommended for Skosmos 1.4+
text:langField "lang" ; ## required for Skosmos 1.4
text:map (
# skos:prefLabel
[ text:field "pref" ;
text:predicate skos:prefLabel ;
## text:analyzer [ a text:LowerCaseKeywordAnalyzer ] ]
text:analyzer [ a text:StandardAnalyzer ] ]
# skos:altLabel
[ text:field "alt" ;
text:predicate skos:altLabel ;
## text:analyzer [ a text:LowerCaseKeywordAnalyzer ] ]
text:analyzer [ a text:StandardAnalyzer ] ]
# skos:hiddenLabel
[ text:field "hidden" ;
text:predicate skos:hiddenLabel ;
## text:analyzer [ a text:LowerCaseKeywordAnalyzer ] ]
text:analyzer [ a text:StandardAnalyzer ] ]
) .

Note when you are testing different images locally you should do a Ctrl-Shift-R reload to make sure the Fuseki web UI is not confused.

Indeed, I removed all containers/images/volumes/binds before.

Thanks.

Well, it's all right now.
Maybe something weird with system/net buggy...

Thanks.

encountered the same problem and solved it with the following method: https://blog.csdn.net/u012052268/article/details/88768129