2.8版本 启动报redis注入问题

Blade 未结 2 1806
1010602131
1010602131 2021-04-28 08:04

一、该问题的重现步骤是什么?

1. 下载2.8版本

2. 配置好redis、数据库连接

3.启动


二、你期待的结果是什么?实际看到的又是什么?

 期待正常启动

实际看到


Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2021-04-28 07:59:49.946 ERROR 15884 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 


***************************

APPLICATION FAILED TO START

***************************


Description:


Parameter 0 of method bladeRedis in org.springblade.core.redis.config.RedisTemplateConfiguration required a bean of type 'org.springframework.data.redis.core.RedisTemplate' that could not be found.


The following candidates were found but could not be injected:

- Bean method 'redisTemplate' in 'RedisTemplateConfiguration' not loaded because @ConditionalOnMissingBean (names: redisTemplate; SearchStrategy: all) found beans named redisTemplate



Action:


Consider revisiting the entries above or defining a bean of type 'org.springframework.data.redis.core.RedisTemplate' in your configuration.


Disconnected from the target VM, address: '127.0.0.1:7071', transport: 'socket'


Process finished with exit code 1

三、你正在使用的是什么产品,什么版本?在什么操作系统上?

  bladex 单体 2.8版本   window8.1环境

四、请提供详细的错误堆栈信息,这很重要。

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2021-04-28 07:59:49.946 ERROR 15884 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 


***************************

APPLICATION FAILED TO START

***************************


Description:


Parameter 0 of method bladeRedis in org.springblade.core.redis.config.RedisTemplateConfiguration required a bean of type 'org.springframework.data.redis.core.RedisTemplate' that could not be found.


The following candidates were found but could not be injected:

- Bean method 'redisTemplate' in 'RedisTemplateConfiguration' not loaded because @ConditionalOnMissingBean (names: redisTemplate; SearchStrategy: all) found beans named redisTemplate



Action:


Consider revisiting the entries above or defining a bean of type 'org.springframework.data.redis.core.RedisTemplate' in your configuration.


Disconnected from the target VM, address: '127.0.0.1:7071', transport: 'socket'


Process finished with exit code 1

五、若有更多详细信息,请在下面提供。

2条回答
  •  admin
    admin (楼主)
    2021-04-28 11:46

    官方git私服原版有这个问题么?你有没有改动过其他的地方,看报错是其他的地方先初始化了redisTemplate,导致RedisTemplateConfiguration本身的初始化没有生效,@ConditionalOnMissingBean直接跳过了。

    但是BladeX系统本身除此之外没有其他地方初始化过redisTemplate,而RedisTemplateConfiguration也是在RedisAutoConfiguration之前初始化的所以不会被其影响。

    你需要排查一下本工程其他地方有没有对其实例化,BladeX只有一处

    image.png


    这是本地启动成功的截图

    image.png


    另外商业版答疑规则见:https://sns.bladex.cn/article-14990.html

    请将账号邮箱修改为下单购买授权的qq邮箱便可咨询商业版疑问


提交回复