我定義了一個借口Service 定義一個類ServiceA implements Service在一個嘞中DaoA extends ServiceA在action中Service a;在set方法上@Resource(name="daoA")總是出現這種錯誤;直接Service a=bew DaoA();又沒錯到底是為什么,Error creating bean with name 'customerRegisterAndModifyServicer': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'customerRegisterAndModifyDao' must be of type [myshop.all.services.Impl.RegisterValidateService], but was actually of type [$Proxy11]
1 回答

縹緲止盈
TA貢獻2041條經驗 獲得超4個贊
大小寫問題 DaoA, 不是 daoA
還有 是 new , 不是 bew
其實我不明白為何你要用 injection,
不過看不到你代碼的上文下理, 所以也不作分析了
問: 你有沒有寫 package ?
在 @Resouce 里, 有沒有 private Service ?
如果還是不行, 那你試試
@Resource ( name="DaoA", type="yourService" )
- 1 回答
- 0 關注
- 69 瀏覽
添加回答
舉報
0/150
提交
取消