! java.lang.NoSuchMethodError:scala.Predef $。$ conforms()Lscala / Predef $$ less $ colon $ less;

时间:2016-05-18 17:21:44

标签: scala maven neo4j noclassdeffounderror

使用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

中所述

1 个答案:

答案 0 :(得分: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一起飞行。