alexandrnikitin / bloom-filter-scala

Bloom filter for Scala, the fastest for JVM
https://alexandrnikitin.github.io/blog/bloom-filter-for-scala/
MIT License
376 stars 57 forks source link

NoClassDefFoundError Product when instatiating a new BloomFilter #36

Open il-bert opened 6 years ago

il-bert commented 6 years ago

Instantiating a simple bloom filter with the following command

    val expectedElements = 10000
    val falsePositiveRate: Double = 0.1
    val bf = BloomFilter[String](expectedElements, falsePositiveRate)

at the last line ( val bf = ...) I am getting the following error


[error] (run-main-0) java.lang.NoClassDefFoundError: scala/Product$class
[error] java.lang.NoClassDefFoundError: scala/Product$class
[error]     at bloomfilter.CanGenerateHashFrom$CanGenerateHashFromString$.<init>(CanGenerateHashFrom.scala:20)
[error]     at bloomfilter.CanGenerateHashFrom$CanGenerateHashFromString$.<clinit>(CanGenerateHashFrom.scala)
alexandrnikitin commented 6 years ago

Thanks for reporting that. Can you specify Java and Scala versions you use please.

il-bert commented 6 years ago

Hi, Scala 2.12.6 on jvm 1.8

LuckyCamel commented 5 years ago

I got the same error with Scala 2.10.6 and Java 1.8. And fixed via turning the maven dependency scope from 'provided' to 'compile'. Hope this may help.

alexandrnikitin commented 5 years ago

@il-bert Yes, it could be dependency config related thing. I can't reproduce the issue 😢 . I'll be happy to fix it if you can provide a repro project for it.

Maybrittnelson commented 5 years ago

I get the same issue. My previouse versions of Scala-library and bloom-filter were inconsistent.But when I set them to be consistent, everything is getting better. Here is my pom.xml

      <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>2.10.3</version>
        </dependency>

        <dependency>
            <groupId>com.github.alexandrnikitin</groupId>
            <artifactId>bloom-filter_2.10</artifactId>
            <version>0.11.0</version>
        </dependency>