2016-08-16 9 views
2

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がある場合は、それらのうちの1つがプライマリであることに依存しています。

あなたがあなた自身のTaskExecutor Beanを宣言し@Primaryとしてそれをマークすることで問題を回避することができるはずです。

@Configuration 
class SomeConfiguration { 

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

} 
+0

グレートは、プライマリとして自分のTaskExecutorを作成することによって、それが働きました。あなたが正しいので、Activitiの自動設定クラスのバグです。 –