简体   繁体   English

使用OWL API 4.0.x的NoSuchMethodError

[英]NoSuchMethodError using OWL API 4.0.x

I downloaded OWL API (4.0.1 and 4.0.2). 我下载了OWL API(4.0.1和4.0.2)。 But it needed plenty of dependencies that are nowhere mentioned. 但是它需要大量未提及的依赖项。 I downloaded dependency JARs from maven pom.xml file (found it somewhere for version OWL API 4.0.1). 我从maven pom.xml文件中下载了依赖JAR(在OWL API 4.0.1版本中找到了它)。 List of jars: 罐子清单:

JARS

First of all, it was error with RDFFormat (need to add sesame lib, which was not in pom.xml. But I still have " NoSuchMethodError " errors. First one was 首先,这是RDFFormat的错误(需要添加芝麻库,但不在pom.xml中。但是我仍然有“ NoSuchMethodError ”错误。第一个是

com.google.common.base.Objects.firstNonNull

(with Guava 17.0).I updated it to 18.0, now its (使用番石榴17.0)。我将其更新为18.0,现在是

com.google.common.base.Platform.systemNanoTime

Here on stackoverflow is answer for this: 在stackoverflow上可以找到答案:

You most likely have both a recent version of Guava and either google-collect or a version of Guava prior to 3.0 on your classpath 您很可能在类路径上同时拥有Guava的最新版本和google-collect或Guava 3.0之前的版本

But no, I dont have old Guava lib named google-collect(ions). 但是,不,我没有名为Google-collect(ions)的旧Guava库。

Maven dependencies are transitive. Maven依赖项是可传递的。 If you don't want to use Maven for some reason you'll need to include all of them. 如果由于某种原因不想使用Maven,则需要包括所有它们。 Here's the dependency tree for owlapi 4.0.2. 这是owlapi 4.0.2的依赖关系树。

[INFO] \- net.sourceforge.owlapi:owlapi-distribution:jar:4.0.2:compile
[INFO]    +- org.openrdf.sesame:sesame-model:jar:2.7.12:compile
[INFO]    |  \- org.openrdf.sesame:sesame-util:jar:2.7.12:compile
[INFO]    +- org.openrdf.sesame:sesame-rio-api:jar:2.7.12:compile
[INFO]    +- org.openrdf.sesame:sesame-rio-languages:jar:2.7.12:compile
[INFO]    +- org.openrdf.sesame:sesame-rio-datatypes:jar:2.7.12:compile
[INFO]    +- org.openrdf.sesame:sesame-rio-binary:jar:2.7.12:compile
[INFO]    +- org.openrdf.sesame:sesame-rio-n3:jar:2.7.12:compile
[INFO]    +- org.openrdf.sesame:sesame-rio-nquads:jar:2.7.12:compile
[INFO]    |  \- commons-io:commons-io:jar:2.4:compile
[INFO]    +- org.openrdf.sesame:sesame-rio-ntriples:jar:2.7.12:compile
[INFO]    +- org.openrdf.sesame:sesame-rio-rdfjson:jar:2.7.12:compile
[INFO]    |  \- com.fasterxml.jackson.core:jackson-core:jar:2.2.1:compile
[INFO]    +- org.openrdf.sesame:sesame-rio-rdfxml:jar:2.7.12:compile
[INFO]    +- org.openrdf.sesame:sesame-rio-trix:jar:2.7.12:compile
[INFO]    +- org.openrdf.sesame:sesame-rio-turtle:jar:2.7.12:compile
[INFO]    +- org.openrdf.sesame:sesame-rio-trig:jar:2.7.12:compile
[INFO]    +- com.github.jsonld-java:jsonld-java-sesame:jar:0.5.0:compile
[INFO]    |  \- com.github.jsonld-java:jsonld-java:jar:0.5.0:compile
[INFO]    |     +- com.fasterxml.jackson.core:jackson-databind:jar:2.3.3:compile
[INFO]    |     |  \- com.fasterxml.jackson.core:jackson-annotations:jar:2.3.0:compile
[INFO]    |     +- org.apache.httpcomponents:httpclient-cache:jar:4.2.5:compile
[INFO]    |     +- org.apache.httpcomponents:httpclient:jar:4.2.5:compile
[INFO]    |     |  +- org.apache.httpcomponents:httpcore:jar:4.2.4:compile
[INFO]    |     |  \- commons-codec:commons-codec:jar:1.6:compile
[INFO]    |     \- org.slf4j:jcl-over-slf4j:jar:1.7.7:runtime
[INFO]    +- org.semarglproject:semargl-sesame:jar:0.6.1:compile
[INFO]    |  +- org.semarglproject:semargl-core:jar:0.6.1:compile
[INFO]    |  \- org.semarglproject:semargl-rdfa:jar:0.6.1:compile
[INFO]    |     \- org.semarglproject:semargl-rdf:jar:0.6.1:compile
[INFO]    +- com.google.guava:guava:jar:18.0:compile
[INFO]    +- com.google.inject:guice:jar:4.0-beta:compile
[INFO]    |  +- javax.inject:javax.inject:jar:1:compile
[INFO]    |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO]    +- com.google.inject.extensions:guice-multibindings:jar:4.0-beta:compile
[INFO]    +- com.google.code.findbugs:jsr305:jar:2.0.1:compile
[INFO]    +- org.slf4j:slf4j-api:jar:1.7.7:compile
[INFO]    +- org.apache.directory.studio:org.apache.commons.io:jar:2.4:compile
[INFO]    \- net.sf.trove4j:trove4j:jar:3.0.3:compile

For the most part, your life will be much easier using Maven (or some other modern build tool). 在大多数情况下,使用Maven(或其他一些现代的构建工具)会使您的生活变得更加轻松。 It deals with dependency issues like this so you don't have to. 它处理像这样的依赖性问题,因此您不必这样做。 If you're stuck with ant for some reason you could also take a look at ivy . 如果由于某种原因而被蚂蚁困扰,您还可以看看常春藤

Thank you for you responses. 感谢您的回复。 I use 我用

-verbose:class

and found out, that package for that class is from 并发现,该类的软件包来自

gephi-toolkit.jar

Tt has google-collection too ... so yeah, different versions. Tt也有Google收藏集...是的,不同的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM