Class' org.springframework.http.converter.json.MappingJackson2HttpMessageConverter'未找到

时间:2015-05-23 17:13:25

标签: spring spring-mvc jackson

我在servlet-context.xml中收到以下错误。我是following the following tutorial to get this done

  

此行找到多个注释:      - Class' org.springframework.http.converter.json.MappingJackson2HttpMessageConverter'   未找到      - Class' org.springframework.http.converter.json.MappingJackson2HttpMessageConverter'   找不到[config set:myapp / web-context]

<!-- Configure bean to convert JSON to POJO and vice versa -->
<beans:bean id="jsonMessageConverter" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
</beans:bean> 

1 个答案:

答案 0 :(得分:0)

你必须在类路径中添加spring-web.jar,或者如果你使用的是maven,那么你应该添加以下依赖项:

<dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>X.Y.Z.RELEASE</version>
</dependency>