国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

搭建nacos集群啟動時,報錯Unable to start web server; nested exception is org.springframework.boot.web.server

這篇具有很好參考價值的文章主要介紹了搭建nacos集群啟動時,報錯Unable to start web server; nested exception is org.springframework.boot.web.server。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

最近在學(xué)習(xí)springcloud阿里巴巴的使用,單機(jī)使用nacos啟動時沒有問題,修改了配置之后啟動報錯,如下

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:156)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204)
	at com.alibaba.nacos.Nacos.main(Nacos.java:35)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:107)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
	at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:467)
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:124)
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:86)
	at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:416)
	at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:180)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:180)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:153)
	... 16 common frames omitted

貼出已經(jīng)修改的配置文件,cluster.conf和application.properties

cluster.conf如下

#2022-09-09T17:19:05.745
127.0.0.1:8845
127.0.0.1:8846
127.0.0.1:8847

application.properties如下,其他不需要修改的地方?jīng)]有復(fù)制進(jìn)來

#*************** Spring Boot Related Configurations ***************#
### Default web context path:
server.servlet.contextPath=/nacos
### Default web server port:
server.port=8845

#*************** Network Related Configurations ***************#
### If prefer hostname over ip for Nacos server addresses in cluster.conf:
# nacos.inetutils.prefer-hostname-over-ip=false

### Specify local server's IP:
# nacos.inetutils.ip-address=


#*************** Config Module Related Configurations ***************#
### If use MySQL as datasource:
spring.datasource.platform=mysql

### Count of DB:
# db.num=1

### Connect URL of DB:
db.url.0=jdbc:mysql://127.0.0.1:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user.0=root
db.password.0=password

### Connection pool configuration: hikariCP
db.pool.config.connectionTimeout=30000
db.pool.config.validationTimeout=10000
db.pool.config.maximumPoolSize=20
db.pool.config.minimumIdle=2

因為是看著視頻一步一步改的,然后視頻里老師成功了,我運行失敗了,網(wǎng)上找了很多地方都沒有解答,都是說把集群改成單機(jī)啟動就可以了,但是我要的就是集群啟動。然后看了一下nacos.log的最后幾行日志,提示jdbc連接有問題,如下

Caused by: java.lang.RuntimeException: java.lang.RuntimeException: [db-load-error]load jdbc.properties error
	at com.alibaba.nacos.config.server.service.datasource.DynamicDataSource.getDataSource(DynamicDataSource.java:58)
	at com.alibaba.nacos.config.server.service.repository.extrnal.ExternalStoragePersistServiceImpl.init(ExternalStoragePersistServiceImpl.java:138)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:363)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:307)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)
	... 158 common frames omitted
Caused by: java.lang.RuntimeException: [db-load-error]load jdbc.properties error
	at com.alibaba.nacos.config.server.service.datasource.ExternalDataSourceServiceImpl.init(ExternalDataSourceServiceImpl.java:107)
	at com.alibaba.nacos.config.server.service.datasource.DynamicDataSource.getDataSource(DynamicDataSource.java:53)
	... 166 common frames omitted

方向確認(rèn),進(jìn)mysql測試url賬號密碼一切正常,但是發(fā)現(xiàn)配置文件有個容易忽略的地方?jīng)]有修改,相信細(xì)心的同學(xué)已經(jīng)發(fā)現(xiàn)了,就是application.properties中的Count of DB,如下

### Count of DB:
# db.num=1

### Connect URL of DB:
db.url.0=jdbc:mysql://127.0.0.1:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user.0=root
db.password.0=password

把db.num=1 前面的注釋刪掉,重新啟動,運行成功?。。?!

搭建nacos集群啟動時,報錯Unable to start web server; nested exception is org.springframework.boot.web.server,java,springcloud

?順利完成,收工

?文章來源地址http://www.zghlxwxcb.cn/news/detail-620109.html

