做爲一名剛開始使用idea的新手,最近在使用maven+springMVC框架時遇到了這樣一個問題:Could not autowire. No beans of ‘xxxMapper’ type found.
這是在實現xxxService接口時,自動注入xxxMapper時,出現的錯誤。
(╯‵□′)╯︵┴─┴java
package com.zm.mlog.service.impl;IDEA
import com.zm.mlog.mapper.AdminMapper;
import com.zm.mlog.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("adminService")
public class AdminServiceImpl implements AdminService {
@Autowired
private AdminMapper adminMapper;
}
看了好久的代碼,實在是沒發現問題。甚至把代碼拿到eclipes跑,沒問題。
┬─┬ ノ( ’ - ‘ノ) {擺好擺好)
(再掀一次} (╯°Д°)╯︵ ┻━┻
固然此時已經意識到不是代碼的問題,靈機一動一百度果真如此。(:з」∠)
好了不皮了,解決方法以下:
spring
解決方法來源於:http://blog.csdn.net/u012453843/article/details/54906905markdown