高分求解Spring配置问题,在线等解答!
公司的项目需要重构---把原来的XML里边的bean配置全都换成注入注解,现在报以下错误:
(MSC service thread 1-2) Context initialization failed:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'iataSectionService' defined in "/D:/cmrm/CMRM/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final/standalone/deployments/cmrm-web.war/WEB-INF/lib/cmrm-master-1.0.0-SNAPSHOT.jar/applicationContext-master.xml":
Cannot resolve reference to bean 'countryService' while setting bean property 'countryService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'countryService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.com.acca.cmrm.master.app.service.RegionService cn.com.acca.cmrm.master.app.service.impl.CountryServiceImpl.regionService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'regionService' defined in "/D:/cmrm/CMRM/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final/standalone/deployments/cmrm-web.war/WEB-INF/lib/cmrm-master-1.0.0-SNAPSHOT.jar/applicationContext-master.xml": Cannot resolve reference to bean 'provinceService' while setting bean property 'provinceService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'provinceService' defined in "/D:/cmrm/CMRM/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final/standalone/deployments/cmrm-web.war/WEB-INF/lib/cmrm-master-1.0.0-SNAPSHOT.jar/applicationContext-master.xml": Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'countryService' of bean class [cn.com.acca.cmrm.master.app.service.impl.ProvinceServiceImpl]: Bean property 'countryService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329) [spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107) [spring-beans-3.2.2.RELEASE.jar:3.2.2.RELEASE]