0

I'm trying to create an instance of HermiT reasoner, but the console continue to show the exception "noSuchMethodError".

In particular this is the error from the java console:

Caused by: java.lang.NoSuchMethodError: org.semanticweb.owlapi.model.OWLOntologyID.getDefaultDocumentIRI()Ljava/util/Optional;
at org.semanticweb.HermiT.structural.OWLClausification.preprocessAndClausify(OWLClausification.java:77)
at org.semanticweb.HermiT.Reasoner.loadOntology(Reasoner.java:214)
at org.semanticweb.HermiT.Reasoner.<init>(Reasoner.java:205)
at org.semanticweb.HermiT.Reasoner.<init>(Reasoner.java:179)
at org.semanticweb.HermiT.ReasonerFactory.createHermiTOWLReasoner(ReasonerFactory.java:51)
at org.semanticweb.HermiT.ReasonerFactory.createReasoner(ReasonerFactory.java:19)
at org.semanticweb.HermiT.ReasonerFactory.createReasoner(ReasonerFactory.java:15)
at org.processmining.plugins.myminer.knowledge.OWLOntologia.retrieve_property_class(OWLOntologia.java:76)
at org.processmining.plugins.myminer.knowledge.OntologyVisualizer.visualize(OntologyVisualizer.java:39)
... 13 more

I already imported all the dependencies needed by HermiT (version 1.4.3.517) and that's the line where the ReasonerFactory is created:

OWLReasonerFactory reasonerFactory = new ReasonerFactory();

The wrong line is:

OWLReasoner hermit = reasonerFactory.createReasoner(ontology);

as the console said.

I don't understand why the instance can't be created and why the Exception is thrown.

DiegLuthor
  • 195
  • 1
  • 14
  • Something like this mostly happens when you use libraries which aren't compatible to each other, like a newer HermiT library and something something that only support older versions of it. – Tom Feb 27 '19 at 14:15

1 Answers1

1

I resolved updating to the latest release of owl-api and hermit, releases were found using maven central repository.

DiegLuthor
  • 195
  • 1
  • 14
  • 1
    The error is likely due to an old owlapi version also present in the runtime classpath. Updating to the latest and ensuring there's only one version in the class path is the correct fix. – Ignazio Feb 28 '19 at 13:38