Spring框架使用中遇到的問題

2021-06-27 18:32:10 字數 374 閱讀 7053

caused by: org.springframework.beans.factory.beannotofrequiredtypeexception: 

bean named 'userservice' must be of type [cn.axin.service.impl.userserviceimpl], 

but was actually of type [com.sun.proxy.$proxy14]

出現該問題,大部分是因為在你的類中,定義的是實現類,而不是介面

要這樣定義如: private iuserdao userdao;

注意iuserdao是介面

spring在注入bean的時候要求定義的是介面,注入的是介面的實現類

elasticsearch使用中遇到的問題(二)

1 在實際需求中需要同乙個字段實現精確和模糊檢索,而且需要對檢索的關鍵字不進行分詞的搜尋,如 子龍 這個關鍵詞,不能拆分成子和龍這兩個關鍵字,要以乙個整體去檢索,檢索的結果必須是 子龍 或者 子龍 或者 子龍 或者 子龍 這樣需要設定同乙個字段具有多個屬性,而且要自定檢索期分詞器和索引器的分詞器 此...

tomcat 載入 spring 工程遇到的問題

嚴重 error listenerstart 嚴重 context x startup failed due to previous errors 或者 嚴重 error filterstart org.apache.catalina.core.standardcontext start 嚴重 co...

使用NodeJS GruntCLI遇到的問題

執行環境cmd nodejs版本v0.8.4 node version 需求 需要用到grunt的js編譯功能,各位別笑我。使用 安裝完grunt cli報錯 grunt grunt cli the grunt command line inte ce.v0.1.13 fatal error una...