0

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 but the solution does not solve my problem. The solution says to add some details with the Shade plugin, here is an extract of my pom file about the Shade plugin

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <configuration>
                    <shadedArtifactAttached>false</shadedArtifactAttached>
                    <transformers>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                    </transformers>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <!-- Some jars are signed but shading breaks that.
                                     Don't include signing files.
                                -->
                                <exclude>META-INF/*.SF</exclude>
                                <exclude>META-INF/*.DSA</exclude>
                                <exclude>META-INF/*.RSA</exclude>
                            </excludes>
                        </filter>
                    </filters>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <!--<phase /><!- - Switch off -->
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
Noor
  • 19,638
  • 38
  • 136
  • 254
  • 1
    You can always debug application yourself manually to investigate and find a cause of this exception. – cybersoft Nov 06 '17 at 20:40
  • 1
    How is your application built? Does it have to be a single combined jar? If not, just depend on artifacts apache-jena-libs (type=pom) and you will get a correct jena setup. If you must replack, check the `META-INF/services/org.apache.jena.system.JenaSubsystemLifecycle` in the shaded jar. It should have at least 4 lines. (And run the shared jar, not the original one. Easiy to run the wrong one). – AndyS Nov 07 '17 at 12:06
  • My application is built with a single jar with all dependencies together – Noor Nov 07 '17 at 15:37

0 Answers0