Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException when launching Blazegraph server #89

Open
csrull opened this issue May 19, 2018 · 22 comments
Open

NullPointerException when launching Blazegraph server #89

csrull opened this issue May 19, 2018 · 22 comments

Comments

@csrull
Copy link

csrull commented May 19, 2018

Hi,

I just installed Blazegraph 2.1.4 on my Mac (OSX 10.13.4) with JRE 10.0.1. When trying to launch the server with: java -server -Xmx800m -jar blazegraph.jar

I get the following error:

ERROR: Banner.java:160: Uncaught exception in thread
java.lang.NullPointerException
    at com.bigdata.rdf.sail.webapp.StandaloneNanoSparqlServer.main(StandaloneNanoSparqlServer.java:142)

Extending the start server timeout via -Djetty.start.timeout=60 does not resolve the error. Any ideas how to resolve?

Thanks!

@thompsonbry
Copy link
Contributor

thompsonbry commented May 19, 2018 via email

@csrull
Copy link
Author

csrull commented May 20, 2018

First, thanks for the quick response.

But, I'm not a Java developer, so not sure how to modify the StandaloneNanoSparqlServer.java class and compile. Seems like the code should work out of the box when following the Start Blazegraph instructions on a Mac. Is there something else I can do to run it, short of installing Eclipse (etc), adding a line of code to a class, and recompiling?

@thompsonbry
Copy link
Contributor

thompsonbry commented May 20, 2018 via email

@csrull
Copy link
Author

csrull commented May 20, 2018

Thanks. Tried that. I put a copy of jetty.xml in the same directory as blazegraph.jar, then executed:

export JETTY_XML=/absolute/path/to/jetty.xml
java -server -Xmx800m -DjettyXml=$JETTY_XML -jar blazegraph.jar

And got the exact same error.

@csrull
Copy link
Author

csrull commented May 25, 2018

Just following up -- I know this seems like a minor issue given the other bugs you are likely working on. I really want test this out over the weekend. Any other ideas or am I out of luck? Thanks!

@ehrhart
Copy link

ehrhart commented May 28, 2018

Had the same issue with JRE 9.0.4. Fixed it by using JRE 8.0 instead.

export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
java -server -Xmx4g -jar blazegraph.jar

@thompsonbry
Copy link
Contributor

thompsonbry commented May 28, 2018 via email

@colingoldberg
Copy link

I got the same error on my mac - macos Sierra 10.13.5

$ java -server -Xmx4g -jar blazegraph.jar
INFO: com.bigdata.util.config.LogUtil: Configure: jar:file:/usr/local/share/blazegraph/blazegraph.jar!/log4j.properties

BlazeGraph(TM) Graph Engine

               Flexible
               Reliable
              Affordable
  Web-Scale Computing for the Enterprise

Copyright SYSTAP, LLC DBA Blazegraph 2006-2016. All rights reserved.

colins-mbp.home
Fri Jul 06 16:10:49 EDT 2018
Mac OS X/10.13.5 x86_64
Mac OS X 10.13.5 x86_64 #CPU=4
Oracle Corporation 9.0.4
freeMemory=252868424
buildVersion=2.1.4
gitCommit=738d05f08cffd319233a4bfbb0ec2a858e260f9c

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
jsonld https://raw.githubusercontent.com/jsonld-java/jsonld-java/master/LICENCE
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

ERROR: Banner.java:160: Uncaught exception in thread
java.lang.NullPointerException
at com.bigdata.rdf.sail.webapp.StandaloneNanoSparqlServer.main(StandaloneNanoSparqlServer.java:142)

JRE version: 10.0.1

I would expect that it would work out of the box. Anything I should configure beforehand?

Colin Goldberg

@thompsonbry
Copy link
Contributor

thompsonbry commented Jul 6, 2018 via email

@csrull
Copy link
Author

csrull commented Jul 6, 2018

I spent several hours trying to load JRE 8.0. Still never got it to work. Gave up and am using an alternative. Really wanted to use Blazegraph...

@mprinc
Copy link

