如题;
```
<!--nutz spring配置 -->
<bean id="nutDao" class="org.nutz.dao.impl.NutDao">
<property name="dataSource" ref="dataSource" />
<property name="runner" ref="springDaoRunner" />
<property name="sqlManager" ref="sql" />
</bean>
<bean id="sql" class="org.nutz.dao.impl.FileSqlManager">
<property name="paths">
<value>sqls/mysql</value>
</property>
</bean>
```
我这样做报错:
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nutDao' defined in class path resource [spring-config.xml]: Cannot resolve reference to bean 'sql' while setting bean property 'sqlManager';
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sql' defined in class path resource [spring-config.xml]: Instantiation of bean failed;
nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.nutz.dao.impl.FileSqlManager]:
No default constructor found; nested exception is java.lang.NoSuchMethodException: org.nutz.dao.impl.FileSqlManager.<init>()
2 回复
添加回复
请先登陆