cxf + wss4j + maven NoSuchMethod error

送分小仙女□ 提交于 2019-12-01 03:30:34

CXF 3.0.0 does not work with WSS4J 1.6.15. You need to use WSS4J 2.0.0 instead.

Colm.

I too had the same issue. It resolved by using the dependency "wss4j-ws-security-common-2.0.3.jar"

For more detail on wss4j 2.0.0 migration, pl refer "http://ws.apache.org/wss4j/migration/wss4j20.html"

You can find the wss4j in another groupid in maven:

https://mvnrepository.com/artifact/org.apache.wss4j/wss4j/2.1.7

When you add the wss4j dependency make sure you add it as pom type, otherwise you will have an error. This sould be the dependency in your pom

    <dependency>
        <groupId>org.apache.wss4j</groupId>
        <artifactId>wss4j</artifactId>
        <version>2.1.7</version>
        <type>pom</type>
    </dependency>

Also make sure to specify the maven central repository so it can find it for sure:

   <repositories>
        <repository>
            <id>central</id>
            <url>http://central.maven.org/maven2/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>

Thats it.

Had the exact same problem. In my case, upgrading to wss4j 2.x.x didn't help. I had 2 overlapping dependencies and once I removed the redundant wss4j one and only relied on spring-ws-security, everything ran fine. The key thing is to use spring-ws-security 3.x.x and not 2.x.x. Issue was described here: https://jira.spring.io/browse/SWS-970

<dependency>
    <groupId>org.springframework.ws</groupId>
    <artifactId>spring-ws-security</artifactId>
    <version>3.0.1.RELEASE</version>
</dependency>

<dependency>
    <groupId>org.apache.ws.security</groupId>
    <artifactId>wss4j</artifactId>
<version>1.6.15</version>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!