可能原因: mapper.xml中没有加入namespacemapper.xml中的方法和接口mapper的方法不对应mapper.xml没有加入到mybatis-config.xml中(即总的配置文件)mapper.xml文件名和所写的mapper名称不相同。如果采用Dao层接口,则需在namespace中指定dao层接口的全限定类名,如未使用接口则指向mapper.xml文件