在网上找了半天都没解决,最后才发现是springMvc配置类
@EnableWebMvc这个注解被我注释掉了
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@Configuration
@ComponentScan({"com.hncj.controller", "com.hncj.config"})
@EnableWebMvc
public class SpringMvcConfig {
}
这玩意是真坑,Junit测试的时候要注释掉才能测试service,在Tomcat上部署时得打开才行


![No converter for [class XXX] with preset Content-Type ‘null‘ No converter for [class XXX] with preset Content-Type ‘null‘](http://www.mshxw.com/aiimages/31/1040748.png)
