반응형
에러 발생
Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
프로젝트에서 'getUserConnection' Bean이 충돌하여 발생.
인텔리제이에서는 발생을 하지 않았고 이클립스에서만 발생을 했었습니다.
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of constructor in --------------------------- required a single bean, but 3 were found:
- getUserConnection: defined by method 'getUserConnection' in class path resource [-------------/RedisConfig.class]
- getSessionConnection: defined by method 'getSessionConnection' in class path resource [-------------/RedisConfig.class]
- getSseConnection: defined by method 'getSseConnection' in class path resource [-------------/RedisConfig.class]
This may be due to missing parameter name information
Action:
Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
Ensure that your compiler is configured to use the '-parameters' flag.
You may need to update both your build tool settings as well as your IDE.
(See https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x#parameter-name-retention)
기존 소스
@Bean
@Qualifier("getUserConnection")
public RedisTemplate<String, Object> getUserConnection()
@Bean
@Qualifier("getSessionConnection")
public RedisTemplate<String, Object> getSessionConnection()
변경 소스
@Bean
@Qualifier("getUserConnection")
public RedisTemplate<String, Object> getUserConnection()
@Bean
@Qualifier("getSessionConnection")
@Primary << 추가
public RedisTemplate<String, Object> getSessionConnection()
반응형
'dev > java(egov)' 카테고리의 다른 글
java 16진수 색상 표현 RGB (1) | 2025.01.27 |
---|---|
java int to hex (0) | 2025.01.26 |
pg 연동 후 로그인 세션 종료 (5) | 2024.10.09 |
sts error - Could not fetch model of type 'GradleBuild' using connection to Gradle distribution (0) | 2024.09.06 |
[Java] java enum key value (0) | 2024.08.22 |