redis配置不成功,报错java.lang.ClassNotFoundException: redis.clients.jedis.JedisPoolConfig

来源:5-2 Shiro会话管理2

gallinipper

2018-12-12 19:23

https://img1.mukewang.com/5c10ef270001b16710210391.jpg


Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [redis.clients.jedis.JedisPool] for bean with name 'jedisPool' defined in URL [file:/D:/practice/shirostudy/classes/artifacts/shiro_web_war_exploded2/WEB-INF/classes/spring/spring-redis.xml]; nested exception is java.lang.ClassNotFoundException: redis.clients.jedis.JedisPool

Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [redis.clients.jedis.JedisPoolConfig] for bean with name 'jedisPoolConfig' defined in URL [file:/D:/practice/shirostudy/classes/artifacts/shiro_web_war_exploded2/WEB-INF/classes/spring/spring-redis.xml]; nested exception is java.lang.ClassNotFoundException: redis.clients.jedis.JedisPoolConfig

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'advisor' defined in URL [file:/D:/practice/shirostudy/classes/artifacts/shiro_web_war_exploded2/WEB-INF/classes/spring/springmvc.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 URL [file:/D:/practice/shirostudy/classes/artifacts/shiro_web_war_exploded2/WEB-INF/classes/spring/spring.xml]: Cannot resolve reference to bean 'realm' while setting bean property 'realm'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'realm': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [redis.clients.jedis.JedisPool] for bean with name 'jedisPool' defined in URL [file:/D:/practice/shirostudy/classes/artifacts/shiro_web_war_exploded2/WEB-INF/classes/spring/spring-redis.xml]; nested exception is java.lang.ClassNotFoundException: redis.clients.jedis.JedisPool

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in URL [file:/D:/practice/shirostudy/classes/artifacts/shiro_web_war_exploded2/WEB-INF/classes/spring/spring.xml]: Cannot resolve reference to bean 'realm' while setting bean property 'realm'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'realm': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [redis.clients.jedis.JedisPool] for bean with name 'jedisPool' defined in URL [file:/D:/practice/shirostudy/classes/artifacts/shiro_web_war_exploded2/WEB-INF/classes/spring/spring-redis.xml]; nested exception is java.lang.ClassNotFoundException: redis.clients.jedis.JedisPool

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'realm': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [redis.clients.jedis.JedisPool] for bean with name 'jedisPool' defined in URL [file:/D:/practice/shirostudy/classes/artifacts/shiro_web_war_exploded2/WEB-INF/classes/spring/spring-redis.xml]; nested exception is java.lang.ClassNotFoundException: redis.clients.jedis.JedisPool

Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [redis.clients.jedis.JedisPool] for bean with name 'jedisPool' defined in URL [file:/D:/practice/shirostudy/classes/artifacts/shiro_web_war_exploded2/WEB-INF/classes/spring/spring-redis.xml]; nested exception is java.lang.ClassNotFoundException: redis.clients.jedis.JedisPool

Caused by: java.lang.ClassNotFoundException: redis.clients.jedis.JedisPool


Caused by: java.lang.ClassNotFoundException: redis.clients.jedis.JedisPool

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1275)

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1109)

at org.springframework.util.ClassUtils.forName(ClassUtils.java:250)

at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:394)

at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1397)

at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1344)

... 68 more

Related cause:

org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [redis.clients.jedis.JedisPoolConfig] for bean with name 'jedisPoolConfig' defined in URL [file:/D:/practice/shirostudy/classes/artifacts/shiro_web_war_exploded2/WEB-INF/classes/spring/spring-redis.xml]; nested exception is java.lang.ClassNotFoundException: redis.clients.jedis.JedisPoolConfig

at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1352)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:628)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:597)

at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1445)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:445)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:415)

at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:220)

at org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper.findAdvisorBeans(BeanFactoryAdvisorRetrievalHelper.java:73)

at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors(AbstractAdvisorAutoProxyCreator.java:101)

at org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator.shouldSkip(AspectJAwareAdvisorAutoProxyCreator.java:103)

at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessBeforeInstantiation(AbstractAutoProxyCreator.java:248)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:988)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:959)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:472)

at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)

at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:240)

at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:687)

Caused by: java.lang.ClassNotFoundException: redis.clients.jedis.JedisPoolConfig

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1275)

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1109)

at org.springframework.util.ClassUtils.forName(ClassUtils.java:250)

at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:394)

at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1397)

at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1344)

... 68 more


写回答 关注

2回答

  • gallinipper
    2018-12-26 09:32:30

    已解决,是tomcat配置的问题。删掉原来的配置重新配置一边就好使了。

    不老八戒

    tomcat重新配什么意思?

    2019-09-27 10:19:21

    共 1 条回复 >

  • gallinipper
    2018-12-12 19:26:27

    有没有出现相同问题的?您是如何解决的?请教大神如何解决。

    慕后端541...

    <!-- SpringBoot2.0中,默认赋予Lettuce依赖关系,要使用Jedis配置,需排除Lettuce依赖关系 --> <exclusions> <exclusion> <groupId>io.lettuce</groupId> <artifactId>lettuce-core</artifactId> </exclusion> </exclusions>

    2020-03-31 11:21:04

    共 1 条回复 >

Shiro安全框架入门

从零入门Shiro安全框架

48036 学习 · 332 问题

查看课程

相似问题