欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Error starting ApplicationContext. To display the conditions report re-run your application with ‘de

程序员文章站 2022-03-02 14:33:19
...

项目场景:Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.问题的解决

问题描述:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-10-02 13:18:49.964 ERROR 7280 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Field navigationMapper in com.test.littleapp.controller.NavigationController required a bean of type 'com.test.littleapp.mapper.NavigationMapper' that could not be found.

The injection point has the following annotations:
	- @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'com.test.littleapp.mapper.NavigationMapper' in your configuration.

解决方案:

在spring boot Application主文件下加上

@MapperScan("你的mapper包名")

Error starting ApplicationContext. To display the conditions report re-run your application with ‘de

package com.test.littleapp;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@MapperScan("com.test.littleapp.mapper")
public class LittleappApplication {
    public static void main(String[] args) {
        SpringApplication.run(LittleappApplication.class, args);
    }
}