NutzCN Logo
精华 1.r.54升级1.r.56后 报错 Caused by: java.lang.RuntimeException: Fail to eval Injector for field: 'dao'
发布于 3133天前 作者 yzhang226 2487 次浏览 复制 上一个帖子 下一个帖子
标签:

如题

Exception in thread "main" org.nutz.ioc.IocException: [onlineSurviveDetectionService] # FAIL to create Ioc Bean name=[onlineSurviveDetectionService]
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:149)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:235)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:146)
	at com.dada.monitor.nutz.common.IocUtils.get(IocUtils.java:74)
	at com.dada.monitor.online.common.AppHolder.inst(AppHolder.java:53)
	at com.dada.monitor.online.run.OnlineTopologyRunByApp.main(OnlineTopologyRunByApp.java:65)
Caused by: java.lang.RuntimeException: Fail to eval Injector for field: 'dao'
	at org.nutz.lang.Lang.wrapThrow(Lang.java:136)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:128)
	... 6 more
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: dao
	at org.nutz.lang.Lang.wrapThrow(Lang.java:153)
	at org.nutz.lang.Lang.forName(Lang.java:2193)
	at org.nutz.ioc.impl.DefaultValueProxyMaker.make(DefaultValueProxyMaker.java:81)
	at org.nutz.ioc.IocMaking.makeValue(IocMaking.java:64)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:124)
	... 6 more
Caused by: java.lang.ClassNotFoundException: dao
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at org.nutz.lang.Lang.loadClass(Lang.java:1994)
	at org.nutz.lang.Lang.forName(Lang.java:2189)
	... 9 more

我是通过在父类置入doc, 如下:


@IocBean public class BaseNutzEntityService<T extends BaseEntity> extends IdEntityService<T> { // @Inject private Dao dao; protected static final Log log = LogFactory.getLog(BaseNutzEntityService.class); public static final BaseNutzEntityService<BaseEntity> inst = new BaseNutzEntityService<BaseEntity>(); @Inject public void setDao(Dao dao) { super.setDao(dao); }

麻烦看看是怎么回事?

谢谢

6 回复

去掉@Inject及setter, 把@IocBean改成这样试试

@IocBean(fields={"dao"})

@wendal 这样是可以了, 可是, 为啥子呢?

@yzhang226 应该是bug,报个issue吧

@wendal 怎么报issue?怎么操作?

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