CXF2.2.4版本升级到2.5.2+配置问题

来源:互联网 发布:coreldraw x6软件下载 编辑:程序博客网 时间:2024/06/03 23:00

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}UsernameTokenat 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"


阅读全文
0 0
原创粉丝点击