0
時,我有一個bean定義爲:曖昧工廠方法的參數類型錯誤接線的ExecutorService的
<bean id="executor" class="java.util.concurrent.Executors"
factory-method="newSingleThreadExecutor" destroy-method="shutdownNow" />
當加載,這不幸的原因:
Ignoring factory method [public static java.util.concurrent.ExecutorService java.util.concurrent.Executors.newSingleThreadExecutor(java.util.concurrent.ThreadFactory)] of bean 'executor':
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'executor' defined in class path resource [main-config.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.util.concurrent.ThreadFactory]: Ambiguous factory method argument types - did you specify the correct bean references as factory method arguments?
春天似乎要使用的newSingleThreadExecutor( ThreadFactory)方法,而我只想使用無參數方法。任何想法爲什麼?
我無法重現此錯誤。這對我來說可以。我在3.2.4上。你確定你正在發佈你正在使用的? –