2017-08-01 99 views
0

在使用SoapUI发送请求时,出现“无法创建安全的XMLInputFactory”错误,我尝试了一些提到的解决方案(如添加woodstox和stax2-api),但问题仍然存在CXF 3.1.12无法创建安全的XMLInputFactory

从的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核心工作过,但开始抛出从错误

compile 'com.fasterxml.woodstox:woodstox-core:5.0.3' 

预来自第3版CXF的vious解决方案甚至不需要woodstox,我也尝试过没有woodstox。

它可以像axis2更新任何其他依赖项? 我的下一步应该找出什么?感谢

注:使用Tomcat 8.5.19

回答

1

所以溶液中发现,在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' 
} 

冲突不见了。

0

我想用'dotmindlabs'确认Axis2的问题。在实现Apache CXF 3.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> 

我希望这可以帮助未来遇到这个问题的人。

相关问题