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 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-26
  • 2021-09-16
  • 2021-07-07
  • 2021-06-26
  • 2021-04-16
猜你喜欢
  • 2022-12-23
  • 2021-07-05
  • 2022-01-18
  • 2021-05-12
  • 2021-06-29
相关资源
相似解决方案