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

Packaging error (mvn shade)? EnvTDB context not initialized #82

Open
cfaeth opened this issue Mar 3, 2022 · 0 comments
Open

Packaging error (mvn shade)? EnvTDB context not initialized #82

cfaeth opened this issue Mar 3, 2022 · 0 comments

Comments

@cfaeth
Copy link
Collaborator

cfaeth commented Mar 3, 2022

I am currently encountering the following issue:

compile.sh works properly
run.sh with any class using Jena may result in the following error:

Exception in thread "Thread-0" java.lang.ExceptionInInitializerError
	at org.acoli.conll.rdf.Format2RDF.conll2model(Format2RDF.java:236)
	at org.acoli.conll.rdf.CoNLL2RDF.conll2model(CoNLL2RDF.java:37)
	at org.acoli.conll.rdf.CoNLLStreamExtractor.processSentenceStream(CoNLLStreamExtractor.java:108)
	at org.acoli.conll.rdf.CoNLLRDFComponent.run(CoNLLRDFComponent.java:41)
	at java.base/java.lang.Thread.run(Thread.java:829)
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:252)
	at org.apache.jena.tdb.sys.InitTDB.start(InitTDB.java:29)
	at org.apache.jena.sys.JenaSystem.lambda$init$2(JenaSystem.java:116)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at org.apache.jena.sys.JenaSystem.forEach(JenaSystem.java:191)
	at org.apache.jena.sys.JenaSystem.forEach(JenaSystem.java:168)
	at org.apache.jena.sys.JenaSystem.init(JenaSystem.java:114)
	at org.apache.jena.rdf.model.ModelFactory.<clinit>(ModelFactory.java:49)
	... 5 more

It seems, the TDB environment is not initialized resulting in a null context. This may be machine specific. When googling, I found the following thread which suggests that this may be caused by repackaging with maven shade: (https://stackoverflow.com/questions/42166073/a-simple-jena-example-not-working)

Curiously, when using fintan-backend, no such issue occurs, even when using the exact same pipeline, so it might be caused by a slightly different build process. So using Fintan directly is a valid workaround for those facing this issue

Please try to reproduce and fix.

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

1 participant