当前位置:网站首页>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请求不报错。
边栏推荐
- Ant won the finqa competition champion and made a breakthrough in AI technology of long text numerical reasoning
- Analysis and application of ThreadLocal source code
- 新股民怎样炒股票开户?在线开户安全么?
- TDD开发模式流程推荐
- Start learning simple JS
- Micro build low code tutorial -hello, world
- Docker中部署Redis集群与部署微服务项目的详细过程
- Data interpretation! Ideal L9 sprints to "sell more than 10000 yuan a month" to grab share from BBA
- Payment industry tuyere project: smart digital operation 3.0
- CS5213 HDMI转VGA带音频信号输出方案
猜你喜欢
PostgreSQL怎么创建分区表详解

C#/VB.NET Word转Text

百万消息量IM系统技术要点分享

【技术干货】蚂蚁办公零信任的技术建设路线与特点

FANUC机器人SRVO-050碰撞检测报警原因分析及处理对策(亲测可用)

Face and lining of fresh food pre storage
Detailed process of deploying redis cluster and micro service project in docker

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

ASM文件系统 数据如何写和读数据
随机推荐
sql server常用sql
How to build a business analysis system
What is the was fortress server restart was command? What are the reasons why was could not be restarted?
Docker中部署Redis集群与部署微服务项目的详细过程
Postman可以集成到CI,CD流水线中做自动化接口测试吗?
What is the API gateway architecture? What are the common gateway types?
How to access the top-level domain name and automatically jump to the secondary domain name?
Consequences of website construction without SSL authentication are websites without SSL authentication reliable
What is the development prospect of face recognition technology?
Go language core 36 lectures (go language practice and application 25) -- learning notes
2022 cloud consulting technology series storage & CDN special sharing meeting
Notes to nodejs (III)
Performance test - LoadRunner obtains the return value and user-defined parameters (parameter operation)
Deserialization - PHP deserialization
How to use phpMyAdmin to restore a backed up MySQL database
How to set up links for website construction how to build a website
Log4j has been exposed to a nuclear bomb level vulnerability, and the developer has fried the pot!
Talk about the problems and solutions of IT enterprise fixed assets management system
Remember a compose version of Huarong Road, you deserve it!
Ranking of high cost performance commercial endowment insurance products in 2022