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

Failed to start bean ‘eurekaAutoServiceRegistration‘; nested exception is java.lang.NullPointerExcep

這篇具有很好參考價值的文章主要介紹了Failed to start bean ‘eurekaAutoServiceRegistration‘; nested exception is java.lang.NullPointerExcep。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

想用將一個服務(wù)注冊到eureka服務(wù)上的,三步走完成之后

啟動報錯 java.lang.NullPointerExcep?

Failed to start bean ‘eurekaAutoServiceRegistration‘; nested exception is java.lang.NullPointerExcep

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

?

上網(wǎng)查的方法不外乎幾種

  1. maven按順序讀取的,~~eureka-client的 依賴放太下面
  2. springboot和cloud版本不對應(yīng)
  3. 引入依賴沒有指定版本
  4. 沒在啟動類加入注解

我首先排除的就是第二個和第三個

spring boot和cloud版本不對應(yīng)

因為eureka服務(wù)都搭建成功,怎么可能在注冊服務(wù)這階段的時候還是springboot和cloud版本不對應(yīng)

沒有指定版本

一開始就指定版本了,不指定版本,找不到依賴(這里碼住,我的錯誤就跟這個有點關(guān)系)

我改了maven中依賴的位置,也在啟動類上添加了@EnableEurekaClient注解,

Failed to start bean ‘eurekaAutoServiceRegistration‘; nested exception is java.lang.NullPointerExcep

仍舊報錯

Failed to start bean ‘eurekaAutoServiceRegistration‘; nested exception is java.lang.NullPointerExcep

還是報一摸一樣的錯誤。

我仔細(xì)看了一下報錯的原由

Cannot invoke "org.springframework.cloud.netflix.eureka.CloudEurekaClient.getApplications()" because the return value of "org.springframework.cloud.netflix.eureka.serviceregistry.EurekaRegistration.getEurekaClient()" is null

那么問題可能出現(xiàn)在我引入的依賴上的版本上,

因為我在引入spring-cloud-starter-netflix-eureka-server依賴時就因為出現(xiàn)版本沖突問題,所以我引入的是2.2.0版本,那我想client與之對應(yīng),為了不出問題,毫不猶豫版本也用2.2.0

當(dāng)我把以來版本換了一下,換最新的

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
    <version>3.1.3</version>
</dependency>

成功運行?

Failed to start bean ‘eurekaAutoServiceRegistration‘; nested exception is java.lang.NullPointerExcep

ps:我同時又將另一個服務(wù)注冊上去,maven中依賴在最下面,啟動類沒有添加注解,仍然成功運行,看來問題就完全出在我導(dǎo)入的依賴版本上

?

到了這里,關(guān)于Failed to start bean ‘eurekaAutoServiceRegistration‘; nested exception is java.lang.NullPointerExcep的文章就介紹完了。如果您還想了解更多內(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)文章

  • SpringBoot啟動報錯Unable to start web server; nested exception...

    SpringBoot啟動報錯Unable to start web server; nested exception...

    在創(chuàng)建SpringBoot項目時,依賴加載,但是啟動報錯如下:Unable to start web server; nested exception… 網(wǎng)上找了很多,很多回答為版本不一致,但仔細(xì)檢查,版本對應(yīng)都修改好了,但是還是報這個錯誤,test卻能夠成功。 根據(jù)自測,是導(dǎo)入的依賴問題:注釋掉或者刪除即可 原因是在創(chuàng)建

    2024年02月12日
    瀏覽(20)
  • 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)
  • 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)
  • 已解決:SpringBoot啟動報錯:Unable to start web server; nested exception is org.springframework.boot.web

    查了一些解決方案,但是最后發(fā)現(xiàn)這個報錯是因為:在pom引用了jackson相關(guān)包,但沒有引用完整導(dǎo)致的 這個Jackson 是當(dāng)前用的比較廣泛的,用來序列化和反序列化 json 的 Java 的開源框架。

    2024年02月12日
    瀏覽(31)
  • Failed to obtain JDBC Connection; nested exception is java.sql.SQLException

    Failed to obtain JDBC Connection; nested exception is java.sql.SQLException

    Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: The server time zone value \\\'?й???????\\\' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the \\\'serverTimezone\\\' configuration property) to use a more specifc time zone value if you want to utilize time zone s

    2024年02月11日
    瀏覽(25)
  • 解決springboot啟動報Failed to start bean ‘subProtocolWebSocketHandler‘;

    解決springboot啟動報Failed to start bean ‘subProtocolWebSocketHandler‘;

    使用 springboot 整合 websocket ,啟動時報錯,示例代碼: 如圖所示: 在上述代碼中可以看到有兩個注解, @EnableWebSocketMessageBroker 和 @EnableWebSocket ,同時使用,導(dǎo)致配置錯誤引起的。由于這兩個注解都啟用了 WebSocket 功能,因此同時使用它們可能會導(dǎo)致沖突。 兩者取其一即可,

    2024年01月19日
    瀏覽(28)
  • 搭建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啟動時沒有問題,修改了配置之后啟動報錯,如下 貼出已經(jīng)修改的配置文件,cluster.conf和application.properties cluster.conf如下 application.properties如下,其他不需要修改的地方?jīng)]有復(fù)制進(jìn)來 因為是看著視頻一步一步改的,然后視頻里

    2024年02月14日
    瀏覽(93)
  • Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.excepti

    Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.excepti

    ? ? 這是第一個錯,解決了還有其他的 這個錯誤的原因在我配置applicationContext.xml中,沒有給數(shù)據(jù)庫配置時區(qū),但是我之前的代碼都正常運行,直到使用jdbcTemplate.execute方法才出現(xiàn)這個錯誤。在url后面添加上?useSSL=falseserverTimezone=UTC即可 ? ? ? ? 添加完報錯少了十幾行,出現(xiàn)了

    2024年02月16日
    瀏覽(25)
  • Failed to parse multipart servlet request; nested exception is java.lang.Runtime

    1.問題原因 在 Linux 系統(tǒng)中,Spring Boot 應(yīng)用啟動時,會在操作系統(tǒng)的 /tmp 目錄下生成一個 tomcat(或 undertow )臨時目錄,上傳的文件會先轉(zhuǎn)換成臨時文件保存在這個文件夾下面。 由于臨時 /tmp 目錄下的文件,在長時間(10天)沒有使用的情況下,Linux系統(tǒng)執(zhí)行了 tmp 目錄清理服務(wù)

    2024年02月08日
    瀏覽(31)

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

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

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

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

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包