需要注意的是ComponentScan 不能扫描 org.springframework 否则会报错,要扫描指定的package才行 转载于:https://www.cnblogs.com/JAYIT/p/6899169.html