Servlet.init() for servlet [dispatcherServlet] threw exception

控制台输出的错误信息如下:

[ERROR] [RMI TCP Connection(14)-127.0.0.1] [org.springframework.web.servlet.FrameworkServlet-initServletBean:534] [Context initialization failed]
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'departmentController': Unsatisfied dependency expressed through field 'departmentService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'departmentServiceImpl': Unsatisfied dependency expressed through field 'departmentMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'departmentMapper' defined in file [D:\Maven\maven\maven-spring-mybatis-mvc\target\maven-spring-mybatis-mvc-1.0-SNAPSHOT\WEB-INF\classes\com\atguigu\mybatis\mapper\DepartmentMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/spring-persist.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [mappers/*.xml]: ServletContext resource [/mappers/] cannot be resolved to URL because it does not exist

img

看报错应该是你的mybatis配置不对导致的,检查你的这个配置 mapperLocations