包名为com.bstek.urule,下面有MainLauncher.java和RuleController.java,如果去掉RuleController.java这个文件又是正常的,难道只允许MainLauncher.java一个类吗
@IocBean(create="init", depose="depose")
public class MainLauncher {
@Inject
protected PropertiesProxy conf;
@At({"/", "/index"})
@Ok("beetl:/index.html")
public NutMap index() {
NutMap obj = new NutMap();
obj.setv("name", "NB").setv("age", 18);
return obj;
}
public void init() {
// NB自身初始化完成后会调用这个方法
}
public void depose() {}
public static void main(String[] args) throws Exception {
new NbApp().setArgs(args).setPrintProcDoc(true).run();
}
}
@At("/app")
@IocBean
public class RuleController {
@Inject
protected HighspeedrailAction highspeedrailAction;
@At("/rule/?")
@Ok("json:full")
public List<Map<String,Object>> rule(String name) throws IOException {
//创建一个KnowledgeSession对象
KnowledgeSession session = RuleTool.getSessionFactory( "test01/hig");
Map<String, Object> param = new HashMap<>();
param.put("mechanismType", "定员");
session.startProcess("demo",param);
return HighspeedrailAction.list;
}
}
[INFO ] 11:12:15.864 org.nutz.boot.banner.SimpleBannerPrinter.printBanner(SimpleBannerPrinter.java:34) -
_ _ ______ ___
| \ | || ___ \ ______ ______ ______ ______ ______| \ \
| \| || |_/ / |______|______|______|______|______| |\ \
| . ` || ___ \ ______ ______ ______ ______ ______| | > >
| |\ || |_/ / |______|______|______|______|______| |/ /
\_| \_/\____/ |_/_/
:: Nutz Boot :: (2.2-SNAPSHOT)
[INFO ] 11:12:15.878 org.nutz.resource.impl.ErrorResourceLocation.<init>(ErrorResourceLocation.java:28) - [loc=D:\working%20space\testms\iads\target\classes]not exist
[INFO ] 11:12:15.882 org.nutz.resource.impl.ErrorResourceLocation.<init>(ErrorResourceLocation.java:28) - [loc=D:\working%20space\testms\iads\target\classes]not exist
[DEBUG] 11:12:16.045 org.nutz.resource.Scans.printLocations(Scans.java:527) - Locations count=100 time use 167ms
[DEBUG] 11:12:16.058 org.nutz.resource.Scans.scan(Scans.java:280) - Found 1 resource by src( custom/ ) , regex( ^.+[.]properties$ )
[DEBUG] 11:12:16.058 org.nutz.ioc.impl.PropertiesProxy.setPaths(PropertiesProxy.java:114) - load properties from jar:file:/D:/repository/maven/repo/org/nutz/nutzboot-core/2.2-SNAPSHOT/nutzboot-core-2.2-SNAPSHOT.jar!/custom/emtry.properties
[DEBUG] 11:12:16.060 org.nutz.boot.config.impl.PropertiesConfigureLoader.init(PropertiesConfigureLoader.java:39) - load D:\working space\testms\iads\target\classes\application.properties
[DEBUG] 11:12:16.109 org.nutz.resource.Scans.scan(Scans.java:280) - Found 1 resource by src( ioc/ ) , regex( ^(.+[.])(js|json)$ )
[DEBUG] 11:12:16.111 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:49) - loading [emtry.json]
[DEBUG] 11:12:16.112 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:57) - Loaded 0 bean define from path=[ioc/] --> []
[DEBUG] 11:12:16.194 org.nutz.castor.Castors.reload(Castors.java:116) - Using 101 castor for Castors
[DEBUG] 11:12:16.226 org.nutz.ioc.aop.SimpleAopMaker.<init>(SimpleAopMaker.java:79) - Load AopConfigure for anno=org.nutz.aop.interceptor.async.Async by type=org.nutz.aop.interceptor.async.AsyncAopIocLoader
[INFO ] 11:12:16.247 org.nutz.ioc.loader.annotation.AnnotationIocLoader.<init>(AnnotationIocLoader.java:50) - > scan 'com.bstek.urule'
[DEBUG] 11:12:16.421 org.nutz.resource.Scans.scan(Scans.java:280) - Found 717 resource by src( com/bstek/urule/ ) , regex( ^.+[.]class$ )
[INFO ] 11:12:16.663 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:98) - > add 'customerTest ' - com.bstek.urule.action.CustomerTest
[INFO ] 11:12:16.665 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:98) - > add 'highspeedrailAction ' - com.bstek.urule.action.HighspeedrailAction
[INFO ] 11:12:16.671 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:98) - > add 'stringAction ' - com.bstek.urule.builtIn.action.StringAction
[INFO ] 11:12:16.678 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:98) - > add 'ruleController ' - com.bstek.urule.controller.RuleController
[INFO ] 11:12:16.691 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:98) - > add 'mainLauncher ' - com.bstek.urule.MainLauncher
[ERROR] 11:12:16.697 org.nutz.boot.NbApp.run(NbApp.java:173) - something happen
org.nutz.lang.born.BorningException: Fail to born or cast to 'org.nutz.ioc.loader.annotation.AnnotationIocLoader'
by args: [@(com.bstek.urule)]
because:org.nutz.ioc.IocException: IocBean[ruleController] Duplicate beanName=ruleController, by com.bstek.urule.RuleController !! Have been define by com.bstek.urule.controller.RuleController !!
at org.nutz.lang.born.DynamicConstructorBorning.born(DynamicConstructorBorning.java:23)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:1022)
at org.nutz.ioc.loader.combo.ComboIocLoader.createIocLoader(ComboIocLoader.java:124)
at org.nutz.ioc.loader.combo.ComboIocLoader.<init>(ComboIocLoader.java:98)
at org.nutz.boot.NbApp.prepareIocLoader(NbApp.java:342)
at org.nutz.boot.NbApp.prepare(NbApp.java:232)
at org.nutz.boot.NbApp._run(NbApp.java:184)
at org.nutz.boot.NbApp.run(NbApp.java:170)
at com.bstek.urule.MainLauncher.main(MainLauncher.java:97)
Caused by: org.nutz.ioc.IocException: IocBean[ruleController] Duplicate beanName=ruleController, by com.bstek.urule.RuleController !! Have been define by com.bstek.urule.controller.RuleController !!
at org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:92)
at org.nutz.ioc.loader.annotation.AnnotationIocLoader.<init>(AnnotationIocLoader.java:52)
at org.nutz.ioc.loader.annotation.AnnotationIocLoader$FC$31c2b655809620aa3360d108200d18f6.invoke(AnnotationIocLoader.java)
at org.nutz.lang.born.AbstractConstructorBorning.call(AbstractConstructorBorning.java:25)
at org.nutz.lang.born.DynamicConstructorBorning.born(DynamicConstructorBorning.java:17)
... 9 more