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

JAR can only be executing from the project folder #9

Open
dgarijo opened this issue Oct 18, 2020 · 1 comment
Open

JAR can only be executing from the project folder #9

dgarijo opened this issue Oct 18, 2020 · 1 comment

Comments

@dgarijo
Copy link

dgarijo commented Oct 18, 2020

When I tried to run the JAR as java -jar owl2bench/OWL2Bench.jar 10 EL 20, I got an exception:

21:17:12.418 [main] ERROR o.s.owlapi.io.FileDocumentSource - File cannot be found
java.io.FileNotFoundException: UNIV-BENCH-OWL2EL.owl (No such file or directory)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.semanticweb.owlapi.io.FileDocumentSource.getInputStream(FileDocumentSource.java:86)
	at org.semanticweb.owlapi.io.DocumentSources.wrapInput(DocumentSources.java:115)
	at org.semanticweb.owlapi.io.DocumentSources.wrapInputAsReader(DocumentSources.java:75)
	at org.semanticweb.owlapi.io.DocumentSources.wrapInputAsReader(DocumentSources.java:96)
	at org.semanticweb.owlapi.io.AbstractOWLParser.getInputSource(AbstractOWLParser.java:38)
	at org.semanticweb.owlapi.rdf.rdfxml.parser.RDFXMLParser.parse(RDFXMLParser.java:61)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyFactoryImpl.loadOWLOntology(OWLOntologyFactoryImpl.java:173)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.load(OWLOntologyManagerImpl.java:954)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:918)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:867)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:879)
	at ABoxGen.InstanceGenerator.Generator.loadOWLOntology(Generator.java:544)
	at ABoxGen.InstanceGenerator.Generator.start(Generator.java:179)
	at ABoxGen.InstanceGenerator.Generator.main(Generator.java:150)

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$2 (file:/content/owl2bench/OWL2Bench.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
org.semanticweb.owlapi.io.OWLOntologyCreationIOException: OWLOntologyCreationIOException: java.io.FileNotFoundException: /content/UNIV-BENCH-OWL2EL.owl (No such file or directory)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyFactoryImpl.loadOWLOntology(OWLOntologyFactoryImpl.java:190)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.load(OWLOntologyManagerImpl.java:954)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:918)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:867)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:879)
	at ABoxGen.InstanceGenerator.Generator.loadOWLOntology(Generator.java:544)
	at ABoxGen.InstanceGenerator.Generator.start(Generator.java:179)
	at ABoxGen.InstanceGenerator.Generator.main(Generator.java:150)
Caused by: org.semanticweb.owlapi.io.OWLOntologyInputSourceException: java.io.FileNotFoundException: /content/UNIV-BENCH-OWL2EL.owl (No such file or directory)
	at org.semanticweb.owlapi.io.DocumentSources.getInputStream(DocumentSources.java:161)
	at org.semanticweb.owlapi.io.DocumentSources.wrapInput(DocumentSources.java:117)
	at org.semanticweb.owlapi.io.DocumentSources.wrapInputAsReader(DocumentSources.java:75)
	at org.semanticweb.owlapi.io.DocumentSources.wrapInputAsReader(DocumentSources.java:96)
	at org.semanticweb.owlapi.io.AbstractOWLParser.getInputSource(AbstractOWLParser.java:38)
	at org.semanticweb.owlapi.rdf.rdfxml.parser.RDFXMLParser.parse(RDFXMLParser.java:61)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyFactoryImpl.loadOWLOntology(OWLOntologyFactoryImpl.java:173)
	... 7 more
Caused by: java.io.FileNotFoundException: /content/UNIV-BENCH-OWL2EL.owl (No such file or directory)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
	at java.base/sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:86)
	at java.base/sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:184)
	at org.semanticweb.owlapi.io.DocumentSources.getInputStreamFromContentEncoding(DocumentSources.java:261)
	at org.semanticweb.owlapi.io.DocumentSources.connectWithFiveRetries(DocumentSources.java:226)
	at org.semanticweb.owlapi.io.DocumentSources.getInputStream(DocumentSources.java:154)
	... 13 more
Exception in thread "main" java.lang.NullPointerException
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.getOntologyFormat(OWLOntologyManagerImpl.java:675)
	at ABoxGen.InstanceGenerator.Generator.start(Generator.java:180)
	at ABoxGen.InstanceGenerator.Generator.main(Generator.java:150)

This makes the JAR runnable only if the files are at the same level where the JAR was invoked. A possible improvement would be to allow adding a path to the folder where the input files live

@GunjanSingh1
Copy link
Collaborator

Thank you for your suggestion. I will update it.

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

2 participants