最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

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

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

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

慕村9548890 2018-09-05 13:13:37
查看完整描述

2 回答

?
Cats萌萌

TA貢獻(xiàn)1805條經(jīng)驗(yàn) 獲得超9個(gè)贊

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

下圖是我要掃描的dao和service,但是啟動(dòng)后一直報(bào)錯(cuò)。報(bào)的錯(cuò)一看就是沒掃描到類ReadingListRepository,這個(gè)類繼承JpaRepository

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ù) 2018-09-28
  • 2 回答
  • 0 關(guān)注
  • 1071 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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