Spring Boot应用程序-406 Not Acceptable错误,在本地运行正常,但在AWS上部署时却无法运行

时间:2018-07-30 14:49:33

标签: java amazon-web-services spring-boot elastic-beanstalk

我正在将War文件部署在AWS Elastic BeanStalk上。

@GetMapping(path = "/getDashboardScreenValues/{emailId:.+}", produces = MediaType.APPLICATION_JSON_VALUE)
@PreAuthorize("#emailId == authentication?.name")
@ResponseBody
public SuccessResponseArray getdashBoardDetails(@PathVariable(value = "emailId") String emailId) {
    // List<String> vehicleList = null;

        List<DashboardDto>  dashboardDtoList = null;
        SuccessResponseArray successResponse = new SuccessResponseArray();
        dashboardDtoList = dashboardScreenService.getdashboardDisplayDetails(emailId);
        successResponse.setHttpStatus(200);
        successResponse.setTimeStamp(FiksUtility.getIstTime());
        successResponse.setMessage(dashboardDtoList);
        return successResponse;

也尝试了以下但相同的错误。

@GetMapping(path = "/getDashboardScreenValues/{emailId:.+}", produces = MediaType.APPLICATION_JSON_VALUE)
@PreAuthorize("#emailId == authentication?.name")
public ResponseEntity<SuccessResponseArray> getdashBoardDetails(@PathVariable(value = "emailId") String emailId) {
    // List<String> vehicleList = null;

        List<DashboardDto>  dashboardDtoList = null;
        SuccessResponseArray successResponse = new SuccessResponseArray();
        dashboardDtoList = dashboardScreenService.getdashboardDisplayDetails(emailId);
        successResponse.setHttpStatus(200);
        successResponse.setTimeStamp(FiksUtility.getIstTime());
        successResponse.setMessage(dashboardDtoList);

        return ResponseEntity.status(HttpStatus.ACCEPTED).contentType(MediaType.APPLICATION_JSON)
           .body(successResponse);
}

我正在通过邮递员检查。请帮助

0 个答案:

没有答案