Below is my code when the same error occurred. I have VelocityViewResolver as my viewResolver. But in a weird situation, the error occurs when I have my security context enabled. But it works perfectly when security context is commented out.
Code:
@PreAuthorize("hasAuthority('PERM_DOCTORS_NOTES_CREATE')")
@RequestMapping(value = "/patient/{pin}/doctors-notes/action", method = RequestMethod.POST, params = "draftBtn")
ModelAndView saveDraft(@PathVariable("pin") long pin,
@RequestParam(value = "formKey") String formKey,
@ModelAttribute(WebFormSupport.FORM_NAME) FormResultDto formResult, BindingResult result,
HttpSession httpSession, HttpServletRequest request);
Code:
Handler execution resulted in exception org.springframework.web.bind.annotation.support.HandlerMethodInvocationException: Failed to invoke handler method [public abstract org.springframework.web.servlet.ModelAndView com.tmc.emr.web.template.docnotes.controller.DoctorsNotesActionController.saveDraft(long,java.lang.String,com.tmc.emr.workflow.model.FormResultDto,org.springframework.validation.BindingResult,javax.servlet.http.HttpSession,javax.servlet.http.HttpServletRequest)]; nested exception is java.lang.IllegalStateException: No parameter name specified for argument of type [java.lang.String], and no parameter name information found in class file either.
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:181)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)