【发布时间】:2014-08-10 07:15:24
【问题描述】:
<bean id="MyDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="${url}"/>
<property name="username" value="${username}"/>
<property name="password" value="${password}"/>
</bean>
<bean id="template" class="org.springframework.jdbc.core.JdbcTemplate">
<constructor-arg value="MyDataSource"/>
</bean>
在类路径中定义名称为“模板”的 bean 创建错误 资源 [application-context.xml]:无法解析匹配 构造函数(提示:为简单指定索引/类型/名称参数 避免类型歧义的参数)
我不确定我在这里做错了什么才能得到上述错误?使用正确的变量名在属性文件中正确定义所有内容。有什么要检查的?
【问题讨论】:
标签: java xml spring spring-mvc