1. 程式人生 > >intellij idea cannot resolve property under construction in mybatis-mapper.xml

intellij idea cannot resolve property under construction in mybatis-mapper.xml

IntelliJ offers a very intelligent experience by giving you such a relevant suggestion in every context. However, in some parts, you need to configure them.

Our project / product are maven-based and we used spring framework. The spring configuration is in XML file. We discover that IntelliJ unable to refer to property or annotated beans that you declared under test/resources 

directory. Note that this is not happen to the configs file under src/resources. For example, you’ll see a warning on ${db.dev.url} which tells you the key cannot be resolved.

Maven test folder structure

Maven test folder structure

Property cannot be resolved

Property cannot be resolved

Solution

For quick fix, what you can do is to include all your spring configs under test

directory in your IntelliJ project structure.

  1. Open project structure (CTRL + ALT + SHIFT + S) in on windows
  2. Under project settings, select Modules
  3. Select a module and add SpringIntelliJ project structure

    IntelliJ project structure

  4. Add new application context
  5. Select XML based configurations
    XML based configuration

    XML based configuration

  6. Locate your spring configuration files.
  7. Done

Result

Screenshot_7

相關推薦

intellij idea cannot resolve property under construction in mybatis-mapper.xml

IntelliJ offers a very intelligent experience by giving you such a relevant suggestion in every context. However, in some parts, you need to configure them

Uncaught TypeError: Cannot read property of undefined In JavaScript

  當指令碼遇到未初始化的變數或物件時,通常會丟擲如上圖所示的錯誤。   Decription 'Undefined'是全域性物件的屬性。如果沒有為變數賦值,則為'undefined'型別。當求值變數沒有任何賦值時,程式碼也會返回未定義的值。   Code str

idea cannot resolve symbol XX及專案無法顯示正常目錄結構

今天開啟專案的時候發現下邊的資料夾目錄都無法正常顯示,只能在上邊橫欄裡檢視: 解決方案,將專案下的.idea資料夾刪掉,重新匯入專案即可。 cannot resolve symbol XX。這個問題遇到好多次了,而且專案中有相關的路徑。在網上找了下,

intellij idea cannot save file

  環境:intellij idea2017.2.2.x64   win7   今天開啟nginx後,一邊用Chrome重新整理,一邊修改程式碼,每次改的程式碼待idea自動儲存時都會報上面的錯。沒有Google到滿意答案,同事解答:因為啟動nginx,nginx會檢測在

Intellij IDEA 快速找到某個maven依賴所在的pom.xml

前言: 在企業開發中,公司專案各模組的依賴是比較複雜,往往是A模組中依賴了B、C、D…等模組,此時我們若想在A模組中查詢某個jar依賴就會很麻煩,因為無法在A的pom.xml中直接搜尋到。最笨的方法就是對A模組依賴的其他模組進行逐一搜索,但我想你並不想這麼做。下面我通過一個

Intellij IDEA使用(十二)—— 使用Intellij IDEA匯入Eclipse建立的Spring+SpringMVC+Mybatis(SSM)整合專案並修改相關配置

1、匯入專案 File → Open → 選擇專案所在的目錄開啟專案 3、下面是新增的需要配置的地方 File → Project Structure → 選擇Facets ,新增Spring

Intellij如何去掉mybatis Mapper.xml背景色

Intellij如何去掉mybatis Mapper.xml背景色 1:現在公司中使用mybatis的頻率非常高,一般都會用MBG來生成基礎的程式碼檔案。在intellij中檢視mapper.xml檔案的時候,發現檔案會有背景色,極度影響視覺感受,還讓不讓人寫程式碼了!!! 2:我們把

mapper-spring-boot-starter和逆向工程配合生成報Cannot instantiate object of type tk.mybatis.mapper.generator.

我一直以為逆向工程只需要一個 <build> <plugins> <!--逆向工程--> <plugin> <groupId>org.mybatis.ge

IntelliJ IDEA提示Cannot resolve symbol

date mbo tor rep repos tin 設置 dea ida 今天從git上下載新的項目,遇見了以下問題,IntelliJ IDEA提示Cannot resolve symbol。 解決方法: 1,重新git上下載項目,然後更改settings和reposit

