springboot运行时出现Unable to start web server问题的解决

springboot运行时出现Unable to start web server问题的解决

出先的问题是这样的:springboot运行时出现Unable to start web server问题的解决

对于这个问题自己查阅了很多人解决的方法,在这里做一份自己处理办法的总结:

基础的目录如下:springboot运行时出现Unable to start web server问题的解决
SpringApplication.run中的class文件的区别:

1.错误的使用方法: 在SpringApplication.run中用的是UserController.class文件:
springboot运行时出现Unable to start web server问题的解决

这样子不是正确的使用springboot的方法,如果想要这个运行的话需要在Usercontroller中添加一个@EnableAutoConfiguration注解:springboot运行时出现Unable to start web server问题的解决

  1. 正确的使用方法: 在SpringApplication.run中用的是App.class文件:
    springboot运行时出现Unable to start web server问题的解决
    这样的话就可以直接运行,不会出现这个问题了,进入网页:
    springboot运行时出现Unable to start web server问题的解决就可以正常运行了!!!