izerui / cas-server-integration-redis

Cas ticket registry , This project has been included by cas
35 stars 21 forks source link

引入后 spring-aop spring- tx commons-pool 这几个jar包冲突  #3

Closed zeng531196248 closed 6 years ago

zeng531196248 commented 6 years ago

![Uploading image.png…]() 我排除了下  ,,第一次用gradl  cas4.2.7

compile ('com.github.izerui:cas-server-integration-redis:1.1.1-RELEASE'){ exclude (group: 'org.springframework') exclude (group: 'org.slf4j') exclude (group: 'org.apache.commons',module:'commons-pool2')

    }

下面这是我按照你说的配置的

<bean id="redisTicketRegistry" class="ren.boot.cas.ticket.registry.RedisTicketRegistry"
      p:client-ref="ticketRedisTemplate"
      p:tgtTimeout="28800"
      p:stTimeout="10"/>
<!-- redis连接池 -->
<bean id="jedisConnFactory"
      class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
      p:hostName="localhost"
      p:database="0"
      p:port="6379"
      p:usePool="true"/>
<bean id="ticketRedisTemplate" class="ren.boot.cas.ticket.registry.TicketRedisTemplate"
      p:connectionFactory-ref="jedisConnFactory"/>

异常   2017-10-30 21:30:44,166 WARN [org.springframework.web.context.support.XmlWebApplicationContext] - <Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'centralAuthenticationService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisTicketRegistry' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Cannot resolve reference to bean 'ticketRedisTemplate' while setting bean property 'client'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ticketRedisTemplate' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool2/impl/GenericObjectPoolConfig> 2017-10-30 21:30:44,298 WARN [org.jasig.cas.services.JsonServiceRegistryConfigWatcher] - 2017-10-30 21:30:44,303 ERROR [org.springframework.web.context.ContextLoader] - <Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'centralAuthenticationService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisTicketRegistry' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Cannot resolve reference to bean 'ticketRedisTemplate' while setting bean property 'client'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ticketRedisTemplate' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool2/impl/GenericObjectPoolConfig at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:311) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1218) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)

。。。。。

求解

zeng531196248 commented 6 years ago

已经解决!