免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
spring boot啟動報Unable to start EmbeddedWebApplicationContext問題解決方案

異常全文如下:

  1. org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.  
  2.     at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137) ~[spring-boot-1.4.4.RELEASE.jar:1.4.4.RELEASE]  
  3.     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:536) ~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE]  
  4.     at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.4.4.RELEASE.jar:1.4.4.RELEASE]  
  5.     at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) [spring-boot-1.4.4.RELEASE.jar:1.4.4.RELEASE]  
  6.     at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:372) [spring-boot-1.4.4.RELEASE.jar:1.4.4.RELEASE]  
  7.     at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-1.4.4.RELEASE.jar:1.4.4.RELEASE]  
  8.     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1187) [spring-boot-1.4.4.RELEASE.jar:1.4.4.RELEASE]  
  9.     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1176) [spring-boot-1.4.4.RELEASE.jar:1.4.4.RELEASE]  
  10.     at com.travelsky.srd.tcldp.SrdTcldpApplication.main(SrdTcldpApplication.java:10) [classes/:na]  
  11. Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.  
  12.     at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:189) ~[spring-boot-1.4.4.RELEASE.jar:1.4.4.RELEASE]  
  13.     at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:162) ~[spring-boot-1.4.4.RELEASE.jar:1.4.4.RELEASE]  
  14.     at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) ~[spring-boot-1.4.4.RELEASE.jar:1.4.4.RELEASE]  
  15.     ... 8 common frames omitted  
大概意思就是不能啟動containerFactory,初始化容器失敗。

異常原因剖析:

經(jīng)過一系列的debug,發(fā)現(xiàn)是由于使用的CXF多引了一個包導(dǎo)致的,該包如下:

  1. <!-- Jetty is needed if you're are not using the CXFServlet -->  
  2.         <dependency>  
  3.             <groupId>org.apache.cxf</groupId>  
  4.             <artifactId>cxf-rt-transports-http-jetty</artifactId>  
  5.             <version>${cxf.version}</version>  
  6.         </dependency>  
引入這個包后,當(dāng)spring boot啟動的時候,發(fā)現(xiàn)classpath下存在Jetty的jar包,于是推測我們要使用的容器不是默認(rèn)的tomcat而是jetty,于是使用jetty容器,但是在初始化jetty容器的時候,卻由于在spring boot中沒有加入jetty starter導(dǎo)致一些jetty容器依賴的某些jar包環(huán)境又不存在,最終導(dǎo)致初始化容器失敗。

異常解決方法:

1、刪除導(dǎo)致spring boot可能認(rèn)為不使用默認(rèn)容器的jar包,上例中可以刪除依賴的jetty的jar包

2、在spring boot中加入spring-boot-starter-jetty,明確我們想使用什么容器,不要讓spring boot引起誤會和錯誤的可能猜測

通過上面的幾個步驟,異常問題解決了,spring boot可以正常啟動!

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
spring 包的使用
規(guī)則引擎Drools動態(tài)加載規(guī)則
Spring Boot的Maven插件Spring Boot Maven plugin詳解
Spring Boot(一)—— Spring Boot入門
SpringBoot+SpringSecurity誤攔截靜態(tài)資源問題調(diào)研
面試官:為什么 SpringBoot 的 jar 可以直接運行?
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服