2016-08-16 4 views
2

I가 다음과 같은 오류 activiti 및 웹 소켓을 함께 실행하는 봄 부팅을 사용하는 동안 : 봄 부팅 추상적 인 구성을 사용봄 부팅 추상적 인 자동 구성 문제

Parameter 0 of method springAsyncExecutor in org.activiti.spring.boot.AbstractProcessEngineAutoConfiguration required a single bean, but 4 were found: 
- clientInboundChannelExecutor: defined by method 'clientInboundChannelExecutor' in class path resource [org/springframework/web/socket/config/annotation/DelegatingWebSocketMessageBrokerConfiguration.class] 
- clientOutboundChannelExecutor: defined by method 'clientOutboundChannelExecutor' in class path resource [org/springframework/web/socket/config/annotation/DelegatingWebSocketMessageBrokerConfiguration.class] 
- brokerChannelExecutor: defined by method 'brokerChannelExecutor' in class path resource [org/springframework/web/socket/config/annotation/DelegatingWebSocketMessageBrokerConfiguration.class] 
- messageBrokerTaskScheduler: defined by method 'messageBrokerTaskScheduler' in class path resource [org/springframework/web/socket/config/annotation/DelegatingWebSocketMessageBrokerConfiguration.class] 


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 

, 나는 몇 가지 구성을 무시해야합니까?

도움 주셔서 감사합니다.

답변

2

그것은 Activiti의 자동 구성 클래스의 버그 일 것입니다. 응용 프로그램 컨텍스트에서 단 하나의 TaskExecutor Bean 인 경우에만 의존하거나, 여러 Bean이있는 경우 그 중 하나가 기본 Bean이됩니다.

당신은 당신의 자신의 TaskExecutor 빈을 선언하고 @Primary로 표시하여 문제를 해결 할 수 있어야한다 :

@Configuration 
class SomeConfiguration { 

    @Primary 
    @Bean 
    public TaskExecutor primaryTaskExecutor() { 
     ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); 
     // Customize executor as appropriate 
     return executor; 
    } 

} 
+0

대, 기본으로 내 자신 된 TaskExecutor를 작성하여, 그것을 밖으로했다. 당신 말이 맞았습니다. 그것은 Activiti의 자동 구성 클래스의 버그입니다. –