MainSetup中触发AuthorityService,在init方法末尾添加如下代码
AuthorityService as = ioc.get(AuthorityService.class);
as.initFormPackage("net.wendal.nutzbook");
as.checkBasicRoles(dao.fetch(User.class, "admin"));
启动项目报错
严重: Exception starting filter nutz
org.nutz.mvc.LoadingException: org.nutz.ioc.IocException: [authorityService] # For object [authorityService] - type:[interface net.wendal.nutzbook.service.AuthorityService]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:17)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:990)
at org.nutz.lang.Lang.wrapThrow(Lang.java:198)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:135)
at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
at org.nutz.mvc.NutFilter._init(NutFilter.java:87)
at org.nutz.mvc.NutFilter.init(NutFilter.java:65)
at net.wendal.nutzbook.mvc.NutzBookNutFilter.init(NutzBookNutFilter.java:22)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4700)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5340)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.nutz.ioc.IocException: [authorityService] # For object [authorityService] - type:[interface net.wendal.nutzbook.service.AuthorityService]
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 net.wendal.nutzbook.MainSetup.init(MainSetup.java:38)
at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:277)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:121)
... 16 more
Caused by: org.nutz.ioc.ObjectLoadException: Object 'authorityService' without define!
at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:174)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:180)
... 21 more
不知道是什么问题?