Java error invaliddefinitionexception

Scenario: this error occurs when transferring parameters between springcloud and seat microservices. A service has the function of uploading files,

Service B needs to call the upload file interface of service A. there is a common parent class reference C between a and B.

The method defined in C is

@RequestMapping(“/file/upload”) public R uploadFile(MultipartFile file);

The method defined in a is

@RequestMapping(“/file/upload”) public R uploadFile(MultipartFile file){ … }

Call statements defined in B

b.uploadFile(file);

After writing in this way, report an error, such as the title

Add the annotation @ requestparam before the request parameter file in methods a and C.

 


Read More: