webService调用spring配置文件中的bean为空问题!!
问题:
A项目中有配置好的spring bean文件(该文件配置没问题,在A项目中使用正常)。
部分bean文件代码:
<bean id="guaranteeApplyService" class="com.supporter.prj.bm.guarantee.service.GuaranteeApplyService">
</bean>
现在A项目中添加基于cxf的webservice接口:
配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<import resource="bm_guarantee-service.xml"/>
<jaxws:endpoint id="GuaranteeApplyWebServiceZjMa"
address="/GuaranteeApplyWebServiceZjMa"
implementor="com.supporter.prj.bm.webservice.guaranteeApply.GuaranteeApplyWebServiceZjMaImpl">
</jaxws:endpoint>
</beans>
接口实现类代码:
@WebService(endpointInterface = "com.supporter.prj.bm.webservice.guaranteeApply.GuaranteeApplyWebServiceZjMa", serviceName = "GuaranteeApplyWebServiceZjMa")
public class GuaranteeApplyWebServiceZjMaImpl implements GuaranteeApplyWebServiceZjMa {
@Autowired
GuaranteeApplyService guaranteeApplyService;
@Override
public String getGuaranteeApplyRecord() {
System.out.println("aaaaaaaaaaaaa"+guaranteeApplyService);
}
项目启动不报错,只是System.out.println("aaaaaaaaaaaaa"+guaranteeApplyService); 输出调用的guaranteeApplyService为空!!
在线急等,求帮助,万分感谢!!!