webService调用spring配置文件中的bean为空问题!!

向天再借1分钱 向天再借1分钱 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
问题:

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为空!!

在线急等,求帮助,万分感谢!!!

...全文
评论 5
收藏 已收藏
分享
返回顶部
向天再借1分钱
Java 51,407 成员 86,131 内容