到了這里,關(guān)于搭建nacos集群啟動時,報錯Unable to start web server; nested exception is org.springframework.boot.web.server的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • Unable to start embedded Tomcat Nacos啟動報錯

    Unable to start embedded Tomcat Nacos啟動報錯

    報錯信息:Unable to start embedded Tomcat 無法加載內(nèi)置的tomcat。 無需重新配置JDK,輕松解決 圖1 圖2 如再次啟動報錯:檢查端口占用問題

    2024年02月02日
    瀏覽(29)
  • 啟動失敗Unable to start embedded Tomcat server

    org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java)? at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java)? at ?org.springframework.boot.

    2024年01月18日
    瀏覽(26)
  • org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server

    org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server

    org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server ------------------------------------------ 本地模擬復(fù)現(xiàn)問題 JDK 1.8_341? ?tomcat 9.0.41 其實不是tomcat和JDK版本問題,而是SSL配置出錯的。

    2024年04月12日
    瀏覽(23)
  • Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerExcepti

    Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerExcepti

    Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat 這是我自己項目加錯了報錯了。? ?

    2024年02月16日
    瀏覽(15)
  • Unable to start web server; nested exception is org.springframework.context.ApplicationContextExcept

    Unable to start web server; nested exception is org.springframework.context.ApplicationContextExcept

    SpringBoot項目啟動報錯,如圖 Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.這個錯誤 可以看出ServletWebServerFactory在sping容器啟動時沒有將其注冊進(jìn)去,缺少相關(guān)依賴。沒有

    2024年02月14日
    瀏覽(20)
  • 【解決】nested exception is org.springframework.boot.web.server.WebServerException Unable to start

    【解決】nested exception is org.springframework.boot.web.server.WebServerException Unable to start

    【問題描述】:IDEA發(fā)布SpringBoot工程時,出現(xiàn)了該異常,一直發(fā)布不成功,報了以下的錯誤 nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded 問題原因 因為SpringBoot是內(nèi)嵌了Tomcat服務(wù)器的,出現(xiàn)該問題的話,明顯是因為Tomcat沒有配置好,網(wǎng)絡(luò)上有說包

    2024年02月15日
    瀏覽(19)
  • 【異常解決】SpringBoot + Maven 在 idea 下啟動報錯 Unable to start embedded Tomcat(已解決)

    【異常解決】SpringBoot + Maven 在 idea 下啟動報錯 Unable to start embedded Tomcat(已解決)

    spring boot(v2.5.14) + maven + idea 啟動項目 之前項目一直啟動的好好的,都能正常運行。重啟的時候突然就不能啟動了。 報錯日志如下: 根據(jù)網(wǎng)上搜索出以下幾種情況: 1、JDK版本問題 2、IDEA環(huán)境變量問題 3、等等 以上原因都不是導(dǎo)致我本次項目啟動不起來的真正問題。 根據(jù)項目

    2024年02月03日
    瀏覽(29)
  • nacos啟動報錯Nacos Server did not start because dumpservice bean construction failure :No DataSource set

    nacos啟動報錯Nacos Server did not start because dumpservice bean construction failure :No DataSource set

    剛開始看到這個錯誤還是挺蒙的,nacos啟動居然還能報錯,仔細(xì)一看報錯說的數(shù)據(jù)源問題,才想起來是之前設(shè)置了nacos配置中心持久化的問題,使用nacos配置中心持久化我們會在nacos配置文件中指定持久化數(shù)據(jù)源,因此如果你的持久化數(shù)據(jù)源nacos連接不到,nacos就會報錯 解決方案

    2024年02月11日
    瀏覽(15)
  • 解決Jenkins-2.396啟動報錯:Failed to start Jenkins Continuous Integration Server.

    解決Jenkins-2.396啟動報錯:Failed to start Jenkins Continuous Integration Server.

    場景:現(xiàn)有環(huán)境已經(jīng)使用 Java 8 在運行業(yè)務(wù),安裝 Jenkins 后啟動報錯。 原因:因為 Jenkins-2.396 依賴于 Java 11 版本才能啟動。 解決方法: yum 安裝Java11 修改Jenkins 啟動文件 重啟Jenkins

    2024年02月14日
    瀏覽(30)
  • Nginx啟動報錯- Failed to start The nginx HTTP and reverse proxy server

    Nginx啟動報錯- Failed to start The nginx HTTP and reverse proxy server

    根據(jù)日志,仍然出現(xiàn) “bind() to 0.0.0.0:8888 failed (13: Permission denied)” 錯誤。這意味著 Nginx 仍然無法綁定到 8888 端口,即使使用 root 權(quán)限。 請執(zhí)行以下操作來進(jìn)一步排查問題: 確保沒有其他進(jìn)程占用 8888 端口 :使用以下命令檢查端口 8888 是否已被其他進(jìn)程占用: 如果該端口已

    2024年02月12日
    瀏覽(27)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包