maven jersey-multipart缺少对javax.ws.rs.core.Response的依赖 [英] Maven jersey-multipart missing dependency for javax.ws.rs.core.Response

查看:2077
本文介绍了maven jersey-multipart缺少对javax.ws.rs.core.Response的依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎缺少依赖但无法找到解决方案......
我确保所有球衣版本都与答案相同这里

I seem to have a missing dependency but can't find the solution... I've made sure all jersey versions are identical as answered here.

错误:

  SEVERE: The following errors and warnings have been detected with resource and/or provider classes:
  SEVERE: Missing dependency for method public abstract javax.ws.rs.core.Response com.service.copy(java.io.InputStream,com.sun.jersey.core.header.FormDataContentDisposition) at parameter at index 0

使用的依赖关系:

<dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-servlet</artifactId>
        <version>1.17</version>
    </dependency>
    <dependency>
        <groupId>com.sun.jersey.contribs</groupId>
        <artifactId>jersey-multipart</artifactId>
        <version>1.17</version>
    </dependency>
    <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-json</artifactId>
        <version>1.17</version>
    </dependency>
    <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-bundle</artifactId>
        <version>1.17</version>
    </dependency> 

    <dependency>
            <groupId>org.jvnet</groupId>
        <artifactId>mimepull</artifactId>
        <version>1.6</version>
    </dependency>

错误发生的代码:

@POST
@Path("copy")
public Response copy(@FormDataParam("file") InputStream uploadedInputStream,
            @FormDataParam("file") FormDataContentDisposition fileDetail);

任何想法?
非常感谢,
Frank

Any ideas? Thanks a lot in advance, Frank

推荐答案

是的找到它了!

显然依赖关系没问题。

将这些添加到我的导入

import javax.ws.rs.Consumes;
import javax.ws.rs.core.MediaType;

并将代码更改为

@POST
@Path("copy")
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Response copy(@FormDataParam("file") InputStream uploadedInputStream,
            @FormDataParam("file") FormDataContentDisposition fileDetail);

现在突然一切正常!
所以希望我能帮助其他人解决同样的问题......

And now suddenly everything works! So hope I can help someone else with the same problem...

这篇关于maven jersey-multipart缺少对javax.ws.rs.core.Response的依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