CXF2.2.4版本升級到2.5.2+配置問題


1、pom文件依賴

<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>ec-cxf</groupId>
<artifactId>cxf</artifactId>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.neethi</groupId>
<artifactId>neethi</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>stax2-api</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-asl</artifactId>
<version>4.1.1</version>
</dependency>
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
<version>1.6.2</version>
</dependency>
 
<dependency>    <groupId>org.apache.ws.xmlschema</groupId>    <artifactId>xmlschema-core</artifactId>    <version>2.0.1</version></dependency><dependency>    <groupId>xml-resolver</groupId>    <artifactId>xml-resolver</artifactId>    <version>1.2</version></dependency>
2.與Spring整合問題
Caused by: org.apache.cxf.ws.policy.PolicyException: These policy alternatives can not be satisfied: {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}SupportingTokens{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken at org.apache.cxf.ws.policy.AssertionInfoMap.checkEffectivePolicy(AssertionInfoMap.java:166) at org.apache.cxf.ws.policy.PolicyVerificationInInterceptor.handle(PolicyVerificationInInterceptor.java:101)
3、解決方法
esb-server.xml配置增加
<cxf:bus>    <cxf:properties>        <entry key="org.apache.cxf.message.Message.ENCODING" value="UTF-8"/>    </cxf:properties>    <cxf:features>        <cxf:logging/>        <p:policies enabled="false" />    </cxf:features></cxf:bus>

新增
<p:policies enabled="false" />
可以去掉驗證 P命名空間:
xmlns:p="http://cxf.apache.org/policy"






注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
粤ICP备14056181号  © 2014-2021 ITdaan.com