我是邮递员的新手。当我输入一些有关邮递员的信息时,下面出现错误;
{
"timestamp": "2018-08-28T07:18:24.540+0000",
"status": 500,
"error": "Internal Server Error",
"message": "Target object must not be null; nested exception is java.lang.IllegalArgumentException: Target object must not be null",
"path": "/userRight/create"
}
@RequestMapping(value = "userRight/create", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
// @Transactional(rollbackFor = Exception.class)
public ResponseEntity<CreateUserRightResponseType> createUserRight(@RequestBody CreateUserRightRequestType request)
throws UserRightException {
CreateUserRightResponseType response = new CreateUserRightResponseType();
try {
userRightService.createUserRight(request.getUserRightType());
response.setStatus(ResponseStatusCodes.SUCCESS);
return new ResponseEntity<>(response, HttpStatus.OK);
} catch (UserRightException e) {
response.setStatus(ResponseStatusCodes.ERROR);
response.setErrorMessage(e.getLocalizedMessage());
return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST);
}
}
}
有什么建议吗?