I started learning spring from spring reference 3.0, and I wanted to try how to create an instance of inner bean:
Here is my code:
package com.springexample;
public class ExampleBean {
private String samplePropertyExampleBean;
public void setSamplePropertyExampleBean(String samplePropertyExampleBean) {
this.samplePropertyExampleBean = samplePropertyExampleBean;
}
public String getSamplePropertyExampleBean() {
return samplePropertyExampleBean;
}
class InnerBean{
private String sampleProperty;
public void setSampleProperty(String sampleProperty) {
this.sampleProperty = sampleProperty;
}
public String getSampleProperty() {
return sampleProperty;
}
}
}
And my configuration file:
When I try to extract an InnerBean bean, I get the following error:
"main" org.springframework.beans.factory.BeanCreationException: bean "InnerBean", [spring -config.xml]: bean ; - org.springframework.beans.BeanInstantiationException: bean class [com.springexample.ExampleBean $InnerBean]: ; - java.lang.NoSuchMethodException: com.springexample.ExampleBean $InnerBean.()
? InnerBean, .
- ?