日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Error creating bean with name ‘servletEndpointRegistrar‘ defined in class path resource

發布時間:2023/12/20 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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配置文件如下:

server:port: 56050 #啟動端口 命令行注入 nacos:server:addr: 127.0.0.1:8848 spring:application:name: transaction-service # main: # allow-bean-definition-overriding: true # Spring Boot 2.1 需要設定cloud:nacos:discovery:server-addr: 127.0.0.1:8848 # server-addr: ${nacos.server.addr}namespace: 339eea59-f7f4-44d0-a3fa-9f1f85bd5b4f # cluster-name: COMMON_GROUPconfig:server-addr: 127.0.0.1:8848 # server-addr: ${nacos.server.addr} # 配置中心地址file-extension: yamlnamespace: 339eea59-f7f4-44d0-a3fa-9f1f85bd5b4f # 默認開發環境鄭州區 命令行注入group: DEFAULT_GROUP # 聚合支付業務組ext-config:-refresh: truedata-id: spring-boot-http.yaml # spring boot http配置group: COMMON_GROUP # 通用配置組 # - # refresh: true # data-id: spring-boot-starter-druid.yaml # spring boot starter druid配置 # group: COMMON_GROUP # 通用配置組 # - # refresh: true # data-id: spring-boot-mybatis-plus.yaml # spring boot mybatisplus配置 # group: COMMON_GROUP # 通用配置組 # - refresh: true # data-id: spring-boot-redis.yaml # redis配置 # group: COMMON_GROUP # 通用配置組datasource:driver-class-name: com.mysql.jdbc.Driverurl: jdbc:mysql://localhost:3306/huiminpay_transaction?useUnicode=true&useSSL=false# url: jdbc:mysql://localhost:3306/huiminpay_merchant_service?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&useUnicode=trueusername: rootpassword: 1234 mybatis-plus:type-aliases-package: com.huiminpay.transaction.entitymapper-locations: classpath:/mapper/*.xmldubbo:scan:# dubbo 服務掃描基準包base-packages: com.huiminpayprotocol:# dubbo 協議name: dubboport: 20893registry:address: nacos://127.0.0.1:8848application:qos:port: 22250 # dubbo qos端口配置 命令行注入consumer:check: falsetimeout: 3000retries: -1logging:config: classpath:log4j2.xml

我的把那個引入文件注釋掉,項目就起來了。再次記錄下,也希望對你們有幫助。將下面的引入文件注釋掉

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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。