phillord / tawny-owl

Build OWL Ontologies in a Programmatic Environment
GNU Lesser General Public License v3.0
251 stars 54 forks source link

Getting started: Lein run yields NoClassDefFoundError for Multibinder compiling owl.clj #70

Closed tim-jones-001 closed 4 years ago

tim-jones-001 commented 4 years ago

Hi Phil

Discovered this project and was really interested to try it out as I am just about to embark on an ontology authoring project and feel similarly to you about all the clicking required in protégé!

Reading the docs, already having lein and java 8 installed (Leiningen 2.9.1 on Java 1.8.0_202 OpenJDK 64-Bit Server VM on a Mac), I ran lein new ontology helloworld, cd'd into helloworld and ran lein run, which yielded the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/inject/multibindings/Multibinder, compiling:(owl.clj:801:5) at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3628) at clojure.lang.Compiler$DefExpr.eval(Compiler.java:439) at clojure.lang.Compiler.eval(Compiler.java:6787) at clojure.lang.Compiler.eval(Compiler.java:6771) at clojure.lang.Compiler.load(Compiler.java:7227) at clojure.lang.RT.loadResourceScript(RT.java:371) at clojure.lang.RT.loadResourceScript(RT.java:362) at clojure.lang.RT.load(RT.java:446) at clojure.lang.RT.load(RT.java:412) at clojure.core$load$fn__5448.invoke(core.clj:5866) at clojure.core$load.doInvoke(core.clj:5865) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invoke(core.clj:5671) at clojure.core$load_lib$fn__5397.invoke(core.clj:5711) at clojure.core$load_lib.doInvoke(core.clj:5710) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invoke(core.clj:632) at clojure.core$load_libs.doInvoke(core.clj:5749) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:634) at clojure.core$use.doInvoke(core.clj:5843) at clojure.lang.RestFn.invoke(RestFn.java:408) at helloworld.core$eval20$loading__5340__auto____21.invoke(core.clj:1) at helloworld.core$eval20.invoke(core.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6782) at clojure.lang.Compiler.eval(Compiler.java:6771) at clojure.lang.Compiler.load(Compiler.java:7227) at clojure.lang.RT.loadResourceScript(RT.java:371) at clojure.lang.RT.loadResourceScript(RT.java:362) at clojure.lang.RT.load(RT.java:446) at clojure.lang.RT.load(RT.java:412) at clojure.core$load$fn__5448.invoke(core.clj:5866) at clojure.core$load.doInvoke(core.clj:5865) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invoke(core.clj:5671) at clojure.core$load_lib$fn__5397.invoke(core.clj:5711) at clojure.core$load_lib.doInvoke(core.clj:5710) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invoke(core.clj:632) at clojure.core$load_libs.doInvoke(core.clj:5749) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:632) at clojure.core$require.doInvoke(core.clj:5832) at clojure.lang.RestFn.invoke(RestFn.java:408) at user$eval5$fn__7.invoke(form-init6396842091343502835.clj:1) at user$eval5.invoke(form-init6396842091343502835.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6782) at clojure.lang.Compiler.eval(Compiler.java:6772) at clojure.lang.Compiler.load(Compiler.java:7227) at clojure.lang.Compiler.loadFile(Compiler.java:7165) at clojure.main$load_script.invoke(main.clj:275) at clojure.main$init_opt.invoke(main.clj:280) at clojure.main$initialize.invoke(main.clj:308) at clojure.main$null_opt.invoke(main.clj:343) at clojure.main$main.doInvoke(main.clj:421) at clojure.lang.RestFn.invoke(RestFn.java:421) at clojure.lang.Var.invoke(Var.java:383) at clojure.lang.AFn.applyToHelper(AFn.java:156) at clojure.lang.Var.applyTo(Var.java:700) at clojure.main.main(main.java:37) Caused by: java.lang.NoClassDefFoundError: com/google/inject/multibindings/Multibinder at uk.ac.manchester.cs.owl.owlapi.OWLAPIImplModule.multibind(OWLAPIImplModule.java:89) at uk.ac.manchester.cs.owl.owlapi.OWLAPIImplModule.configure(OWLAPIImplModule.java:81) at com.google.inject.AbstractModule.configure(AbstractModule.java:62) at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340) at com.google.inject.spi.Elements.getElements(Elements.java:110) at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:138) at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104) at com.google.inject.Guice.createInjector(Guice.java:96) at com.google.inject.Guice.createInjector(Guice.java:73) at com.google.inject.Guice.createInjector(Guice.java:62) at org.semanticweb.owlapi.apibinding.OWLManager.createInjector(OWLManager.java:91) at org.semanticweb.owlapi.apibinding.OWLManager.getOWLDataFactory(OWLManager.java:78) at tawny.owl$owl_data_factory.invoke(owl.clj:120) at tawny.owl$fn__491$iter__487__492$fn__493.invoke(owl.clj:804) at clojure.lang.LazySeq.sval(LazySeq.java:40) at clojure.lang.LazySeq.seq(LazySeq.java:49) at clojure.lang.RT.seq(RT.java:507) at clojure.core$seq__4128.invoke(core.clj:137) at clojure.core.protocols$seq_reduce.invoke(protocols.clj:30) at clojure.core.protocols$fn__6506.invoke(protocols.clj:101) at clojure.core.protocols$fn__6452$G__6447__6465.invoke(protocols.clj:13) at clojure.core$reduce.invoke(core.clj:6519) at clojure.core$into.invoke(core.clj:6600) at clojure.lang.AFn.applyToHelper(AFn.java:156) at clojure.lang.AFn.applyTo(AFn.java:144) at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3623) ... 59 more Caused by: java.lang.ClassNotFoundException: com.google.inject.multibindings.Multibinder at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 85 more

The project.clj was generated with a dependency on uk.org.russet/tawny-owl "2.0.0-SNAPSHOT, so I tried releases 2.0.0 and 1.6.0 instead, but get the same error with all of them.

(I see that master of tawny-owl has a dependency on owlapi-distribution "4.5.8" and that the owlapi team have removed the Guice dependency in later versions, which seems to be involved from the listing above.)

Could you suggest what would I could do to get up and running?

Thanks for your help,

Tim

tim-jones-001 commented 4 years ago

Removed my local maven repo and problem went away ?why

phillord commented 4 years ago

Thanks for the report. The local maven repository is very problematic and daft in my own experience, since it is easy to get dependencies in there that are not reflective of those which are publically available. Periodically, deleting the repository is the only way to know if you have a clean build. It shouldn't be this way!

Let me know how you get on otherwise.

tim-jones-001 commented 4 years ago

Thanks Phil - will do :-)

On Wed, 23 Oct 2019 at 12:34, Phil Lord notifications@github.com wrote:

Thanks for the report. The local maven repository is very problematic and daft in my own experience, since it is easy to get dependencies in there that are not reflective of those which are publically available. Periodically, deleting the repository is the only way to know if you have a clean build. It shouldn't be this way!

Let me know how you get on otherwise.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/phillord/tawny-owl/issues/70?email_source=notifications&email_token=ADGJA6MWRCYTF7XC4ADODADQQAZFNA5CNFSM4JABO6FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECBCQQY#issuecomment-545400899, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGJA6LYE6YY3VWGTDYHLOTQQAZFNANCNFSM4JABO6FA .