Error creating bean with name ‘servletEndpointRegistrar‘ defined in class path resource
生活随笔
收集整理的這篇文章主要介紹了
Error creating bean with name ‘servletEndpointRegistrar‘ defined in class path resource
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
記錄一下
今天在寫為服務項目碰到的錯誤,如下面所示,只知道創建Error creating bean with name ‘servletEndpointRegistrar’ defined in class path resource失敗,在網上也找了一些解決方法,最多的解決答案是說缺少jdbc依賴,要么就是說數據庫配置文件出錯了,我也比對了下數據庫沒錯,也沒缺少jdbc依賴,這說明我的數據庫和依賴都沒錯,我就又比對了下其他service服務,發現就是配置文件多引入了個配置文件
[${project.name}] 2021-09-10 23:21:44,213 ERROR [localhost-startStop-1][Jdk14Logger.java:87] - Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.class]: Unsatisfied dependency expressed through method 'servletEndpointRegistrar' parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'management.endpoints.web-org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties': Could not bind properties to 'WebEndpointProperties' : prefix=management.endpoints.web, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'management.endpoints.web.exposure' to org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties$Exposure [${project.name}] 2021-09-10 23:21:44,240 WARN [main][Jdk14Logger.java:87] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat [${project.name}] 2021-09-10 23:21:44,241 INFO [main][DubboGenericServiceFactory.java:159] - The Dubbo GenericService ReferenceBeans are destroying... [${project.name}] 2021-09-10 23:21:44,245 INFO [main][Jdk14Logger.java:87] - class org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor was destroying!我的nacos文件配置是
#HTTP格式配置spring: http:encoding:charset: UTF‐8force: trueenabled: truemessages:encoding: UTF‐8 #tomcat頭信息(用戶ip和訪問協議)及訪問路徑配置 server:tomcat:remote_ip_header: x‐forwarded‐forprotocol_header: x‐forwarded‐protoservlet:context‐path: /liflyuse‐forward‐headers: true#服務監控與管理配置,運維相關 management:endpoints:web:exposure:include: refresh,health,info,env這個配置文件就是定義了用戶ip和訪問路徑以及一些與服務監控與管理與運維相關的配置文件,但是service中并沒有用到遠程調用,我卻將該配置文件引入了,我的出錯原因是這個,就記錄下來了。
我的bootstrap.yml配置文件如下:
我的把那個引入文件注釋掉,項目就起來了。再次記錄下,也希望對你們有幫助。將下面的引入文件注釋掉
ext-config:-refresh: truedata-id: spring-boot-http.yaml # spring boot http配置group: COMMON_GROUP # 通用配置組總結
以上是生活随笔為你收集整理的Error creating bean with name ‘servletEndpointRegistrar‘ defined in class path resource的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 民营股份制企业是什么意思
- 下一篇: Android 系统服务 - PMS 的