Error creating bean with name ‘resourceHandlerMapping‘ defined in class path resource

Error creating bean with name 'resourceHandlerMapping' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set

这个问题是spring整合时出现,由于springconfig配置类意外扫描springMvcConfig配置类导致的,可以通过包扫描范围解决。

Error creating bean with name ‘resourceHandlerMapping‘ defined in class path resource_第1张图片

 

你可能感兴趣的:(学习笔记,Java,servlet,spring,java)