使用 ServletContextListener 里面的dao都是null,使用mvc.getIoc().get()也不行
七月 17, 2017 1:57:42 下午 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class [com.h3c.uism.core.session.SessionContextListener]
org.nutz.ioc.IocException: IocBean[userDao] For object [userDao] - type:[class com.h3c.uism.user.dao.UserDao]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:218)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:146)
at com.h3c.uism.core.session.SessionContextListener.contextInitialized(SessionContextListener.java:35)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.nutz.ioc.ObjectLoadException: Object 'userDao' without define!
at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:166)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:180)
... 12 more
恩 就用@SetupBy 好用些 谢谢