-1

hibernate-ogm-cassandra NoClassDefFoundError: com/google/common/util/concurrent/AsyncFunction

I already look up the answer from other question StackOverflow-40693212, and it said this is guava.jar missing problem.

But I check the maven dependency and there is a guava-18.0.jar.

  • Why I still encounter this problem, and how could I solve it?
timiTao
  • 1,417
  • 3
  • 20
  • 34
Emma
  • 29
  • 3

1 Answers1

1

Finally I found out that although guava jar exists in eclipse maven dependency, but guava jar is not in the java application source. I add the following code to solve this issue, hope it will help someone who encounters the same problem.

    <dependency>
        <groupId>com.datastax.cassandra</groupId>
        <artifactId>cassandra-driver-core</artifactId>
        <version>3.1.0</version>
        <exclusions>
        <exclusion>
          <groupId>com.google.guava</groupId>
          <artifactId>guava</artifactId>
        </exclusion>
        <exclusion>
            <groupId>io.netty</groupId>
            <artifactId>netty-handler</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>17.0</version>
        <scope>runtime</scope>
    </dependency>
Emma
  • 29
  • 3
  • just out of curiosity - why you're using so old driver? Latest version is 3.4.0 & it includes many improvements & bug fixes – Alex Ott Mar 22 '18 at 11:04