springBoot报错Unable to start embedded container; nested exception is org.springframework.context.Appl

时间:2024-04-03 10:39:50

今天楼主在做一个maven+springBoot的简单项目的时候,发现报了

Unable to start embedded container; nested exception is org.springframework.context.Appl....的错误,

经过上网查找,得到解决方案之一,现在分享给大家:

 springBoot报错Unable to start embedded container; nested exception is org.springframework.context.ApplspringBoot报错Unable to start embedded container; nested exception is org.springframework.context.Appl


修改后:

springBoot报错Unable to start embedded container; nested exception is org.springframework.context.Appl

总结:出现这个错误的原因是SpringApplication.run里面的.class文件的名字没有和本类的变量名相同,改过来即可