问答详情
源自:5-2 Shiro会话管理2

redis连接不上

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in class path resource [spring/spring.xml]: Cannot resolve reference to bean 'securityManager' while setting bean property 'securityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in class path resource [spring/spring.xml]: Cannot resolve reference to bean 'sessionManager' while setting bean property 'sessionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionManager' defined in class path resource [spring/spring.xml]: Cannot resolve reference to bean 'redisSessionDao' while setting bean property 'sessionDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisSessionDao': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jedisUtil': Unsatisfied dependency expressed through field 'jedisPool'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jedisPool' defined in class path resource [spring/spring-redis.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [redis.clients.jedis.JedisPool]: Constructor threw exception; nested exception is redis.clients.jedis.exceptions.InvalidURIException: Cannot open Redis connection due invalid URI. 127.0.0.1


我是装有redis的,并且redis服务也启动了


提问者:qq_慕数据0038142 2019-07-13 12:41

个回答

  • qq_慕数据0038142
    2019-07-13 12:50:21

    找到问题了,之前也看有人提过配置的问题,只是没有理解。下面是连接不上redis的参考:https://blog.csdn.net/mxlwd168/article/details/76136090

    我spring-redis.xml中修改后是这样的:

    https://img3.mukewang.com/5d2962d3000144cd08850141.jpg

    加上 type属性就可以了