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

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

運行程序報錯,,錯誤的創建bean

我service的測試類ok的,也能訪問index.jsp,就是訪問list.jsp報錯,,哪位大神幫忙看一下,,謝謝!


org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'seckillServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.Seckill.dao.SeckillDao org.Seckill.service.impl.SeckillServiceImpl.seckillDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.Seckill.dao.SeckillDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

??


Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.Seckill.dao.SeckillDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

web.xml

https://img1.sycdn.imooc.com//5b4300f700010cf214070717.jpg

spring-web.xml

https://img1.sycdn.imooc.com//5b4301ca0001784815610781.jpg

正在回答

1 回答

你的SeckillServiceImpl這個類是不是沒有加注解,比如:@Service。不加注解的話,BeanFactory就不會知道他是一個Bean,這樣,在SeckillController 中使用@Autowired注解注入的時候,Spring容器就會找不到對應的Bean

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

鯊魚尖椒 提問者

加過了,xml配置寫錯了
2018-09-12 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

運行程序報錯,,錯誤的創建bean

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

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

幫助反饋 APP下載

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

公眾號

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