Coder Social home page Coder Social logo

Comments (20)

zhiqiangren avatar zhiqiangren commented on June 15, 2024

up,up,up...

from jredisbloom.

joyang1 avatar joyang1 commented on June 15, 2024

version is 3.0.0;

        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>3.0.0</version>
        </dependency>

from jredisbloom.

joyang1 avatar joyang1 commented on June 15, 2024

If you use JRebloom client, you can remove the jedis client in you project. @zhiqiangren

from jredisbloom.

zhiqiangren avatar zhiqiangren commented on June 15, 2024

yes! I remove the jedis dependency,import the jrebloom denpendency.and in my main method,my code like this:
Client client = new Client("localhost", 6379); then there is a problem:Exception in thread "main" java.lang.NoClassDefFoundError: redis/clients/jedis/util/Pool,i can not find the reason... @joyang1

from jredisbloom.

joyang1 avatar joyang1 commented on June 15, 2024

Can you let me look at your pom.xml?

from jredisbloom.

zhiqiangren avatar zhiqiangren commented on June 15, 2024

here it is
pom.zip

from jredisbloom.

zhiqiangren avatar zhiqiangren commented on June 15, 2024

@joyang1

from jredisbloom.

joyang1 avatar joyang1 commented on June 15, 2024

I think you can use

<dependency>
  <groupId>com.redislabs</groupId>
  <artifactId>jrebloom</artifactId>
  <version>2.0.0-m2</version>
</dependency>

this.

Then mvn clean you project. Then mvn package.
try it.

from jredisbloom.

zhiqiangren avatar zhiqiangren commented on June 15, 2024

it is te same problem.And i find a problem,I import jrebloom,no matter the version is 1.2.0 or 2.0.0-m2, the jedis version always is 2.9.0...so occure this problem :redis/clients/jedis/util/Pool...,the jedis version can not be 3.0.0? @joyang1

from jredisbloom.

joyang1 avatar joyang1 commented on June 15, 2024

You can let

<dependency>
  <groupId>com.redislabs</groupId>
  <artifactId>jrebloom</artifactId>
  <version>2.0.0-m2</version>
</dependency>

on the top of maven dependency in the pom.

from jredisbloom.

zhiqiangren avatar zhiqiangren commented on June 15, 2024

@joyang1 ,I am sorry, I let the dependency on the top of maven dependency in the pom.But I failed.
The same problem.The jedis version.is also 2.9.0....

from jredisbloom.

zhiqiangren avatar zhiqiangren commented on June 15, 2024

@joyang1 Hi,我直接中文描述我的问题吧。我的操作步骤如下:
1、新建了一个springboot project;
2、引入jrebloom依赖,放在dependencies的最前面;
3、在src/main/java包下,新建测试类,写了一个main函数,函数中调用Client,如下
Client client = new Client("localhost", 6379);
client.add("simpleBloom", "Mark");
System.out.println(client.exists("simpleBloom", "Mark"));
client.exists("simpleBloom", "Farnsworth");
第一行就报错......
1、我分析原因是jedis的版本不匹配。jreblom引入的是2.9.0版本的jedis,但是这个版本中并没有redis/clients/jedis/util/Pool,因而报错。
2、但是我的另一个解决思路是,jrebloom依赖引入的jedis是2.9.0版本。。。我排除了jrelboom依赖中对jedis的依赖,单独引入jedis3.0.0版本,结果可以了。。。所以,我得出结论,jrebloom中对jedis依赖的版本有误吧。。。
另,我现在redis的版本是3.x,出现ERR unknown command 'BF.ADD',不过上面的问题已经解决!thx!

from jredisbloom.

joyang1 avatar joyang1 commented on June 15, 2024

image
不可能会出现你说的情况的,从 1.1.0 的版本开始,jedis 就是 3.x 的版本了,所以问题还是出在你那边。我们这边都有 UnitTest,所以应该没问题的。

还有 BF.ADD 命令是针对 redisbloom,不是 redis,你需要自己在 redis 里面加载模块(redisbloom.so)。
redisbloom.so 的编译和加载到 redis 的具体步骤请参考RedisBloom

from jredisbloom.

zhiqiangren avatar zhiqiangren commented on June 15, 2024

@joyang1 OK ,let me try again! Thangk you very much!

from jredisbloom.

c5p0 avatar c5p0 commented on June 15, 2024

如果redis 有密码的,可以自定义jedispool连接,提供的client 可以传递jedispool
Client client = new Client(jedisPool);

from jredisbloom.

joyang1 avatar joyang1 commented on June 15, 2024

@c5p0 , what are you meaning?

from jredisbloom.

lovedworking avatar lovedworking commented on June 15, 2024

上述问题解决了吗?redis带密码的话,我试了试传递redispool不行的啊

from jredisbloom.

zhiqiangren avatar zhiqiangren commented on June 15, 2024

没有解决呢,你也遇到类似的问题了么? @lovedworking

from jredisbloom.

lovedworking avatar lovedworking commented on June 15, 2024

没有解决呢,你也遇到类似的问题了么? @lovedworking

换了jedis 3.0解决问题了 打扰了

from jredisbloom.

lovedworking avatar lovedworking commented on June 15, 2024

没有解决呢,你也遇到类似的问题了么? @lovedworking

我试了下可以的,

redis.clients
jedis
3.0.0


com.redislabs
jrebloom
2.0.0-m2

用这两个依赖可以了 开始我的jedis是2.9.0

from jredisbloom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.