Java 执行文件上载rest web服务时缺少方法的依赖项

Java 执行文件上载rest web服务时缺少方法的依赖项,java,rest,jersey,Java,Rest,Jersey,我一直在试图了解如何修复此错误: SEVERE: Missing dependency for method public java.lang.String com.myrest.FileService.uploadFile(java.io.File,com.sun.jersey.core.header.FormDataContentDisposition) at parameter at index 0 SEVERE: Missing dependency for method public

我一直在试图了解如何修复此错误:

SEVERE: Missing dependency for method public java.lang.String com.myrest.FileService.uploadFile(java.io.File,com.sun.jersey.core.header.FormDataContentDisposition) at parameter at index 0 SEVERE: Missing dependency for method public java.lang.String com.myrest.FileService.uploadFile(java.io.File,com.sun.jersey.core.header.FormDataContentDisposition) at parameter at index 1 SEVERE: Method, public java.lang.String com.myrest.FileService.uploadFile(java.io.File,com.sun.jersey.core.header.FormDataContentDisposition), annotated with POST of resource, class com.myrest.FileService, is not recognized as valid resource method.
错误消息的最后一行使我认为您缺少JAR文件

class com.myrest.FileService, is not recognized as valid resource method.

但除此之外,我以前没有看到@FormDataParam被绑定到java.io.File,不确定框架是否可以将其反序列化到该对象。您是否尝试过反序列化到java.io.InputStream?另外,如果您使用Maven进行构建,那么请检查POM是否存在所有必需的依赖项。

在我的案例中,问题在于
jersey bundle
com.sun.jersey.contribs
的不同库版本;将两者设置为同一版本后,一切正常。

此处相同,我的多部分版本错误。谢谢!!
class com.myrest.FileService, is not recognized as valid resource method.