加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

SSH集成CXF项目启动时出现告警日志

发布时间:2020-12-16 22:08:18 所属栏目:安全 来源:网络整理
导读:spring 4.1.3.RELEASE + cxf 2.5.0框架,在项目启动时出现一大堆告警日志,虽然不影响项目正常运行,但看着很刺眼,所以要想办法清除掉。 告警1:Import of META-INF/cxf/cxf-extension-soap.xml has been deprecated and is unnecessary 原因:之前老版本的

spring 4.1.3.RELEASE + cxf 2.5.0框架,在项目启动时出现一大堆告警日志,虽然不影响项目正常运行,但看着很刺眼,所以要想办法清除掉。

告警1:Import of META-INF/cxf/cxf-extension-soap.xml has been deprecated and is unnecessary
原因:之前老版本的配置是要求导入cxf-extension-soap.xml文件,如下所示:

<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" />

新版本已经不作此要求,所以会出现这样的警告。

解决办法:找到spring中cxf相关的配置文件applicationContext.xml,将import部分的cxf-extension-soap.xml这一行删除掉。

告警2:org.apache.cxf.endpoint.ServiceImpl initDestination;
Setting the server’s publish address to be /orderService;
org.apache.cxf.common.injection.ResourceInjector - visitField;
fail to resolve resource com.xxx.OrderServiceImpl/xxx;
其中OrderServiceImpl为实现类,com.xxx.OrderServiceImpl/xxx为该实现注入的成员变量。
endpoint配置信息如下:

<jaxws:endpoint id = "OrderService" address="/orderService" implementor="#orderServiceImpl" />
      <bean id = "orderServiceImpl" class="com.xxx.OrderService">

原因:endpoint的实现类注入的依赖服务类,没有按照指定的格式写,这样的日志有特别多,因为每个实现类都注入了许多依赖服务类,如 @Resource private AuthService authService; 这样写也没有问题,不用影响正常使用,但就是会有警告,原因是@Resource没有添加name属性,改成这样,警告就消失了,如下所示: @Resource(name=”authService”) private AuthService authService;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读