Consider there are 2 classes: When creating bean A using factory.getbean(), the bean gets created but the property coldata is null inspite of initializing to new hashmap.
@Component
@Scope("prototype")
public class A{
private Map<String, Map<String,String>> coldata = new HashMap<String, Map<String,String>>();
}
@Service
public class B{
@Autowired
private BeanFactory factory;
public void test(){
A a= (A)factory.getBean("A");
System.out.println(a.coldata)
}
}