springboot jar打包部署linux 出现 org.springframework.context.ApplicationContextException: Unable to start web server; nested excep...

 

 

解决办法:

1. 在pom.xml中必须添加依赖

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

2.启动类上必须添加注解@Controller

3.启动类上必须添加注解@EnableAutoConfiguration 和 @SpringBootApplication 

posted @ 2021-10-12 16:36  随★风  阅读(397)  评论(0编辑  收藏  举报