第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

spring boot啟動不掃描創(chuàng)建bean怎么回事?

spring boot啟動不掃描創(chuàng)建bean怎么回事?

胡說叔叔 2019-07-26 15:02:53
spring boot啟動不掃描創(chuàng)建bean怎么回事?
查看完整描述

2 回答

?
ITMISS

TA貢獻(xiàn)1871條經(jīng)驗 獲得超8個贊

1.這幾天一直被這個問題困擾,Spring boot啟動沒報錯,就是掃描不到需要注冊的類。今天終于發(fā)現(xiàn),Spring boot的啟動類需要放在需要掃描類的上層目錄,這樣才能掃描到同級或者子類需要注冊的類。  但是在網(wǎng)上我發(fā)現(xiàn)一個其他問題,有人說用 @ComponentScan直接寫需要掃描類的路徑,但是我試驗一直沒成功。不知道為什么,麻煩幫忙看下!  剛接觸spring boot  先謝謝各位了 。

2.下圖是我要掃描的dao和service,但是啟動后一直報錯。報的錯一看就是沒掃描到類ReadingListRepository,這個類繼承JpaRepository

3.2017-04-25 22:45:57.349  WARN 7864 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'readingListController': Unsatisfied dependency expressed through field 'readingListRepository'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.dawn.oket.dao.ReadingListRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2017-04-25 22:45:57.349  INFO 7864 --- [           main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2017-04-25 22:45:57.349  INFO 7864 --- [           main] org.hibernate.tool.hbm2ddl.SchemaExport  : HHH000227: Running hbm2ddl schema export
2017-04-25 22:45:57.349  INFO 7864 --- [           main] org.hibernate.tool.hbm2ddl.SchemaExport  : HHH000230: Schema export complete
2017-04-25 22:45:57.359  INFO 7864 --- [           main] o.apache.catalina.core.StandardService   : Stopping service Tomcat
2017-04-25 22:45:57.399  INFO 7864 --- [           main] utoConfigurationReportLoggingInitializer :
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-04-25 22:45:57.681 ERROR 7864 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :
***************************
APPLICATION FAILED TO START
***************************
Description:
Field readingListRepository in org.dawn.oket.service.ReadingListController required a bean of type 'org.dawn.oket.dao.ReadingListRepository' that could not be found.
Action:
Consider defining a bean of type 'org.dawn.oket.dao.ReadingListRepository' in your configuration.
Disconnected from the target VM, address: '127.0.0.1:52934', transport: 'socket'
Process finished with exit code 1



查看完整回答
反對 回復(fù) 2019-07-28
  • 2 回答
  • 0 關(guān)注
  • 917 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號