Java CXF 3.1.12无法创建安全的XMLInputFactory

Java CXF 3.1.12无法创建安全的XMLInputFactory,java,cxf,build.gradle,woodstox,Java,Cxf,Build.gradle,Woodstox,我在使用SoapUI发送请求时遇到“无法创建安全的XMLInputFactory”错误,我尝试了上面提到的stackoverflow解决方案,如添加woodstox和stax2 api,但问题仍然存在 从build.gradle: compile 'org.codehaus.woodstox:woodstox-core-asl:4.4.1' compile 'org.codehaus.woodstox:stax2-api:4.0.0' compile 'org.apache.cxf:cxf-r

我在使用SoapUI发送请求时遇到“无法创建安全的XMLInputFactory”错误,我尝试了上面提到的stackoverflow解决方案,如添加woodstox和stax2 api,但问题仍然存在

从build.gradle:

compile 'org.codehaus.woodstox:woodstox-core-asl:4.4.1'
compile 'org.codehaus.woodstox:stax2-api:4.0.0'

compile 'org.apache.cxf:cxf-rt-frontend-jaxws:3.1.12'
compile 'org.apache.cxf:cxf-rt-ws-security:3.1.12'
compile 'org.apache.cxf:cxf-rt-transports-http:3.1.12'
它以前使用woodstox core,但开始抛出错误

compile 'com.fasterxml.woodstox:woodstox-core:5.0.3'
从以前版本3的解决方案来看,CXF甚至不需要woodstox,我也尝试过不使用woodstox

它可能是像axis2一样更新的任何其他依赖项吗? 我下一步要做什么才能找到答案?谢谢


注意:使用tomcat 8.5.19可以找到解决方案,正如有人提到的,在SaxUtils.java中有一个

factory = XMLInputFactory.newInstance();
我们可以从装载的地方看到

axis2中实际上存在冲突,因此排除了neethi

compile('org.apache.axis2:axis2-transport-http:1.5.1') {
    exclude group: 'javax.servlet', module: 'servlet-api'
    exclude module: 'XmlSchema'
    exclude group: 'org.apache.neethi', module: 'neethi'
    exclude group: 'org.codehaus.woodstox'
}
runtime ('org.apache.axis2:axis2-transport-local:1.5.1'){
    exclude group: 'org.codehaus.woodstox', module: 'wstx-asl'
}

冲突已经消失。

我想与“dotmindlabs”确认Axis2的问题。在实现ApacheCXF3.2.1时,我还使用了Axis2中的一些包。我遇到了同样的问题“无法创建安全的XMLInputFactory”

这个问题完全与Axis2实现的附加库有关

我在下面提供了解决此问题所需的依赖项(Maven)更改

  <!-- https://mvnrepository.com/artifact/org.apache.axis2/axis2-transport-http -->
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-transport-http</artifactId>
        <version>1.6.2</version>
        <exclusions>
            <exclusion>
                <groupId>org.apache.ws.commons.schema</groupId>
                <artifactId>XmlSchema</artifactId>
            </exclusion>
            <exclusion>
                <groupId>javax.servlet</groupId>
                <artifactId>servlet-api</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.neethi</groupId>
                <artifactId>neethi</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.codehaus.woodstox</groupId>
                <artifactId>wstx-asl</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

org.apache.axis2
axis2传输http
1.6.2
org.apache.ws.commons.schema
XmlSchema
javax.servlet
servlet api
org.apache.neethi
尼西
org.codehaus.woodstox
wstx asl
我希望这能帮助将来遇到这个问题的人