呼叫自己寫的類顯示bean的路徑沒有找到解決方案

2021-10-12 16:31:22 字數 1281 閱讀 8450

呼叫自己寫的類時,顯示bean路徑沒有找到,
20-12-22 20:05:28.713  info 20204 --- [           main] o.apache.catalina.core.standardservice   : stopping service [tomcat]

2020-12-22 20:05:28.725 info 20204 --- [ main] conditionevaluationreportlogginglistener :

2020-12-22 20:05:28.987 error 20204 --- [ main] o.s.b.d.loggingfailureanalysisreporter :

***************************

***************************

description:

field prop in com.leyou.auth.service.authservice required a bean of type 'com.leyou.auth.config.jwtproperties' that could not be found.

the injection point has the following annotations:

- @org.springframework.beans.factory.annotation.autowired(required=true)

action:

consider defining a bean of type 'com.leyou.auth.config.jwtproperties' in your configuration.

process finished with exit code 1

自己從網上找了幾個方法然後總結了一下寫到這李希望可以幫助到大家

一般沒有找到一般是在啟動的時候後沒有掃瞄到所以在呼叫的類上加乙個@component

2.第二種方法是在spring boot 啟動類@enablefeignclients註解上加上對應的路徑

自己寫的List類

我寫的list,還沒100 完成,有空修改完補貼新 修改一下t的型別就可以模擬范型的強型別效果。例如using t system.byte using t system.int32 為什麼要自己寫?因為有時候系統的類不符合要求,例如效能,例如功能.using system using system....

自己寫的 string 類

現在很多面試題都是要求寫乙個string類,主要檢查big 3,也就是主要檢查建構函式,析構函式和賦值函式.不要告訴我你以為是 姚明,麥蒂,阿泰.這也是很考驗基本功的乙個題目.我今天自己寫了乙個mystring類,順便加上了stradd函式用於字串相加,get函式用於輸出.詳細 如下,說明見注釋.i...

自己寫的呼叫飛鴿傳書

private static void sendmsg 主機名稱 string hostname dns.gethostname 要傳送的人的名稱 string sendto zhangdongyan 埠 int port 2425 存放傳送訊息的位元組陣列 byte msgcontent null...