@FormDataParam throws SEVERE: Missing dependency

前端 未结 3 1751
面向向阳花
面向向阳花 2021-01-15 11:20

I am using Jersey to upload file. I defined the method:

@POST
@Path(\"/upload\")
@Consumes(\"multipart/form-data\")
public Collection uploadIm         


        
相关标签:
3条回答
  • 2021-01-15 11:27

    Thanks @john 4d5 People please ensure that all the jars version are in sync You can find all the possible jars here. :) https://maven.java.net/index.html#welcome

    0 讨论(0)
  • 2021-01-15 11:41

    You need to add Maven dependencies related to Multipart handling.

        <dependency> <!-- choose your version -->
            <groupId>org.jvnet</groupId>
            <artifactId>mimepull</artifactId>
            <version>1.6</version>
        </dependency>
        <dependency> <!-- choose your version -->
            <groupId>com.sun.jersey.contribs</groupId>
            <artifactId>jersey-multipart</artifactId>
            <version>1.18.1</version>
        </dependency>
    

    If you need check http://mvnrepository.com/ for the versions of the dependencies for your Jersey version.

    0 讨论(0)
  • 2021-01-15 11:44

    Make sure all libs are the same version (e.g. 1.13), and don't forget to add mimepull.jar and jersey-multipart.jar as well.

    0 讨论(0)
提交回复
热议问题