Low Error

2017-10-24  本文已影响0人  grace666

1. BeanCreationException

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userManagerController': Injection of autowired dependencies failed

tomcat catelina log中发现

org.mybatis.spring.mapper.ClassPathMapperScanner.doScan No MyBatis mapper was found in '[com.mmall.dao]' package. Please check your configuration.

解决:
applicationContext-datasource.xml 里配置mapperScannerConfigurer

    <bean name="mapperScannerConfigurer"  class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <property name="basePackage" value="com.mall.dao"/>
    </bean>

2. Could not open ServletContext resource [/WEB-INF/dispatcher-servlet.xml]

在maven项目中 web.xml和applicationContext.xml两个文件没放一起

 <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:applicationContext.xml</param-value>
        </init-param>
上一篇下一篇

猜你喜欢

热点阅读