1、 Background description
Project architecture: spring boot (v2.0.0. Release) + mybatis plus (v3.1.1)
Today, I developed a new function on an old project (running normally). Before adding new functions, the project started and ran normally. As a result, after the development, the project couldn’t start and the background didn’t report any error information. The key is that I didn’t even have a log. For a moment, I couldn’t start it.
2、 Cause analysis
According to the situation analysis, the project can’t be started. Thinking that there must be a problem in starting, a try… Catch… Block is added to the line of starting the project in the starting class (that is, the following code plus).
SpringApplication.run(DailyApplication.class, args);
See if there is an error log.
@Slf4j
@EnableScheduling
@EnableFeignClients(basePackages = "com.iot")
@SpringBootApplication(scanBasePackages={"com.iot"})
@MapperScan({"com.iot.daily.*.dao"})
public class DailyApplication implements ApplicationRunner {
public static void main(String[] args) {
try {
SpringApplication.run(DailyApplication.class, args);
} catch (Exception e) {
e.printStackTrace();
log.error("error: ============== ", e);
}
}
@Override
public void run(ApplicationArguments args) throws Exception {
log.info("The daily report system was successfully launched!......");
}
}
Start the project, and then, as expected, the console displays the error log with the following error message:
Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
The specific error information will be supplemented later, but now it can’t be reproduced.
3、 Solutions
Here is my project solution, very simple, Maven clean once, and then restart.
end!