Hi, I have the following code in the application-context of my project.
bean id="bean" class="ej.tutorial.spring.model.MyBean" />
<bean id="beanSvc" class="ej.tutorial.spring.model.OtherBean">
<property name="mBean" ref="bean"/>
</bean>
The classes are the following:
public class MyBean {
private int valor;
private String msg;
public MyBean(){
}
public MyBean(int valor,String msg){
this.valor = valor;
this.msg = msg;
}
public int getValor() {
return valor;
}
public void setValor(int valor) {
this.valor = valor;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
OtherBean class:
public class OtherBean {
private MyBean mBean;
public OtherBean(){
}
public OtherBean(MyBean bean){
this.mBean = bean;
}
public MyBean getmBean() {
return mBean;
}
public void setmBean(MyBean mBean) {
this.mBean = mBean;
}
}
Well, the application-context gives me an error. The error is the following.
No setter found for property 'mBean' in class 'ej.tutorial.spring.model.OtherBean
The truth is that I can't find a logical explanation for it since the setter of the mBean attribute is defined in the OtherBean class.