Your Java compiler does not store method parameter names in bytecode. Therefore, Spring cannot use reflection to match the value it receives in a request with a parameter of the method that should handle this request. To solve this problem, you can enable storing parameter names in bytecode using the -parameters compiler option. Or you can explicitly specify the name of the parameter to match in the @PathVariable("code") annotation.