亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

spring boot configuration annotation processor not found in classpath

Description:
Field girlProperties in com.imooc.HelloController required a bean of type 'com.imooc.GirlProperties' that could not be found.
Action:
Consider defining a bean of type 'com.imooc.GirlProperties' in your configuration.

誰知道是為什么呀?

正在回答

10 回答

http://img1.sycdn.imooc.com//5fdf555e0001585711060305.jpg

這個怎么解決啊


0 回復 有任何疑惑可以回復我~

spring-boot-configuration-processor加了這個依賴,鼠標也能點進去查看,但是右側maven那里卻顯示沒有加載下來

0 回復 有任何疑惑可以回復我~
1、首先要添加這個配置,并等待依賴更新完成。
<dependency>
???<groupId>org.springframework.boot</groupId>
???<artifactId>spring-boot-configuration-processor</artifactId>
???<optional>true</optional>
</dependency>
2、如果出現:Re-run?spring?boot?configuration?annotation?processor?to?update?generate?metadata。
忽略即可。大不了你重新編輯下。再大不了你重啟下IDEA。
3、如果還不行,獲取值還是Null.

那么請檢查你的Model是不是:只有getter,而沒有Setter.官方文檔說明了,但是我試了下感覺括號里那句話是胡扯。

http://img1.sycdn.imooc.com//5a88141200012bf912620168.jpg

1 回復 有任何疑惑可以回復我~

親測有效,那些說沒用的同學你確定你其他地方沒有出錯?

在pom.xml導入依賴

<dependency>
??<groupId>org.springframework.boot</groupId>
??<artifactId>spring-boot-configuration-processor</artifactId>
??<optional>true</optional>
</dependency>


1 回復 有任何疑惑可以回復我~

我從C#轉java? 目前在自學,遇到了一樣的問題,在pom.xml中添加dependency也是不行

1 回復 有任何疑惑可以回復我~

一樣,黑色變成了紅色,還是報錯

0 回復 有任何疑惑可以回復我~

.....這個問題是那個girlProperties類沒注入到Spring容器里,需要在該類上添加注解@component。

2 回復 有任何疑惑可以回復我~

加了依賴之后也只是提示從紅色變成了黑色,并沒有消失,你的消失了嗎

1 回復 有任何疑惑可以回復我~

添加依賴之后怎么弄啊?

0 回復 有任何疑惑可以回復我~

只需要在pom.xml添加一個依賴,如下:

<dependency>
? <groupId>org.springframework.boot</groupId>
? <artifactId>spring-boot-configuration-processor</artifactId>
? <optional>true</optional>
</dependency>

3 回復 有任何疑惑可以回復我~
#1

洋妞honey 提問者

錯了。還是不行
2017-04-13 回復 有任何疑惑可以回復我~
#2

洋妞honey 提問者 回復 洋妞honey 提問者

我@component注解注解錯地方了
2017-04-13 回復 有任何疑惑可以回復我~
#3

僅此而已_104061629 回復 洋妞honey 提問者

你怎么自己回答自己啊,哈哈,就是要添加這個依賴才能解決
2017-06-27 回復 有任何疑惑可以回復我~
#4

qq_慕仙547661 回復 洋妞honey 提問者

只是sevice層沒有加@service注解 而已
2019-03-12 回復 有任何疑惑可以回復我~
查看1條回復

舉報

0/150
提交
取消
2小時學會Spring Boot
  • 參與學習       151526    人
  • 解答問題       1132    個

Spring Boot入門視頻教程,你將學會使用Spring Boot快速構建應用程序

進入課程

spring boot configuration annotation processor not found in classpath

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號