《The type org.springframework.http.converter.HttpMessageConverter cannot be resolved. It is indirectly referenced from required .class files解决方案》
最近在研读《spring in action》,在配置springMVC的时候,在package的地方出现了这个错误提示,The type org.springframework.http.converter.HttpMessageConverter cannot be resolved. It is indirectly referenced from required .class files,,详细内容是Multiple markers at this line
- The type org.springframework.web.method.support.HandlerMethodReturnValueHandler cannot be resolved. It is indirectly
referenced from required .class files
- The type org.springframework.web.method.support.HandlerMethodArgumentResolver cannot be resolved. It is indirectly referenced
from required .class files
- The type org.springframework.http.converter.HttpMessageConverter cannot be resolved. It is indirectly referenced from
required .class files
翻译如下
在该行多个标记
- 类型org.springframework.web.method.support.HandlerMethodReturnValueHandler不能得到解决。这是间接地
从所需的.class文件引用
- 类型org.springframework.web.method.support.HandlerMethodArgumentResolver不能得到解决。它是间接引用
从所需的.class文件
- 类型org.springframework.http.converter.HttpMessageConverter不能得到解决。它是间接引用
所需的.class文件
开始我也纠结了一会,但经过我机智的分析,我觉着是jar包缺失问题,但一般的jar包缺失都会直接提示某个类找不到,从而导致编译不通过,但我推测是我引用的jar包依赖与另外一个jar包,所以没用显示的报类not find错误。
解决方案:引入jar包spring-web-4.1.1.RELEASE.jar这个错误就解决掉了。