当前位置:网站首页>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请求不报错。
边栏推荐
- Consequences of website construction without SSL authentication are websites without SSL authentication reliable
- C#/VB.NET Word转Text
- Application of clock synchronization system in banking system
- Docker中部署Redis集群与部署微服务项目的详细过程
- 生鲜前置仓的面子和里子
- Slsa: accelerator for successful SBOM
- How to access the top-level domain name and automatically jump to the secondary domain name?
- Debian change source and uninstall useless services
- Section 30 high availability (HA) configuration case of Tianrongxin topgate firewall
- Face and lining of fresh food pre storage
猜你喜欢
随机推荐
How to set the website construction title bar drop-down
The technical design and practice of decrypting the red envelopes of Tiktok Spring Festival
新股民怎样炒股票开户?在线开户安全么?
Three ways to enable IPv6 on Tencent cloud
Ant won the finqa competition champion and made a breakthrough in AI technology of long text numerical reasoning
2022云顾问技术系列之存储&CDN专场分享会
Deserialization - PHP deserialization
Urgent! Tencent cloud container security supports the detection of Apache log4j2 vulnerabilities for the first time. It is in free trial
Industry 4.0 era: the rise of low code may bring about changes in the pattern of manufacturing industry
What are the processes, levels, stages and key points of requirements analysis in software development
Go language core 36 lectures (go language practice and application 25) -- learning notes
混沌工程,了解一下
How to set ulimit value for SYSTEMd service in easycvr?
2021-12-10: which can represent a 64 bit floating point number or a 64 bit signed integer
C#/VB.NET Word转Text
Notes to nodejs (III)
The national post office and other three departments: strengthen the security management of personal information related to postal express delivery, and promote the de identification technology of per
How to use FTP to upload websites to the web
sql server常用sql
专业“搬砖”老司机总结的 12 条 SQL 优化方案,非常实用!








