java.lang.IllegalStateException: StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[] failed to start
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:125) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:87) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:437) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:191) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:180) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:153) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
... 8 common frames omitted
Caused by: java.lang.IllegalStateException: StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[] failed to start
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.rethrowDeferredStartupExceptions(TomcatWebServer.java:170) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:109) ~[spring-boot-2.2.8.RELEASE.jar:2.2.8.RELEASE]
... 13 common frames omitted
SpringBoot項(xiàng)目可以正常啟動(dòng),但是一添加@EnableEurekaServer相關(guān)注解再啟動(dòng)SpringBoot就報(bào)如上錯(cuò)誤。我是因?yàn)橛袃蓚€(gè)jdk版本,一個(gè)8一個(gè)17.
從根本原因可以看出是SpringBoot的內(nèi)嵌Tomcat報(bào)錯(cuò),這是因?yàn)镴dk的版本可能和SpringBoot版本不兼容。首先降低SpringBoot版本,用2.7.6或者2.2.8.RELEASE
再看自己的配置的jdk是否和項(xiàng)目的jdk版本一致?
?
?
?
?
?
最后編輯配置?
?
?
?然后重啟idea,重新加載下maven就好了!文章來源:http://www.zghlxwxcb.cn/news/detail-700400.html
?文章來源地址http://www.zghlxwxcb.cn/news/detail-700400.html
到了這里,關(guān)于SpringBoot項(xiàng)目配置Eureka時(shí),內(nèi)嵌TomCat無法啟動(dòng)java.lang.IllegalStateException: StandardEngine[Tomcat].Standa的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!