Menu

NanoSparqlServer startup problem / only listing directory contents

Help
Jan
2016-04-01
2016-04-06
  • Jan

    Jan - 2016-04-01

    I want to embed NanoSparqlServer into an existing application.
    I did this according to https://wiki.blazegraph.com/wiki/index.php/NanoSparqlServer#Embedded_.28using_Jetty.29

    I used NSSEmbeddedExample.java located here: https://sourceforge.net/p/bigdata/git/ci/master/tree/bigdata-sails/src/samples/com/bigdata/samples/NSSEmbeddedExample.java

    The output from the application is:

    BlazeGraph(TM) Graph Engine
    
                       Flexible
                       Reliable
                      Affordable
          Web-Scale Computing for the Enterprise
    
    Copyright SYSTAP, LLC DBA Blazegraph 2006-2016.  All rights reserved.
    
    localhost
    Fri Apr 01 15:36:09 CEST 2016
    Linux/3.13.0-83-generic amd64
    Intel(R) Core(TM) i5 CPU         750  @ 2.67GHz Family 6 Model 30 Stepping 5, GenuineIntel #CPU=4
    Oracle Corporation 1.7.0_95
    freeMemory=116669432
    buildVersion=2.0.1
    gitCommit=217ec27fea39d458d275bd8a809eeaa5e9772982
    
    Dependency         License                                                        
    ICU                http://source.icu-project.org/repos/icu/icu/trunk/license.html 
    bigdata-ganglia    http://www.apache.org/licenses/LICENSE-2.0.html                
    blueprints-core    https://github.com/tinkerpop/blueprints/blob/master/LICENSE.txt
    colt               http://acs.lbl.gov/software/colt/license.html                  
    commons-codec      http://www.apache.org/licenses/LICENSE-2.0.html                
    commons-fileupload http://www.apache.org/licenses/LICENSE-2.0.html                
    commons-io         http://www.apache.org/licenses/LICENSE-2.0.html                
    commons-logging    http://www.apache.org/licenses/LICENSE-2.0.html                
    dsiutils           http://www.gnu.org/licenses/lgpl-2.1.html                      
    fastutil           http://www.apache.org/licenses/LICENSE-2.0.html                
    flot               http://www.opensource.org/licenses/mit-license.php             
    high-scale-lib     http://creativecommons.org/licenses/publicdomain               
    httpclient         http://www.apache.org/licenses/LICENSE-2.0.html                
    httpclient-cache   http://www.apache.org/licenses/LICENSE-2.0.html                
    httpcore           http://www.apache.org/licenses/LICENSE-2.0.html                
    httpmime           http://www.apache.org/licenses/LICENSE-2.0.html                
    jackson-core       http://www.apache.org/licenses/LICENSE-2.0.html                
    jetty              http://www.apache.org/licenses/LICENSE-2.0.html                
    jquery             https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt   
    log4j              http://www.apache.org/licenses/LICENSE-2.0.html                
    lucene             http://www.apache.org/licenses/LICENSE-2.0.html                
    nanohttp           http://elonen.iki.fi/code/nanohttpd/#license                   
    rexster-core       https://github.com/tinkerpop/rexster/blob/master/LICENSE.txt   
    river              http://www.apache.org/licenses/LICENSE-2.0.html                
    semargl            https://github.com/levkhomich/semargl/blob/master/LICENSE      
    servlet-api        http://www.apache.org/licenses/LICENSE-2.0.html                
    sesame             http://www.openrdf.org/download.jsp                            
    slf4j              http://www.slf4j.org/license.html                              
    zookeeper          http://www.apache.org/licenses/LICENSE-2.0.html                
    
    WARN : ServiceProviderHook.java:171: Running.
    WARN : NanoSparqlServer.java:514: Starting NSS
    serviceURL: http://localhost:8888
    

    The service seems to be running normally. Although when accessing localhost:8888 the server only lists the directory contents.

    /bigdata/sparql is not found.

    Any ideas?

     

    Last edit: Jan 2016-04-06
  • Brad Bebee

    Brad Bebee - 2016-04-01

    The issue here is that the jetty.xml used needs to specify the path to the war file (or at least the skeleton). How are you including blazegraph? The StandaloneNanoSparqlServer in the executable jar is a pretty good example: https://github.com/blazegraph/database/blob/master/blazegraph-jar/src/main/java/com/bigdata/rdf/sail/webapp/StandaloneNanoSparqlServer.java.

    The jetty.xml (https://github.com/blazegraph/database/blob/master/blazegraph-jar/src/main/resources/jetty.xml) in that case assumes that the WAR is at the root of the classpath.

    It may work if you include the blazegraph.jar (bundled artifact) in your dependencies.

    If you can provide more details on the artifacts you're including, we can make a more specific recommendation.

    I created a ticket to update the documentation: https://jira.blazegraph.com/browse/BLZG-1858

     
  • Brad Bebee

    Brad Bebee - 2016-04-04

    Jan,

    Just wanted to follow-up on this one. Were you able to track it down?

    Thanks, --Brad

     
  • Jan

    Jan - 2016-04-05

    Thank you for your response, Brad.

    I needed to work on something else, which is why I can't tell right now.
    But I will continue to work on this in the forseeable future :)
    I did not knew about the StandaloneNanoSparqlServer.java file and will have a look at it.

    I will tell you when I have something to report on this issue.

     

    Last edit: Jan 2016-04-05
  • Brad Bebee

    Brad Bebee - 2016-04-05

    OK -- sounds good. Just let us know.

     
    • Jan

      Jan - 2016-04-06

      Providing jettyXml as in StandaloneNanoSparqlServer.java did the trick!
      After adding two lines of code it worked:

      String jettyXml = System.getProperty(SystemProperties.JETTY_XML, "jetty.xml");
      System.setProperty("jetty.home", jettyXml.getClass().getResource("/war").toExternalForm());
      

      Thank you very much for your help!

       

Log in to post a comment.