Maven建立SSM專案 啟動時報錯Mapped Statements collection does not contain value for xxx
問題:Maven建立SSM專案 啟動時報錯Mapped Statements collection does not contain value for xxx
經過檢查發現Mapper.xml名稱空間沒寫錯,註解沒有少,自動掃描包也正常,但是仍然報錯
解決方案:Maven中需要新增resource標籤,resources標籤中指定對映檔案路徑,否則xml對映檔案以及資原始檔不會被Maven載入!
貼程式碼:
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
問題成功解決,希望本篇文章可以幫助到需要的人哈,轉載註明出處!
相關文章
- editor does not contain a main type Maven專案AIMaven
- 解決mybatis出現Mapped Statements collection already contains value for問題MyBatisAPPAI
- mybatis(錯誤) 專案啟動時報“Result Maps collection already contains value forxxx”的解決方案MyBatisAI
- Result Maps collection already contains value for xxx.xxx.dao.BaseResultMap錯誤AI
- streamlit run執行報錯,Invalid value: File does not exist: XXX.py
- 建立Maven專案出錯Maven
- 建立Maven專案出錯 pom出錯Maven
- Maven建立專案遇到導包錯誤:Maven
- QT中error: xxx does not name a type xxx錯誤QTError
- spring boot 啟動時報錯The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized orJDBC driverSpring BootServerZedJDBC
- idea ssm maven專案搭建筆記IdeaSSMMaven筆記
- react建立專案報錯React
- Maven專案Spring Boot啟動MavenSpring Boot
- idea maven搭建spring報錯:No bean named 'xxx' availableIdeaMavenSpringBeanAI
- Maven專案報錯:No bean named 'xxxxxx' availableMavenBeanAI
- Composer 建立專案時報錯的一點經歷
- 啟動IDEA 報 failed to load jvm dll XXX 錯誤IdeaAIJVM
- Maven專案報錯invalid LOC header (bad signature)MavenHeader
- Idea啟動SpringBoot報錯:程式包xxx 不存在IdeaSpring Boot
- allowedOrigins cannot contain the gateway 報錯AIGateway
- hadoop啟動時,報ssh: Could not resolve hostname xxx: NamHadoop
- idea專案啟動報錯:java.lang.OutOfMemoryErrorIdeaJavaError
- Vue 啟動專案報錯 Failed to compile with 2 errorsVueAICompileError
- SpringBoot專案建立與第一個SSM專案示例Spring BootSSM
- maven專案構建報錯:Could not find artifact com.xxx.cloud:xxx-cloud:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POMMavenCloud
- Result Maps collection already contains value for com.xxx.xxxMapper.BaseResultMap問題解決AIAPP
- 【小白第一篇】maven搭建ssm專案MavenSSM
- maven 專案的建立入門Maven
- IDEA設定預設Maven(使用idea maven archetype建立專案時,專案建立慢或者不完整,缺失部分目錄)IdeaMaven
- Springboot專案啟動後訪問Controller報錯404Spring BootController
- Idea啟動專案報{dataSource-1} closed錯誤Idea
- gateway 報錯 allowedOrigins cannot contain the specialGatewayAI
- 用maven建立專案及maven常用命令Maven
- 使用Maven,idea建立web專案啟動不了,war exploded: Artifact is being deployed, please wait...MavenIdeaWebAI
- IntelliJ IDEA編譯專案報錯 "xxx包不存在&qIntelliJIdea編譯
- error: ‘xxx’ does not name a typeError
- Property [title] does not exist on this collection instance
- Maven建立Web應用程式專案MavenWeb