Jersey: “Missing dependency for method …”

橙三吉。 提交于 2019-12-05 14:24:29

remove

   <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-bundle</artifactId>
        <version>1.11</version>
   </dependency>

and you should be fine.

You are confusing Jersey by adding bundle and separate dependencies to the classpath. So basically you have two classes which have same name ("com.sun.jersey.core.util.FeaturesAndProperties" in this case), Jersey runtime expects one and you are providing second one.. or vice versa.

Anyway, you should be fine when jersey-bundle is removed from classpath.

I had experienced similar issue while dealing with multipart uploads. After bit searching and investigation, I figured out that I was using different version of jersey-multipart and mimepull jars which were not compatible with the jersey bundle used in my project.

If you are a non-maven developer, make sure that you have added following jars in your classpath:

  • jersey-multipart-X.jar
  • mimepull-Y.jar

X and Y are version identifiers for jersey-multipart and mimepull jars respectively.

*Note that X (version of jersey-multipart) should be same as the version of jersey-bundle jar.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!