AbstractMethodError on UriBuilder when upgrading Jersey client 1.x to 2.x

醉酒当歌 提交于 2019-12-05 14:21:15

I've found that the enunciate library depends somehow on jersey 1.1.7. This caused parts of my code to compile fine while it was still depending on 1.1.7 API's.

I found it by doing a find:

find . -name *.pom -exec grep -Hn jersey {} \;

...in the ~/.m2 folder on jersey. This can only be done if your app is the only one using maven on your machine.

When you see this error, it means UriBuilder is being loaded from other libraries like cxf-2.1.3.jar. Just rename it to z-cxf-2.1.3.jar. It should work fine.In maven find which dependency is bring the jar and use something like this

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