我有以下的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文件中 –