我有以下的Spring bean配置錯誤創建與java.io.File類型[不明確的構造函數參數類型]
<bean id="fileBean" class="java.io.File">
<constructor-arg type="java.lang.String"
value="$prop{file.path.property}" />
</bean>
我收到以下錯誤
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'fileBean' defined in class path resource [context.xml]:
Unsatisfied dependency expressed through constructor argument with index 0 of type
[java.net.URI]: Ambiguous constructor argument types - did you specify the correct
bean references as constructor arguments?
有bean時只有一個java.io.File的構造函數只有一個String參數,所以我不知道爲什麼這是不明確的。任何幫助讚賞。
同樣發生在我身上,異常竟然出現在我一直在編輯的另一個xml文件中 –