! java.lang.NoSuchMethodError: scala.Predef$.$conforms()Lscala/Predef$$less$colon$less;
Posted
技术标签:
【中文标题】! java.lang.NoSuchMethodError: scala.Predef$.$conforms()Lscala/Predef$$less$colon$less;【英文标题】:! java.lang.NoSuchMethodError: scala.Predef$.$conforms()Lscala/Predef$$less$colon$less; 【发布时间】:2016-05-18 17:21:43 【问题描述】:我在使用 neo4j-2.3.3 版本时遇到了上述错误。这是pom文件
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<dropwizard.version>0.8.1</dropwizard.version>
<akka.version>2.3.11</akka.version>
<aether.version>1.0.2.v20150114</aether.version>
<neo4j.version>2.3.3</neo4j.version>
<maven.version>3.3.1</maven.version>
<cd_phase>deploy</cd_phase>
<neo4j.ogm.version>2.0.1</neo4j.ogm.version>
</properties>
<repositories>
<repository>
<id>mvn-neo4j</id>
<url>http://m2.neo4j.org/content/groups/everything</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>$neo4j.version</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
<version>$neo4j.version</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-io</artifactId>
<version>$neo4j.version</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ogm-api</artifactId>
<version>$neo4j.ogm.version</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ogm-core</artifactId>
<version>$neo4j.ogm.version</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-core</artifactId>
<version>$dropwizard.version</version>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-graphite</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-testing</artifactId>
<version>$dropwizard.version</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>$neo4j.version</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
<version>$neo4j.version</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-io</artifactId>
<version>$neo4j.version</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.tinkerpop.blueprints</groupId>
<artifactId>blueprints-neo4j2-graph</artifactId>
<version>2.6.0</version>
<exclusions>
<exclusion>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
</exclusion>
<exclusion>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-io</artifactId>
</exclusion>
<exclusion>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ha</artifactId>
</exclusion>
<exclusion>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-management</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_2.10</artifactId>
<version>$akka.version</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-slf4j_2.10</artifactId>
<version>$akka.version</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<version>2.11.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-testkit_2.10</artifactId>
<version>$akka.version</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>2.17</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
它找不到类的任何原因?我检查了有效的依赖关系,发现如下
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<version>2.11.7</version>
<scope>test</scope>
</dependency>
正如这篇文章中提到的https://groups.google.com/forum/#!topic/neo4j/l3HPGme7ND0
【问题讨论】:
你是否像谷歌群组问题所说的那样添加了 scala 2.11.7 作为依赖项? 是的,我将其添加为显式依赖项 【参考方案1】:问题似乎是 scala 版本控制问题:可能其中一个类与 2.11.7 不兼容。我查看了akka
库,看起来还可以。
Akka 2.3.11 is released for Scala 2.10.4 and 2.11.5
但这是一个主要/可能的罪魁祸首:
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_2.10</artifactId>
<version>$akka.version</version>
</dependency>
2.10 显然不会与 2.11.X 一起飞行。
【讨论】:
@user_mda OK 更新了我的答案:看看你有一个不兼容的 akka 版本依赖。 @user_mda 您是否尝试过我上面的评论 - 删除或更新 akka-actor_2.10 依赖项? 我将 akka 版本降级到 2.3.9,但还是一样 @user_mda akka 版本已经太旧了 - 你想要一个与 scala 2.11 兼容的新版本 @user_mda 。你有没有想过删除旧版本的 akka 2.10 ??以上是关于! java.lang.NoSuchMethodError: scala.Predef$.$conforms()Lscala/Predef$$less$colon$less;的主要内容,如果未能解决你的问题,请参考以下文章