After SpringBoot starts, exit the console directly and display Process finished with exit code 1

Problem Description:

When this problem occurs, there is no output from the console, and the process exits Process finished with exit code 1

problem solved:

Use try catch to catch the exception and find that there is still no log

public  static  void main( String [] args) {
        try {
            SpringApplication.run(ApiBdszApplication. class , args);
        } catch ( Exception e){
            e.printStackTrace();
        }
    }
But as a Java programmer with countless pits, we know that Exception is not the top exception class, so we replaced it with Throwable 

public  static  void main( String [] args) {
        try {
            SpringApplication.run(ApiBdszApplication. class , args);
        } catch ( Throwable e){
            e.printStackTrace();
        }
    }
At this time, except for the error content in the log printing, follow the log prompts to solve

At last

During the search for this problem, I read many online solutions, and finally came up with three solutions:
1. Use the above capture method
2. Check whether the springboot version and springcloud version match
3. Check whether you have written some configuration files wrong.

Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *