spring配置 文件 applicationContext.xml
applicationContext_dexc.xml
applicationContext_BussinessDIC.xml
applicationContext_BussinessDIC.xml中的bean配置 注入到
applicationContext_BussinessDIC.xml中的bean中 无法注入
exception
Unable to instantiate Action, wf_workFlowAction,
defined for 'flow_index' in namespace '/workflow'Error creating bean with name 'wf_workFlowAction'
defined in class path resource [applicationContext_workflow.xml]:
Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'dexcSenderHandler' defined in class path resource [applicationContext_dexc.xml]:
Initialization of bean failed;
nested exception is org.springframework.beans.InvalidPropertyException:
Invalid property 'dICouterdepartmentsService' of bean class [com.app.dexc.DexcSenderHandler]:
No property 'dICouterdepartmentsService' found com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:306)
所有配置都没有错误就 出现这种错呀一般是什么原因啊?????
你有个类
com.app.dexc.DexcSend*****
中没有一个属性:dICouterdepartmentsService
仔细检查下spring 的配置
dexcSenderHandler bean这块的
1、dICouterdepartmentsService对应的setter方法名字应该为 setdICouterdepartmentsService
2、javabean命名规范
属性名/类型 | getter 方法 | setter 方法
————————————|——————————————————|——————————————————————————
xcoordinate/Double | public Double getXcoordinate() | public void setXcoordinate(Double newValue)
————————————|——————————————————|——————————————————————————
xCoordinate/Double | public Double getxCoordinate() |public void setxCoordinate(Double newValue)
————————————|——————————————————|——————————————————————————
XCoordinate/Double |public Double getXCoordinate() | public void setXCoordinate(Double newValue)
————————————|——————————————————|——————————————————————————
Xcoordinate/Double |不允许 | 不允许
————————————|——————————————————|——————————————————————————
哈哈,我也想的是 他属性明命名有错误。