You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Mohammad Noorani Bakerally <no...@gmail.com> on 2017/11/07 11:54:59 UTC

java.lang.ExceptionInInitializerError when running jar

My java application perfectly fine. But when running it, i am getting the
following error:

Exception in thread "main" java.lang.ExceptionInInitializerError
    at fr.emse.opensensingcity.configuration.ConfigurationFactory.createConfiguration(ConfigurationFactory.java:25)
    at fr.emse.opensensingcity.main.main(main.java:75)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:248)
    at org.apache.jena.tdb.sys.InitTDB.start(InitTDB.java:29)
    at org.apache.jena.system.JenaSystem.lambda$init$43(JenaSystem.java:119)
    at java.util.ArrayList.forEach(ArrayList.java:1249)
    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.riot.RDFDataMgr.<clinit>(RDFDataMgr.java:79)
    ... 2 more


I am having the same problem as documented in this question [1] but the
solution does not solve my problem. The solution says to add some details
with the Shade plugin, below is an extract of my pom file about the Shade
plugin. The entire pom file can be found here:
https://github.com/noorbakerally/LDPizer/blob/master/pom.xml

‌1.
https://stackoverflow.com/questions/36755846/jena-tdb-java-lang-exceptionininitializererror/36769519?noredirect=1#comment80526243_36769519

This seems to be a configuration problem and I don't know much how to solve
this, the referenced question is the only documentation i've found
regarding this problem,
any idea of how I can solve this ?

Thanks
Noor

Re: java.lang.ExceptionInInitializerError when running jar

Posted by Andy Seaborne <an...@apache.org>.
https://stackoverflow.com/questions/47144779/jena-java-lang-exceptionininitializererror

The combined jar is not being constructed correctly.

You have both an assembly plugin and a shade plugin way of doing the 
same thing.

I've only ever got the shade way to work for "service" files.

Look at the file:

META-INF/services/org.apache.jena.system.JenaSubsystemLifecy‌​cle

in the combined jar.

It should have at least 4 lines.

     Andy


On 07/11/17 11:54, Mohammad Noorani Bakerally wrote:
> My java application perfectly fine. But when running it, i am getting the
> following error:
> 
> Exception in thread "main" java.lang.ExceptionInInitializerError
>      at fr.emse.opensensingcity.configuration.ConfigurationFactory.createConfiguration(ConfigurationFactory.java:25)
>      at fr.emse.opensensingcity.main.main(main.java:75)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:248)
>      at org.apache.jena.tdb.sys.InitTDB.start(InitTDB.java:29)
>      at org.apache.jena.system.JenaSystem.lambda$init$43(JenaSystem.java:119)
>      at java.util.ArrayList.forEach(ArrayList.java:1249)
>      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.riot.RDFDataMgr.<clinit>(RDFDataMgr.java:79)
>      ... 2 more
> 
> 
> I am having the same problem as documented in this question [1] but the
> solution does not solve my problem. The solution says to add some details
> with the Shade plugin, below is an extract of my pom file about the Shade
> plugin. The entire pom file can be found here:
> https://github.com/noorbakerally/LDPizer/blob/master/pom.xml
> 
> ‌1.
> https://stackoverflow.com/questions/36755846/jena-tdb-java-lang-exceptionininitializererror/36769519?noredirect=1#comment80526243_36769519
> 
> This seems to be a configuration problem and I don't know much how to solve
> this, the referenced question is the only documentation i've found
> regarding this problem,
> any idea of how I can solve this ?
> 
> Thanks
> Noor
>