NutzCN Logo
问答 ioc中取不到bean 日志中已经加载。
发布于 521天前 作者 xwqiang 192 次浏览 复制 上一个帖子 下一个帖子
标签:

日志如下:

```
15:13:17.884 [main] DEBUG org.nutz.resource.Scans - Found 2 resource by src( ioc/ ) , regex( ^(.+[.])(js|json)$ )
15:13:17.884 [main] DEBUG org.nutz.ioc.loader.json.JsonLoader - loading ioc js config from [dao.js]
15:13:17.892 [main] DEBUG org.nutz.ioc.loader.json.JsonLoader - loading ioc js config from [ioc.js]
15:13:17.893 [main] DEBUG org.nutz.ioc.loader.json.JsonLoader - Loaded 7 bean define from path=[ioc/] --> [kytvDao, kytv_dataSource, config, cardsDao, kytv_dao, cards_dao, cards_dataSource]
15:13:17.903 [main] DEBUG org.nutz.resource.Scans - Found 11 resource by src( com/kuyun/ ) , regex( ^.+[.]class$ )
15:13:17.916 [main] DEBUG o.n.i.l.a.AnnotationIocLoader - Found a Class with Ioc-Annotation : class com.kuyun.cardSchedule.service.SubscribeService
15:13:17.972 [main] DEBUG org.nutz.castor.Castors - Using 91 castor for Castors
15:13:17.976 [main] INFO o.n.i.l.a.AnnotationIocLoader - Scan complete ! Found 1 classes in 1 base-packages!
beans = ["subscribeService"]
15:13:17.983 [main] DEBUG org.nutz.ioc.impl.NutIoc - Get 'cardsDao'<class com.kuyun.cardSchedule.dao.CardsDao>
15:13:17.983 [main] DEBUG org.nutz.ioc.impl.NutIoc - >> Load definition
15:13:17.984 [main] DEBUG org.nutz.ioc.loader.map.MapLoader - Loading define for name=cardsDao
Exception in thread "main" org.nutz.ioc.IocException: For object [cardsDao] - type:[class com.kuyun.cardSchedule.dao.CardsDao]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:201)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:212)
at com.kuyun.cardSchedule.launch.Launch.main(Launch.java:20)
Caused by: org.nutz.ioc.ObjectLoadException: Wrong type name: 'com.kuyun.cardsSchedule.dao.CardsDao'
at org.nutz.ioc.IocLoading.E(IocLoading.java:37)
at org.nutz.ioc.IocLoading.map2iobj(IocLoading.java:64)
at org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:86)
at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:135)
at org.nutz.ioc.loader.cached.CachedIocLoaderImpl.load(CachedIocLoaderImpl.java:47)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:169)

```
2 回复

package名对不上呢, cardsSchedule跟cardSchedule差个s呢

15:13:17.983 [main] DEBUG org.nutz.ioc.impl.NutIoc - Get 'cardsDao'<class com.kuyun.cardSchedule.dao.CardsDao>

Caused by: org.nutz.ioc.ObjectLoadException: Wrong type name: 'com.kuyun.cardsSchedule.dao.CardsDao'

兽总威武!

添加回复
请先登陆
回到顶部