NutzCN Logo
问答 @Chain()的问题
发布于 3212天前 作者 qq_cd48ca64 2121 次浏览 复制 上一个帖子 下一个帖子
标签:

-----------------------配置------------------------------------------
{
validation : {
ps : [
"com.mxlvniao.common.nuzt.validation.ValidationProcessor"
],
error : 'org.nutz.mvc.impl.processor.FailProcessor'
}
}
--------------------------主函数入口---------------------------------------
@ChainBy(args={"config/processor.json"})
public class MainModule {

}
----------------------------方法上----------------------------------------------------
@Chain("validation")
--------------------------启动-LOG----------------------------------------------------
{
"default" :{
"ps" :["org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor", "org.nutz.mvc.impl.processor.EncodingProcessor", "org.nutz.mvc.impl.processor.ModuleProcessor", "!org.nutz.integration.shiro.NutShiroProcessor", "org.nutz.mvc.impl.processor.ActionFiltersProcessor", "org.nutz.mvc.impl.processor.AdaptorProcessor", "!org.nutz.plugins.validation.ValidationProcessor", "org.nutz.mvc.impl.processor.MethodInvokeProcessor", "org.nutz.mvc.impl.processor.ViewProcessor"],
"error" :"org.nutz.mvc.impl.processor.FailProcessor"
},
"validation" :{
"ps" :["com.mxlvniao.common.nuzt.validation.ValidationProcessor"],
"error" :"org.nutz.mvc.impl.processor.FailProcessor"
}
}
运行时
java.lang.NullPointerException
at com.mxlvniao.common.nuzt.validation.ValidationProcessor.process(ValidationProcessor.java:34)
{---34行 是 for (Object obj : ac.getMethodArgs())
public void process(ActionContext ac) throws Throwable {
if (hasErrorArg) {
Errors es = new Errors();
for (Object obj : ac.getMethodArgs()) {
av.validate(obj, es);
}
}
doNext(ac);
}
}
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:196)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

什么地方弄错了  求教!!!
2 回复

ps那段要在原本的基础上加,而非单单写个自定义的

了解了 谢谢!

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