After googling a little I end up reviewing some interesting cases, such as Failed unmarshalling issue with @FormParam, or Missing mulipart JAR dependency issue the most aproximate post for my problem was this: "Missing dependecy for method", which I answer with a link to this POST, as I see no currenty solution for that particular one.
The issue appeared to be related to the @FormDataParam
annotation, when used with the method-level @Consumes
annotation with the value MediaType.APPLICATION_FORM_URLENCODED
.
When I changed the Method signature to annotate each plain-text field with @FormParam
, the exception was gone. Check the fixed code below:
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Path("/local")
public Response specifyLocalFile()
@FormParam("file") String fullFilePath,
@FormParam("param1") String param1,
@FormParam("param2") String param2,
@FormParam("param3") String param3) {
....
If the type of the data being received does not have to deal with MIME-encodings, the @FormParam
annotation will attempt to deal with the contents via serialization; in contrast, the @FormDataParam
annotation requires some specific handling that is configured when the @Consumes
annotation has the MediaType.MULTIPART_FORM_DATA
. Hope this helps.