Tag Archives: Springboot project startup error

[Solved] Springboot Project Startup Error: Unable to Identify bootstrap.yml Configuration

Question

The springboot project I built myself reports an error when I start the project, but I can’t find the relevant configuration information. It is clearly configured in bootstrap.yml , and the application.yml I have been using before. Thinking that the priority of application.yml is not as high as that of bootstrap.yml, the bootstrap configuration file is definitely fine. , the result is that the project can’t live or die.

reason
The SpringBoot project will only recognize application.* configuration files, and will not automatically recognize bootstrap.yml.
The bootstrap.yml configuration is only used in the SpringCloud project. If you want to use the bootstrap.yml in the springboot project, then you need to add the bootstrap starter.

Add bootstrap initiator

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>

Since SpringCloud is built on SpringBoot, all SpringCloud projects are identified by both kinds of files, and it is only at this time that there is a priority statement that SpringCloud projects are given priority to read bootstrap configuration in reading application configuration.
SpringCloud applications are run based on the context of bootstrap.

[Solved] SpringBoot Project Startup Error: Field userMapper in com.demo.controller.MemberController required a bean of type ‘c

Error:
SpringBoot Project Startup Error: ‘com.xxx.mapper.XxxxMapper’ that could not be found

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


Description:
Field userMapper in com.demo.controller.MemberController required a
bean of type ‘com.demo.mapper.UserMapper’ that could not be found.
Action:
Consider defining a bean of type ‘com.demo.mapper.UserMapper’ in your
configuration.
Process finished with exit code 1

Reason: Cound not scan to find the mapper

Solution: Add @MapperScan("com.demo.mapper") in startup

Error starting ApplicationContext. To display the auto-configuration report re-run your application

Error starting ApplicationContext. To display the auto-configuration report re-run your application with ‘debug’ enabled

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2019-09-08 02:07:28.798 ERROR 10540 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

Cannot determine embedded database driver class for database type NONE

Action:

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).


Process finished with exit code 1

When the springboot project is started, no error is reported, but it will be terminated automatically later. View POM file

       <!-- spring boot Integration mybatis -->
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>1.3.0</version>
        </dependency>

        <!-- MySQL -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>

The solution: in the pom.xml Remove database related dependencies (MySQL connection)- java.jar,  mybatis.xxx.jar, PageHelper, database connection pool, etc.)

There must be a default configuration file, if any. Such as database connection configuration.