IntelliJ IDEACannot resolve symbol XXX的解決方法

pan validate 通過 ngs style epo invalid 自己 16px Idea導入maven項目後,運行能通過,但是打開一些類後,會出現Cannot resolve symbol XXX的錯誤提示。 考慮幾種可能: 1、JDK版本,設置JDK和Mave

如何解決IntelliJ idea的maven工程提示的Cannot Resolve Symbol

star 菜單 就會 紅色 如何解決 mbo 鼠標 ems 方式   IDEA無法識別一個類類,將其顯示為紅色,如果 compile 沒有問題。鼠標放上去後顯示 “Cannot resolve symbol XXX”,有兩種解決方式:(1)點擊菜單中的

IntelliJ IDEA寫JSP檔案出現“cannot resolve method”解決辦法

最近在使用IDEA寫JSP檔案的時候,有些內建物件出現了cannot resolve method的警告提示,程式碼執行沒有問題,在編寫的時候也不會提示,最後請教了萬能的搜尋引擎,解決了此問題。 解決辦法 該錯誤的導致的原因是因為沒有在專案中新增好伺服器關聯,解決辦法為:開啟File>

Intellij IDEA 提示Cannot resolve symbol 'log' 的解決方法

    今天匯入別人的專案時,發現log飄紅,提示Cannot resolve symbol‘log’,網上查詢發現安裝lombok外掛即可。以下是lombok外掛的作用。    專案中經常使用bean,entity等類,絕大部分資料類類中都需要get、set、toStrin

Intellij IDEACannot Resolve Symbol XXX問題的解決方法

maven專案遇到這類問題基本上是兩方面的原因: 類對應的依賴沒有載入進來、 編譯器自身的設定和快取問題   解決第一類:類對應的依賴沒有載入進來   1、檢查專案的pom檔案,是否必要的依賴都寫清楚了   2、是否使用自己的私有庫,     &l

[intelliJ IDEA + maven]在IDEA中打開一個maven項目,resolve完依賴後,缺少部分jar包問題

maven 遇到 文章 項目 .com 嚴重 intellij ide nload 【註意】作者只是對使用過程中遇到的問題提出了一個解決方案,但是本人在編寫此解決方案文章的時候,對maven並不是很了解,所以可能說的時候會說的有問題,如果發現嚴重錯誤,請廣大的程序員積極指出

IDEA遇到的 Cannot resolve symbol ' ****** ' 問題

路徑 validate res resolve view 問題 star 如果 val IDEA報 Cannot resolve symbol ‘ ****** ‘ 錯誤時   1. 檢查Maven本地倉庫中有沒有對應的 jar 文件,沒有則需要下載對應的 jar 文件。

[Vue warn]: Error in render: "TypeError: Cannot read property '0' of undefined

來看 for per 字段 後來 AD cannot fine size   註意,只要出現Error in render,即渲染時候報錯,此時應該去渲染位置去找錯誤,而不是函數裏面。   今天就碰到這個錯誤,我一直只註意著Cannot read property ‘0‘

IDEA匯入專案jar包紅線, cannot resolve symbol xxxx問題

簡單來說遇到的這種情況2種方式解決了, 不知道還有沒有其他原因的. 1.reimport包 2.清快取重啟   針對1方法:   a.確實不缺包: 可以先註釋掉pom檔案中的jar包, 此時idea會提示import, 那就import吧(如果沒有提示, 那就搜idea設定mav

vue2.XX 提示[Vue warn]: Error in render: "TypeError: Cannot read property 'img' of undefined"

item 是向後臺請求的一條資料,裡面包含img,但是卻提示img未定義 父元件向子元件傳遞資料時, 子元件 具體程式碼: <img :src="item.img" /> 提示: 出現的原因: 可能是頁面渲染和請求資料是非同步操作, 資料還未請求結束,頁面已經開始渲染了,所以剛開始報未

vue2.XX 提示[Vue warn]: Error in render: "TypeError: Cannot read property 'img' of undefined"

再次 bubuko not .com fin 渲染 com 傳遞 fine item 是向後臺請求的一條數據,裏面包含img,但是卻提示img未定義 父組件向子組件傳遞數據時, 子組件 具體代碼: <img :src="item.img" /> 提示: 出現的