NutzCN Logo
问答 nutzboot 为啥其它的java类不能放在和启动主类同一个包下啊? 一放就报错,以下是报错信息,和代码。
发布于 2475天前 作者 小苍蝇 9278 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk

包名为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

21 回复

报的是重名

com.bstek.urule.RuleController !!  Have been define by com.bstek.urule.controller.RuleController

这个不应该吧,有包名区分啊

ioc默认命名是首字母小写的类名,所以,不同package的重名也会报错

还有就是com.bstek.urule 包下的启动类MainLauncher.java 不能加载com.bstek.urule.controller包下的controller类,我这个启动类是父级包啊! 我访问url: http:localhost:8080/app/rule/定员

[DEBUG] 11:22:30.371 org.apache.shiro.session.mgt.AbstractValidatingSessionManager.createSessionValidationScheduler(AbstractValidatingSessionManager.java:213) - No sessionValidationScheduler set.  Attempting to create default instance.
[INFO ] 11:22:30.372 org.apache.shiro.session.mgt.AbstractValidatingSessionManager.enableSessionValidation(AbstractValidatingSessionManager.java:233) - Enabling session validation scheduler...
[DEBUG] 11:22:30.373 org.apache.shiro.web.servlet.SimpleCookie.readValue(SimpleCookie.java:389) - Found 'sid' cookie value [3tcjhvubhkg7urrrh7ctmpmolp]
[DEBUG] 11:22:30.381 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) - Found mapping for [GET] path=/app/rule/定员 : RuleController.rule(RuleController.java:35)
[DEBUG] 11:22:30.383 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165) - Get 'ruleController'<class com.bstek.urule.controller.RuleController>
[DEBUG] 11:22:30.383 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:191) - 	 >> Load definition name=ruleController
[DEBUG] 11:22:30.383 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) - Found IocObject(ruleController) in AnnotationIocLoader(packages=[com.bstek.urule])
[DEBUG] 11:22:30.384 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:222) - 	 >> Make...'ruleController'<class com.bstek.urule.controller.RuleController>
[DEBUG] 11:22:30.384 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:65) - Save object 'ruleController' to [app] 
[DEBUG] 11:22:30.384 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76) - Load class com.bstek.urule.controller.RuleController without AOP
[DEBUG] 11:22:30.387 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165) - Get 'highspeedrailAction'<class com.bstek.urule.action.HighspeedrailAction>
[DEBUG] 11:22:30.389 org.nutz.ioc.impl.ScopeContext.remove(ScopeContext.java:85) - Remove object 'ruleController' from [app] 
[WARN ] 11:22:30.390 org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:28) - Error@/app/rule/定员 :
org.nutz.ioc.IocException: IocBean[ruleController] throw Exception when creating
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:152)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:240)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:270)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:116)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.nutz.mvc.WhaleFilter.doFilter(WhaleFilter.java:159)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:530)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
	at org.eclipse.jetty.io.ManagedSelector$$Lambda$25/445010547.run(Unknown Source)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: Fail to find Method com.bstek.urule.controller.RuleController->init with params:
[]
	at org.nutz.lang.Lang.wrapThrow(Lang.java:186)
	at org.nutz.ioc.impl.ObjectMakerImpl$2.trigger(ObjectMakerImpl.java:182)
	at org.nutz.ioc.weaver.DefaultWeaver.onCreate(DefaultWeaver.java:89)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:141)
	... 51 more
Caused by: java.lang.NoSuchMethodException: Fail to find Method com.bstek.urule.controller.RuleController->init with params:
[]
	at org.nutz.lang.Mirror.findMethod(Mirror.java:1192)
	at org.nutz.ioc.impl.ObjectMakerImpl$2.trigger(ObjectMakerImpl.java:177)
	... 53 more

@At("/app")
@IocBean(create="init", depose="depose")
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", name);
		session.startProcess("demo",param);
		return  HighspeedrailAction.list;
	}

}

sogo!原来是这样,不能根据包名区分,那就只能类名要完全不一样才行

Fail to find Method com.bstek.urule.controller.RuleController->init
@IocBean(create="init", depose="depose") // 都没写init和depose方法, 那就删除啊
// 改成
@IocBean()

没啥用,报错信息一样的

就好像这个类没有被加载一样

贴当前日志

[DEBUG] 11:33:21.136 org.apache.shiro.web.servlet.SimpleCookie.readValue(SimpleCookie.java:389) - Found 'sid' cookie value [3tcjhvubhkg7urrrh7ctmpmolp]
[DEBUG] 11:33:21.137 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) - Found mapping for [GET] path=/app/rule/定员 : RuleController.rule(RuleController.java:35)
[DEBUG] 11:33:21.137 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165) - Get 'ruleController'<class com.bstek.urule.controller.RuleController>
[DEBUG] 11:33:21.137 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:191) - 	 >> Load definition name=ruleController
[DEBUG] 11:33:21.137 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) - Found IocObject(ruleController) in AnnotationIocLoader(packages=[com.bstek.urule])
[DEBUG] 11:33:21.137 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:222) - 	 >> Make...'ruleController'<class com.bstek.urule.controller.RuleController>
[DEBUG] 11:33:21.138 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:65) - Save object 'ruleController' to [app] 
[DEBUG] 11:33:21.138 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76) - Load class com.bstek.urule.controller.RuleController without AOP
[DEBUG] 11:33:21.138 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165) - Get 'highspeedrailAction'<class com.bstek.urule.action.HighspeedrailAction>
[DEBUG] 11:33:21.138 org.nutz.ioc.impl.ScopeContext.remove(ScopeContext.java:85) - Remove object 'ruleController' from [app] 
[WARN ] 11:33:21.138 org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:28) - Error@/app/rule/定员 :
org.nutz.ioc.IocException: IocBean[ruleController] throw Exception when creating
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:152)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:240)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:270)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:116)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.nutz.mvc.WhaleFilter.doFilter(WhaleFilter.java:159)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:530)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: Fail to find Method com.bstek.urule.controller.RuleController->init with params:
[]
	at org.nutz.lang.Lang.wrapThrow(Lang.java:186)
	at org.nutz.ioc.impl.ObjectMakerImpl$2.trigger(ObjectMakerImpl.java:182)
	at org.nutz.ioc.weaver.DefaultWeaver.onCreate(DefaultWeaver.java:89)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:141)
	... 52 more
Caused by: java.lang.NoSuchMethodException: Fail to find Method com.bstek.urule.controller.RuleController->init with params:
[]
	at org.nutz.lang.Mirror.findMethod(Mirror.java:1192)
	at org.nutz.ioc.impl.ObjectMakerImpl$2.trigger(ObjectMakerImpl.java:177)
	... 54 more

你没改啊.RuleController的@IocBean没改啊

又好了,尴尬

@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;
	}

}

多谢大神,那个静态资源怎么个结构

例如说, js文件 css,images,啥的

static目录下你爱怎么放就怎么放

这个resources/static/images/1.jpg 怎么在浏览器访问啊

http://127.0.0.1:8080/images/1.jpg 如果设置了contextPath的话就加上contextPath

嗯,好的! 我试试啊

能不能给一个application.properties配置文档给我啊,可以配置哪些东西

setPrintProcDoc

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