This error can be solve by these tricks .
1. use @EnableWebMvc with spring 4.0 or above.
@Controller
@EnableWebMvc
@RequestMapping(value = "/articles/action", produces="application/json")
public class UserController {
}
2. use produces="application/json" in @RequestMapping
3. add these dependency or jar if missing
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.2.3</version>
</dependency>
1. use @EnableWebMvc with spring 4.0 or above.
@Controller
@EnableWebMvc
@RequestMapping(value = "/articles/action", produces="application/json")
public class UserController {
}
2. use produces="application/json" in @RequestMapping
3. add these dependency or jar if missing
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.2.3</version>
</dependency>