Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisConnectionFactory' defined in class path resource [org/springframework/boot/autoconfigure/data/redis/LettuceConnectionConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory]: Factory method 'redisConnectionFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool2/impl/GenericObjectPoolConfig

因为lettuce,依赖commons-pool2,所以引入该包即可。

以下复制自知乎:

Lettuce 和 Jedis 的定位都是Redis的client,所以他们当然可以直接连接redis server。

Jedis在实现上是直接连接的redis server,如果在多线程环境下是非线程安全的,这个时候只有使用连接池,为每个Jedis实例增加物理连接

Lettuce的连接是基于Netty的,连接实例(StatefulRedisConnection)可以在多个线程间并发访问,应为StatefulRedisConnection是线程安全的,所以一个连接实例(StatefulRedisConnection)就可以满足多线程环境下的并发访问,当然这个也是可伸缩的设计,一个连接实例不够的情况也可以按需增加连接实例。

作者:Vito
链接:https://www.zhihu.com/question/53124685/answer/354431529
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisConnectionFactory' defined in class path resource的更多相关文章

  1. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stu' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stu' defined ...

  2. aused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method fai

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'roleDaoImpl' ...

  3. Spring AOP 报错org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'XXXXXX' defined in class path resource..........

    完整报错如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'befo ...

  4. 报错org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [bean.xml]

    报这种错的原因基本上是applicationContext.xml文件中bean配置错误,错误如下: org.springframework.beans.factory.BeanCreationExc ...

  5. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [bean.xml]: Invocation of init method failed; nested exception is

    在复制xml文件进行修改的时候,我经常将不小心对原文件进行修改,而导致创建bean出错.报错如下所示: Exception sending context initialized event to l ...

  6. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource

    二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.SetAllPropertiesRule begin警告: [SetAllPropertiesRu ...

  7. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [spring/applicationContext-service.xml]: Cannot resolve refer

    <!-- aop --> <aop:config> <aop:pointcut expression="execution(* com.zsn.Service. ...

  8. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource

    spring boot web项目运行时提示如下错误 org.springframework.beans.factory.BeanCreationException: Error creating b ...

  9. 【报错】org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSocketHandlerMapping' defined in class path resource

    环境:maven+eclipse+jdk1.8 [tomcat使用的是maven自带的插件,实质原因就是出在tomcat版本问题] 背景:在进行SSM集成WebSocket的时候,项目启动报org.s ...

随机推荐

  1. P1140 相似基因 (dp)

    题目背景 大家都知道,基因可以看作一个碱基对序列.它包含了44种核苷酸,简记作A,C,G,TA,C,G,T.生物学家正致力于寻找人类基因的功能,以利用于诊断疾病和发明药物. 在一个人类基因工作组的任务 ...

  2. MySQL架构备份

    MySQL Replication 概述 集群的主要类型? 高可用集群(High Available Cluster, HA) 高可用集群是指通过特殊的软件把独立的服务器连接起来,组成一个能够提供故障 ...

  3. python之路day08--文件的操作

    文件的操作 hanfei的博客.txt 1/文件的路径2.编码方式3.操作方式:只读,只写,追加,读写,写读... 只读 f=open('hanfei的博客',mode='r',encoding='u ...

  4. linux通过expect工具来实现自动登录服务器,并执行相关操作

    参考地址:https://www.cnblogs.com/liyuanhong/articles/7728034.html EOF的使用参考:https://www.cnblogs.com/liyua ...

  5. 神经网络1_neuron network原理_python sklearn建模乳腺癌细胞分类器(推荐AAA)

    sklearn实战-乳腺癌细胞数据挖掘(博客主亲自录制视频教程) https://study.163.com/course/introduction.htm?courseId=1005269003&a ...

  6. [Leetcode] 01 Matrix

    问题: https://leetcode.com/problems/01-matrix/#/description 基本思路:广度优先遍历,根据所有最短距离为N的格找到所有距离为N+1的格,直到所有的 ...

  7. Oracle DB 总结(SQL)

    --SQL结构查询语言 数据库定义语言(DDL)用于建立.删除和修改数据库对象 CREATE ALTER DROP TRUNCATE 数据库操纵语言(DML)用于改变数据库表中的数据 INSERT U ...

  8. 网络结构---从alexnet 到resnet

    AlexNet-> vgg vgg 采用更小的卷积核,加深网络深度,但两者的共同点都是卷积层+pooling层最后接上fc 层的结构 Network in network ->google ...

  9. Python核心编程笔记 第三章

    3.1     语句和语法    3.1.1   注释( # )   3.1.2   继续( \ )         一般使用换行分隔,也就是说一行一个语句.一行过长的语句可以使用反斜杠( \ ) 分 ...

  10. Intelij idea 版本控制工具窗口

    1. 在菜单栏vcs中启用版本控制 2. 然后调出工具窗口,view-tools window-version control