NutzCN Logo
问答 nutzboot集成urule规则引擎,虽然内置动作库解决,但是动作库还是报错,urule是内置动作库和动作库两套的,请解决一下,以下是报错信息
发布于 2439天前 作者 小苍蝇 2545 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.bstek.urule.console.servlet.BaseServletHandler.invokeMethod(BaseServletHandler.java:38)
at com.bstek.urule.console.servlet.action.ActionServletHandler.execute(ActionServletHandler.java:49)
at com.bstek.urule.console.servlet.URuleServlet.service(URuleServlet.java:84)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.nutz.mvc.NutFilter.nextChain(NutFilter.java:230)
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:205)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.nutz.mvc.WhaleFilter.doFilter(WhaleFilter.java:159)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'customerTest' available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1080)
at com.bstek.urule.console.servlet.action.ActionServletHandler.loadMethods(ActionServletHandler.java:63)
... 36 more

12 回复

发日志用"插入代码或日志片段"按钮啊啊啊啊

哦,能不能解决一下,我今天在搭建框架

customerTest是一个标注了@ActionBean的类吗?

这个不是,@ActionBean这个注解代表这个类是urule内置动作定义文件,不加这个@ActionBean注解的话,也是可以用反射机制拿到这个文件的,urule叫做动作定义! 就好比一个是公共的,一个不是公共的

@IocBean
public class CustomerTest {

@ExposeAction("方法1")
public boolean evalTest(String username){
    if(username==null){
       return false;
    }else if(username.equals("张三")){
       return true;
    }
    return false;
}

}

customerTest是nutz ioc里面的对象??

是的,如果我换成springboot的iocbean注解就是正常的

看来得想个版本兼容一下

嗯,我就怕一旦集成一套完整 的nutzboot框架,就会出现何种兼容问题,特别是这些第三方组件

更新了一下代码, 预计10分钟后有快照吧 https://gitee.com/nutz/nutzboot/commit/dcb1339f36304234b8576e337e4013464c96380c

需要在CustomTest类上加个@AsSpringBean

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