启动的时候报错DistributedLock 找不到

1381178780 发布于 08/29 09:29
阅读 104
收藏 0

@Mr---D 你好,想跟你请教个问题:

我复制了您的代码到自己的项目,配置跟您的一样,但是报如下错误,请帮忙查看一下

我下载了您的代码,并copy源代码到我的项目里面,但是在spring boot启动的时候

***************************
APPLICATION FAILED TO START
***************************

Description:

Field distributedLock in com.yxxs.core.business.aspect.DistributedLockAspectConfiguration required a bean of type 'com.yxxs.core.framework.lock.DistributedLock' that could not be found.

The injection point has the following annotations:
    - @org.springframework.beans.factory.annotation.Autowired(required=true)

The following candidates were found but could not be injected:
    - Bean method 'redisDistributedLock' in 'DistributedLockAutoConfiguration' not loaded because @ConditionalOnBean (types: org.springframework.data.redis.core.RedisTemplate; SearchStrategy: all) did not find any beans of type org.springframework.data.redis.core.RedisTemplate


Action:

Consider revisiting the entries above or defining a bean of type 'com.yxxs.core.framework.lock.DistributedLock' in your configuration.

我查看了代码应该是在

@Configuration @AutoConfigureAfter(RedisAutoConfiguration.class) public class DistributedLockAutoConfiguration { @Bean @ConditionalOnBean(RedisTemplate.class) public DistributedLock redisDistributedLock(RedisTemplate<Object, Object> redisTemplate){ return new RedisDistributedLock(redisTemplate); } }

加载中
返回顶部
顶部