当前位置:网站首页>WebService客户端请求失败 can not create a secure xmlinputfactory
WebService客户端请求失败 can not create a secure xmlinputfactory
2022-06-23 21:56:00 【lang20150928】
webService客户端请求失败:can not create a secure xmlinputfactory
对应的cxf版本为
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<cxf.version>3.2.14</cxf.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-parent</artifactId>
<version>${cxf.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf</artifactId>
<version>${cxf.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

找到源码对应位置(org.apache.cxf.staxutils.StaxUtils类的338行)
从以上源码不难看出,如果allowInsecureParser参数为true的话,就不会进入到抛出异常的逻辑。而allowInsecureParser参数是在类初始化的时候设置的。大致源码如下所示
public static final String ALLOW_INSECURE_PARSER =
"org.apache.cxf.stax.allowInsecureParser";
private static boolean allowInsecureParser;
static{
// ...
String s = SystemPropertyAction.getPropertyOrNull(ALLOW_INSECURE_PARSER);
if (!StringUtils.isEmpty(s)) {
allowInsecureParser = "1".equals(s) || Boolean.parseBoolean(s);
}
// ...
}
从上面不难看出如果ALLOW_INSECURE_PARSER对应的值不为空,而且为1或者true时,allowInsecureParser为true.
设置系统参数 -Dorg.apache.cxf.stax.allowInsecureParser=1再次启动,webservice请求不报错。
边栏推荐
- JMeter pressure measuring tool beginner level chapter
- Apache log4j 2 reported high-risk vulnerability, coding teamed up with Tencent to protect software security
- How to set ulimit value for SYSTEMd service in easycvr?
- Talk about the problems and solutions of IT enterprise fixed assets management system
- sql server常用sql
- Problems and solutions of MacOS installation go SQLite3
- Installation and use of qingscan scanner
- How to set the website construction title bar drop-down
- 2022云顾问技术系列之存储&CDN专场分享会
- Data interpretation! Ideal L9 sprints to "sell more than 10000 yuan a month" to grab share from BBA
猜你喜欢

国家邮政局等三部门:加强涉邮政快递个人信息安全治理,推行隐私面单、虚拟号码等个人信息去标识化技术

蚂蚁获FinQA竞赛冠军,在长文本数值推理AI技术上取得突破

ASM文件系统 数据如何写和读数据
SQL语句中EXISTS的详细用法大全

Save: software analysis, verification and test platform

The Sandbox 归属周来啦!

Section 29 basic configuration case of Tianrongxin topgate firewall

Ambire 指南:Arbitrum 奥德赛活动开始!第一周——跨链桥

百万消息量IM系统技术要点分享
PostgreSQL怎么创建分区表详解
随机推荐
Discussion: will low code integrated oa/erp/mes system be an important part of enterprise application ecology?
Ambire 指南:Arbitrum 奥德赛活动开始!第一周——跨链桥
How to use data warehouse to create time series
Production of labels for table products
The old CVM of Tencent cloud is migrated to the new CVM, and the IP remains unchanged
Operation and maintenance failure experience sharing
MySQL数据库配置信息查看与修改方法详解
What are the application flow restrictions of API gateway framework?
Ant group's self-developed tee technology has passed the national financial technology product certification
Section 30 high availability (HA) configuration case of Tianrongxin topgate firewall
sql server常用sql
百万消息量IM系统技术要点分享
Mysql中的触发器定义及语法介绍
Summary of cloud native pipeline tools
混沌工程,了解一下
PHP时间戳
新股民怎样炒股票开户?在线开户安全么?
What are the steps required for TFTP to log in to the server through the fortress machine? Operation guide for novice
Ant won the finqa competition champion and made a breakthrough in AI technology of long text numerical reasoning
C#/VB. Net word to text