Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnection

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘enableRedisKeyspaceNotificationsInitializer’ defined in class path resource [org/springframework/session/data/redis/config/annotation/web/http/RedisHttpSessionConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1702) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:579) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean 0 ( A b s t r a c t B e a n F a c t o r y . j a v a : 317 )   [ s p r i n g − b e a n s − 5.0.5. R E L E A S E . j a r : 5.0.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . D e f a u l t S i n g l e t o n B e a n R e g i s t r y . g e t S i n g l e t o n ( D e f a u l t S i n g l e t o n B e a n R e g i s t r y . j a v a : 228 )   [ s p r i n g − b e a n s − 5.0.5. R E L E A S E . j a r : 5.0.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . d o G e t B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 315 )   [ s p r i n g − b e a n s − 5.0.5. R E L E A S E . j a r : 5.0.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . g e t B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 199 )   [ s p r i n g − b e a n s − 5.0.5. R E L E A S E . j a r : 5.0.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . D e f a u l t L i s t a b l e B e a n F a c t o r y . p r e I n s t a n t i a t e S i n g l e t o n s ( D e f a u l t L i s t a b l e B e a n F a c t o r y . j a v a : 760 )   [ s p r i n g − b e a n s − 5.0.5. R E L E A S E . j a r : 5.0.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . f i n i s h B e a n F a c t o r y I n i t i a l i z a t i o n ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 869 )   [ s p r i n g − c o n t e x t − 5.0.5. R E L E A S E . j a r : 5.0.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . r e f r e s h ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 550 )   [ s p r i n g − c o n t e x t − 5.0.5. R E L E A S E . j a r : 5.0.5. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . w e b . s e r v l e t . c o n t e x t . S e r v l e t W e b S e r v e r A p p l i c a t i o n C o n t e x t . r e f r e s h ( S e r v l e t W e b S e r v e r A p p l i c a t i o n C o n t e x t . j a v a : 140 )   [ s p r i n g − b o o t − 2.0.1. R E L E A S E . j a r : 2.0.1. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r e f r e s h ( S p r i n g A p p l i c a t i o n . j a v a : 759 ) [ s p r i n g − b o o t − 2.0.1. R E L E A S E . j a r : 2.0.1. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r e f r e s h C o n t e x t ( S p r i n g A p p l i c a t i o n . j a v a : 395 ) [ s p r i n g − b o o t − 2.0.1. R E L E A S E . j a r : 2.0.1. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r u n ( S p r i n g A p p l i c a t i o n . j a v a : 327 ) [ s p r i n g − b o o t − 2.0.1. R E L E A S E . j a r : 2.0.1. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r u n ( S p r i n g A p p l i c a t i o n . j a v a : 1255 ) [ s p r i n g − b o o t − 2.0.1. R E L E A S E . j a r : 2.0.1. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r u n ( S p r i n g A p p l i c a t i o n . j a v a : 1243 ) [ s p r i n g − b o o t − 2.0.1. R E L E A S E . j a r : 2.0.1. R E L E A S E ] a t c o m . m a y i k t . A p p M e m b e r . m a i n ( A p p M e m b e r . j a v a : 28 ) [ c l a s s e s / : n a ] C a u s e d b y : o r g . s p r i n g f r a m e w o r k . d a t a . r e d i s . R e d i s C o n n e c t i o n F a i l u r e E x c e p t i o n : C a n n o t g e t J e d i s c o n n e c t i o n ; n e s t e d e x c e p t i o n i s r e d i s . c l i e n t s . j e d i s . e x c e p t i o n s . J e d i s C o n n e c t i o n E x c e p t i o n : C o u l d n o t g e t a r e s o u r c e f r o m t h e p o o l a t o r g . s p r i n g f r a m e w o r k . d a t a . r e d i s . c o n n e c t i o n . j e d i s . J e d i s C o n n e c t i o n F a c t o r y . f e t c h J e d i s C o n n e c t o r ( J e d i s C o n n e c t i o n F a c t o r y . j a v a : 286 )   [ s p r i n g − d a t a − r e d i s − 2.0.6. R E L E A S E . j a r : 2.0.6. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . d a t a . r e d i s . c o n n e c t i o n . j e d i s . J e d i s C o n n e c t i o n F a c t o r y . g e t C o n n e c t i o n ( J e d i s C o n n e c t i o n F a c t o r y . j a v a : 469 )   [ s p r i n g − d a t a − r e d i s − 2.0.6. R E L E A S E . j a r : 2.0.6. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . s e s s i o n . d a t a . r e d i s . c o n f i g . a n n o t a t i o n . w e b . h t t p . R e d i s H t t p S e s s i o n C o n f i g u r a t i o n 0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at com.mayikt.AppMember.main(AppMember.java:28) [classes/:na] Caused by: org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:286) ~[spring-data-redis-2.0.6.RELEASE.jar:2.0.6.RELEASE] at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:469) ~[spring-data-redis-2.0.6.RELEASE.jar:2.0.6.RELEASE] at org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration 0(AbstractBeanFactory.java:317) [springbeans5.0.5.RELEASE.jar:5.0.5.RELEASE]atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) [springbeans5.0.5.RELEASE.jar:5.0.5.RELEASE]atorg.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) [springbeans5.0.5.RELEASE.jar:5.0.5.RELEASE]atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) [springbeans5.0.5.RELEASE.jar:5.0.5.RELEASE]atorg.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760) [springbeans5.0.5.RELEASE.jar:5.0.5.RELEASE]atorg.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) [springcontext5.0.5.RELEASE.jar:5.0.5.RELEASE]atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) [springcontext5.0.5.RELEASE.jar:5.0.5.RELEASE]atorg.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) [springboot2.0.1.RELEASE.jar:2.0.1.RELEASE]atorg.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)[springboot2.0.1.RELEASE.jar:2.0.1.RELEASE]atorg.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)[springboot2.0.1.RELEASE.jar:2.0.1.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:327)[springboot2.0.1.RELEASE.jar:2.0.1.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:1255)[springboot2.0.1.RELEASE.jar:2.0.1.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:1243)[springboot2.0.1.RELEASE.jar:2.0.1.RELEASE]atcom.mayikt.AppMember.main(AppMember.java:28)[classes/:na]Causedby:org.springframework.data.redis.RedisConnectionFailureException:CannotgetJedisconnection;nestedexceptionisredis.clients.jedis.exceptions.JedisConnectionException:Couldnotgetaresourcefromthepoolatorg.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:286) [springdataredis2.0.6.RELEASE.jar:2.0.6.RELEASE]atorg.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:469) [springdataredis2.0.6.RELEASE.jar:2.0.6.RELEASE]atorg.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfigurationEnableRedisKeyspaceNotificationsInitializer.afterPropertiesSet(RedisHttpSessionConfiguration.java:284) ~[spring-session-data-redis-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1761) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1698) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
… 16 common frames omitted
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
at redis.clients.util.Pool.getResource(Pool.java:53) ~[jedis-2.9.0.jar:na]
at redis.clients.jedis.JedisPool.getResource(JedisPool.java:226) ~[jedis-2.9.0.jar:na]
at redis.clients.jedis.JedisPool.getResource(JedisPool.java:16) ~[jedis-2.9.0.jar:na]
at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:276) ~[spring-data-redis-2.0.6.RELEASE.jar:2.0.6.RELEASE]
… 20 common frames omitted
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused (Connection refused)
at redis.clients.jedis.Connection.connect(Connection.java:207) ~[jedis-2.9.0.jar:na]
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:93) ~[jedis-2.9.0.jar:na]
at redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1767) ~[jedis-2.9.0.jar:na]
at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:106) ~[jedis-2.9.0.jar:na]
at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:889) ~[commons-pool2-2.5.0.jar:2.5.0]
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:433) ~[commons-pool2-2.5.0.jar:2.5.0]
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:362) ~[commons-pool2-2.5.0.jar:2.5.0]
at redis.clients.util.Pool.getResource(Pool.java:49) ~[jedis-2.9.0.jar:na]
… 23 common frames omitted
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_161]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_161]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_161]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_161]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_161]
at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_161]
at redis.clients.jedis.Connection.connect(Connection.java:184) ~[jedis-2.9.0.jar:na]
… 30 common frames omitted

Process finished with exit code 1

翻译是没有建立reids连接,查看springboot配置文件,连接的是本地127.0.0.1的,所以是本地没有开启redis ,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值