mprinc commented Oct 23, 2018

Yes, same with me. Same problem. Same solution. Sadly, spent a lot of time before finding this issue thread

@bjonnh
Copy link

bjonnh commented May 2, 2019

This issue is still present in the latest release (2.1.5) with Java 11.

@yongbozhang
Copy link

See same issue here. This is blocking my team upgrading to java 11.

@bjonnh
Copy link

bjonnh commented May 6, 2019

You can run jetty by yourself. In kotlin I do:

fun main() {
    val blazePort = 9999
    val a = NanoSparqlServer()
    val server = Server(blazePort)
    val webapp = WebAppContext()
    val initParams = LinkedHashMap<String, String>()
    initParams[ConfigParams.NAMESPACE] = "xyz"
    initParams[ConfigParams.QUERY_THREAD_POOL_SIZE] = ConfigParams.DEFAULT_QUERY_THREAD_POOL_SIZE.toString()
    initParams[ConfigParams.FORCE_OVERFLOW] = "false"
    initParams[ConfigParams.READ_LOCK] = "0"
    webapp.setAttribute("INIT_PARAMS_OVERRIDES", initParams)
    webapp.contextPath = "/blazegraph"
    webapp.war = a.javaClass.getResource("/war").toExternalForm()
    webapp.isExtractWAR = true
    server.handler = webapp
    server.start()
    server.join()
}

@thompsonbry
Copy link
Contributor

thompsonbry commented May 6, 2019 via email

@Aref-cs
Copy link

Aref-cs commented Jun 27, 2019

-DjettyXml= (address)

May I ask where should the this code be entered to?

Thanks
Aref

@thompsonbry
Copy link
Contributor

thompsonbry commented Jun 27, 2019 via email

@Aref-cs
Copy link

Aref-cs commented Jun 27, 2019

Right before -server in your command. It is an argument to the JVM

On Thu, Jun 27, 2019 at 15:00 Aref-cs @.***> wrote: -DjettyXml= (address) May I ask where should the this code be entered to? Thanks Aref — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#89?email_source=notifications&email_token=AATW7YB2S5YABFZ5GYX2PHLP4S2XJA5CNFSM4FAXAUY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYXBD7Y#issuecomment-506335743>, or mute the thread https://github.com/notifications/unsubscribe-auth/AATW7YHAP7WXMBPKKOSCERTP4S2XJANCNFSM4FAXAUYQ .

Thanks a lot Bryan! :)

The path to jetty.xml is /etc/blazegraph, am I correct?
I used this command: java -DjettyXml=/etc/blazegraph -server -Xmx4g -jar blazegraph.jar
However, it was not successful!

Also, I've seen the code below in one of the links you provided. Where can I find the StandaloneNanoSparqlServer.Java and where in the file should I paste this code?

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

Thanks in Advance,
Aref

@bastiotutuama
Copy link

Setup with/Specific Downgrade to Java 8 JDK and JRE worked for me to get it running (on Ubuntu 18.04).

Installing Java 8 JRE & JDK
sudo apt install openjdk-8-jre-headless
sudo apt install openjdk-8-jdk

If needed: Uninstalling Java Installation:
sudo apt-get remove --purge icedtea-* openjdk-*

@beebs-systap
Copy link
Contributor

beebs-systap commented Feb 1, 2020

Please try the jar version included in the 2.1.6 RC. It works with Java 9+.

https://github.com/blazegraph/database/releases/tag/BLAZEGRAPH_2_1_6_RC

@Dadou1985
Copy link

First, you should uninstall your java sdk version and set up the java sdk version 8:
$ sudo apt install openjdk-8-jdk
Then install Blazegraph and run it:
$ curl -L -o blazegraph.jar https://github.com/blazegraph/database/releases/download/BLAZEGRAPH_RELEASE_CANDIDATE_2_1_5/blazegraph.jar
java -jar blazegraph.jar

It works for me and I'm working on ubuntu.

@Dadou1985
Copy link

I forgot the dollar before "java -jar blazegraph.jar" to run it.
good luck !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests