spring報錯"No property ... found for type..."
遇到很多次這個問題了,可能正是因為沒有寫一篇部落格,才導致我一直踩坑.
這個問題的原因,我遇到的只有一個,就是Spring Data JPA的Entity實體沒有對應好,具體怎麼說呢
這樣,我遇到的問題是這樣,我的資料庫中的欄位是publish_time,然後為了偷懶,在JavaBean中,我
直接就把對應的屬性名寫作publish_time(因為不用寫@column),然後在Repository介面中的基於
方法名字查詢的一些方法(例如:getByName)就無法使用,因為這些方法是JPA僅僅根據方法名而
自行實現的方法,所以,方法名就尤為重要,它有一些規則,我沒有看原始碼,但從我的測試中來看,這個
方法名不能帶"_",必須使用駝峰命名,對於的問題,我把JavaBean中的屬性名改為PublishTime,
然後加上了@column就可以了,可能你不使用基於方法名字的查詢也會有這樣的報錯,我建議
檢視一下你的JavaBean的屬性名,還有一點,如果你在已有的JavaBean的基礎上改程式碼,記得一定要
把對應的getter/setter也修改.
相關推薦
spring報錯"No property ... found for type..."
遇到很多次這個問題了,可能正是因為沒有寫一篇部落格,才導致我一直踩坑. 這個問題的原因,我遇到的只有一個,就是Spring Data JPA的Entity實體沒有對應好,具體怎麼說呢 這樣,我遇到的問題是這樣,我的資料庫中的欄位是publish_time,然後為了偷懶,在JavaBean中,
Mybatis啟動報錯: No typehandler found for property xxxx 的另一種可能(由CLOB型別導致的問題)
背景:搭了一個demo專案啟動的時候Mybatis報錯錯誤資訊:Caused by: java.lang.IllegalStateException: No typehandler found for
SSM報錯:No converter found for return value of type: class java.util.ArrayList at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageC
我使用的是SSM框架,是在編寫測試RESTFUL介面的時候出現, @RequestMapping(value = "/selectAll", method = RequestMethod.GET) @ResponseBody public ResponseEntity<List&
SSM報錯:No mapping found for HTTP request with URI [/smbms/js/echarts.js] in DispatcherServlet with na
在jsp引用ECharts的js包: 啟動Tomcat,在位址列輸入URL:http://localhost:8080/smbms/user/linechart.html 結果頁面空白,報錯日誌部分資訊: [DEBUG] 2017-11-11 09:32:33,160 o
IAR破解時,報錯:no features found for selected product
系統是Win10,安裝用於51微控制器開發的版本,破解檔案網上都能下到,這裡給個連結:IAR破解版下載。 直接說解決問題的原因及辦法。 【問題原因】:破解程式的pro
虛擬機器電腦之間的遷移以及靜態IP的配置,以及虛擬機器遷移後重啟網絡卡報錯:Error:No suitable device found: no device found for connection "S
1.虛擬機器遷移後網絡卡的配置:‘ 自己電腦容量不夠了,準備將資料遷移到公司電腦,但是虛擬機器中做了好多配置,重新安裝會很麻煩,感覺虛擬機器是不是可以直接匯出匯入,保留配置。百度後找到了解決方法。 VMware虛擬機器遷移過程: ’右鍵選擇vmware中的虛擬機器,選擇開啟虛擬機器目錄,
springmvc報404錯誤No mapping found for HTTP request with URI [/mavenSpringmvc/requesttest] in DispatcherServlet with name 'spring'
for 404錯誤 com web and uri pat con 題解 問題404錯誤的原因有很多種 有這種,後邊不帶url的 這種一般就是沒有進入到controller中 可以在toncat中看到信息 十一月 12, 2018 12:21:25 下午 org.
Android報錯:No toolchains found in the NDK toolchains folder for ABI with prefix: ***
因為Android Studio的開發環境以及Gradle的版本更新,出現了報錯: No toolchains found in the NDK toolchains folder for ABI w
配置ssm專案報錯:No qualifying bean of type ... found for dependency ...expected at least 1 bean which
配置ssm專案時,提示提示在service層注入出錯,出錯資訊如下:大致的錯誤資訊為: cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException:
Spring Boot, Java Config - No mapping found for HTTP request with URI [/…] in DispatcherServlet with name 'dispatcherServlet'
dispatch name req let servlet patch request found pack Spring Boot 啟用應用: error: No mapping found for HTTP request with URI [/…]
mac系統idea開發工具git -push 報錯:no matching host key type found. Their offer: ssh-dss
bsp 開發 版本 git cheng 算法 com push href 原因: 根本原因之所以報錯是因為OpenSSH7.0以後的版本不再支持ssh-dss(DSA)算法,官方的說法是這個算法太弱了。MACOS升到10.12附帶的openssh版本是7.4,如下:?~ss
Xcode10更新報錯:library not found for -lstdc++.6.0.9
由於iPhone X Max 及iOS12系統的到來,必須升級xcode10了,剛升級完執行就報錯了,一臉悶逼。 library not found for -lstdc++.6.0.9 報錯原
升級xcode 10後報錯:library not found for -lstdc++.6.0.9 && Multiple command
001 報錯 library not found for -lstdc++.6.0.9 因為專案中的sdk 需要 lstdc,但是xcode 10 升級後 刪除了該檔案 所以需要重新匯入這些檔案即可。 002 Multiple command Showi
git連線不上遠端倉庫---visualstudio提交程式碼報錯:no upstream configured for branch 'master'
1,新建資料夾,在檔案下下滑鼠右鍵git bush--->git init,初始化倉庫; 2,設定gitthub倉庫地址:git remote add origin https://github.com/z*****g/lm.git 3,git pull origin master 4,git p
Xcode Archive報錯: ld: library not found for -lAFNetworking
需要打AdHoc包到蒲公英做測試用, 發現打包失敗, 但是release模式下可以打包成功 AdHoc模式下 找不到AFNetworking這個包 網上一般的方法也沒能解決 然後機智的我 重新p
mvn spring-boot:run出錯No plugin found for prefix 'spring-boot'
使用 SpringLoader 進行專案的熱部署 以 maven 外掛方式使用 SpringLoader 在 pom 檔案中新增外掛配置檔案中新增外掛配置 使用 maven 的命令spring-boot:run來啟動:: 首先執行Spring-boot的啟動類,且不能停止它啟動,然後在專
Flask 報錯 RuntimeError: No application found. Either work inside a view function or push an applicati
報錯資訊部分擷取: File "D:\python 3.5\lib\site-packages\flask_sqlalchemy\__init__.py", line 912, in get_app 'No application found. E
解決返回JSON時報錯:No converter found for return value of type:
exception org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentExc
pip安裝mysql報錯 ld: library not found for -lssl
ld: library not found for -lssl clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command '/usr/bin/clang' failed w
xcode10 報錯:library not found for -libstdc++.6.0.9
檔案轉載自網際網路,好像是github… /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profil