I was following this answer to create an executable JAR using Maven. However, I came up with the following error:
> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.lang.ExceptionInInitializerError
at me.vijaychavda.rdfr.Reifier.do_reify(Reifier.java:82)
at me.vijaychavda.rdfr.Reifier.reify(Reifier.java:63)
at me.vijaychavda.rdfr.Reifier.reify(Reifier.java:73)
at me.vijaychavda.rdfr.Main.main(Main.java:30)
Caused by: java.lang.NullPointerException
at org.apache.jena.tdb.sys.EnvTDB.processGlobalSystemProperties(EnvTDB.java:33)
at org.apache.jena.tdb.TDB.init(TDB.java:249)
at org.apache.jena.tdb.sys.InitTDB.start(InitTDB.java:29)
at org.apache.jena.system.JenaSystem.lambda$init$2(JenaSystem.java:119)
at java.util.ArrayList.forEach(ArrayList.java:1255)
at org.apache.jena.system.JenaSystem.forEach(JenaSystem.java:194)
at org.apache.jena.system.JenaSystem.forEach(JenaSystem.java:171)
at org.apache.jena.system.JenaSystem.init(JenaSystem.java:117)
at org.apache.jena.rdf.model.ModelFactory.<clinit>(ModelFactory.java:49)
... 4 more
This answer helped me to get rid of SLF4J
error, but after adding the dependency, I still get this error:
> Exception in thread "main" java.lang.ExceptionInInitializerError
at me.vijaychavda.rdfr.Reifier.do_reify(Reifier.java:82)
at me.vijaychavda.rdfr.Reifier.reify(Reifier.java:63)
at me.vijaychavda.rdfr.Reifier.reify(Reifier.java:73)
at me.vijaychavda.rdfr.Main.main(Main.java:30)
Caused by: java.lang.NullPointerException
at org.apache.jena.tdb.sys.EnvTDB.processGlobalSystemProperties(EnvTDB.java:33)
at org.apache.jena.tdb.TDB.init(TDB.java:249)
at org.apache.jena.tdb.sys.InitTDB.start(InitTDB.java:29)
at org.apache.jena.system.JenaSystem.lambda$init$2(JenaSystem.java:119)
at java.util.ArrayList.forEach(ArrayList.java:1255)
at org.apache.jena.system.JenaSystem.forEach(JenaSystem.java:194)
at org.apache.jena.system.JenaSystem.forEach(JenaSystem.java:171)
at org.apache.jena.system.JenaSystem.init(JenaSystem.java:117)
at org.apache.jena.rdf.model.ModelFactory.<clinit>(ModelFactory.java:49)
... 4 more
My project is using Apache's Jena library.
Actually I'm new to Maven, and I just want to create executable JAR for my Java project :)
EDIT 1:
I also tried this and this method of using the Shade plugin, but same error!
EDIT 2: The code runs fine without any errors. These errors come when I try to create the JAR.