报错内容如下
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'selectaction' defined in class path resource [applicationContext.xml]: Initialization of bean failed;
nested exception is org.springframework.beans.TypeMismatchException:
Failed to convert property value of type [biz.impl.businessBizImpl] to required type [biz.businessBiz] for property 'bbiz';
nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [biz.impl.businessBizImpl] to required type [biz.businessBiz] for property 'bbiz':
no matching editors or conversion strategy found代码如下spring配置
<bean id="bdao" class="dao.impl.businessDaoImpl">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="bbiz" class="biz.impl.businessBizImpl">
<property name="bdao" ref="bdao" />
</bean>
<bean id="selectaction" class="action.selectAction">
<property name="bbiz" ref="bbiz" />
</bean>actioon代码如下---------------------------import biz.businessBiz;import com.opensymphony.xwork2.ActionSupport;
import entity.business;public class selectAction extends ActionSupport{
/**
*
*/
business bussiness=new business();
private businessBiz bbiz; public businessBiz getBbiz() {
return bbiz;
} public void setBbiz(businessBiz bbiz) {
this.bbiz = bbiz;
} public business getBussiness() {
return bussiness;
} public void setBussiness(business bussiness) {
this.bussiness = bussiness;
} public String execute()
{
List<business> list=bbiz.selectAll();
ServletActionContext.getContext().getValueStack().set("x", list);
return SUCCESS;
}
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'selectaction' defined in class path resource [applicationContext.xml]: Initialization of bean failed;
nested exception is org.springframework.beans.TypeMismatchException:
Failed to convert property value of type [biz.impl.businessBizImpl] to required type [biz.businessBiz] for property 'bbiz';
nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [biz.impl.businessBizImpl] to required type [biz.businessBiz] for property 'bbiz':
no matching editors or conversion strategy found代码如下spring配置
<bean id="bdao" class="dao.impl.businessDaoImpl">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="bbiz" class="biz.impl.businessBizImpl">
<property name="bdao" ref="bdao" />
</bean>
<bean id="selectaction" class="action.selectAction">
<property name="bbiz" ref="bbiz" />
</bean>actioon代码如下---------------------------import biz.businessBiz;import com.opensymphony.xwork2.ActionSupport;
import entity.business;public class selectAction extends ActionSupport{
/**
*
*/
business bussiness=new business();
private businessBiz bbiz; public businessBiz getBbiz() {
return bbiz;
} public void setBbiz(businessBiz bbiz) {
this.bbiz = bbiz;
} public business getBussiness() {
return bussiness;
} public void setBussiness(business bussiness) {
this.bussiness = bussiness;
} public String execute()
{
List<business> list=bbiz.selectAll();
ServletActionContext.getContext().getValueStack().set("x", list);
return SUCCESS;
}
解决方案 »
- html:optionsCollection标签及LabelValueBean
- session.setMaxInactiveInterval(-1) 是否意味着,session将永久在服务器端保存?
- struts2和jquery请求,返回list,循环遍历出来?
- 怎样将数据库中的图片在页面上显示出来的问题
- 请问这个报错怎么解决?
- 在线等。。。请教Java SOCKET 客户端的问题
- Ant copy问题
- 请问:使用什么命令来生成可以直接上传的用于weblogic服务器的ejb jar文件?高手进
- 有人可以说说EJB和放火墙的问题吗?谢谢了
- 新人求助,有关使用redisTemplate缓存数据中文,结果不是二进制!!注意,不是二进制,而是正常显示中文...
- 关于学习servlet遇到的问题
- jasper文件打印求助!!!
<property name="bdao" ref="bdao" />
</bean>
<bean id="selectaction" class="action.selectAction">
<property name="bbiz" ref="bbiz" />
</bean换个名字试一试
光看着报错的话:'bbiz'你定义的是'businessBizImpl'类型,但你注入的时候是'businessBiz',转换的时候报错的
形如:
public interface businessBiz {
......
}
public class businessBizImpl implements businessBiz {
......
}