NutzCN Logo
问答 我想自定义返回的提示信息,然后报错?
发布于 2031天前 作者 qq_91afbf68 1588 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk
[WARN ] 2019-04-24 18:58:37,538 org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:28) - Error@/platform/sys/bbaddress/delete :
org.nutz.lang.FailToGetValueException: Fail to get value for [java.lang.Long]->[id]
	at org.nutz.lang.Mirror.makeGetValueException(Mirror.java:763)
	at org.nutz.lang.Mirror.getValue(Mirror.java:826)
	at org.nutz.el.opt.object.AccessOpt.calculate(AccessOpt.java:46)
	at org.nutz.el.arithmetic.RPN.calculate(RPN.java:55)
	at org.nutz.el.arithmetic.RPN.calculate(RPN.java:38)
	at org.nutz.el.El.eval(El.java:33)
	at cn.wizzer.common.services.log.SLogAopInterceptor.doLog(SLogAopInterceptor.java:82)
	at cn.wizzer.common.services.log.SLogAopInterceptor.filter(SLogAopInterceptor.java:64)
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
	at cn.wizzer.modules.controllers.platform.sys.BbAddressController$$NUTZAOP.delete(BbAddressController.java:1)
	at cn.wizzer.modules.controllers.platform.sys.BbAddressController$FM$delete$4240018e67ab19d6e1f8cc369c08426b.invoke(BbAddressController.java)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:31)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.common.processor.XssSqlFilterProcessor.process(XssSqlFilterProcessor.java:35)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.common.processor.NutShiroProcessor.process(NutShiroProcessor.java:52)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	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.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.common.processor.GlobalsSettingProcessor.process(GlobalsSettingProcessor.java:37)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.common.processor.LogTimeProcessor.process(LogTimeProcessor.java:21)
	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.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at cn.wizzer.common.filter.RouteFilter.doFilter(RouteFilter.java:37)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
	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.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:493)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
	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:800)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoSuchMethodException: Fail to find getter for [java.lang.Long]->[id]
	at org.nutz.lang.reflect.fast.java.lang.NoSuchMethodException$FC$ab706b0cf40b3b24094a0af312e173b9.invoke(NoSuchMethodException.java)
	at org.nutz.lang.born.AbstractConstructorBorning.call(AbstractConstructorBorning.java:25)
	at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:19)
	at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
	at org.nutz.lang.Mirror.born(Mirror.java:990)
	at org.nutz.lang.Lang.makeThrow(Lang.java:152)
	at org.nutz.lang.Mirror.getGetter(Mirror.java:251)
	at org.nutz.lang.Mirror.getGetter(Mirror.java:197)
	at org.nutz.lang.Mirror.getValue(Mirror.java:804)
	... 68 more
@At({"/delete","/delete/?"})
	@Ok("json")
	@RequiresPermissions("sys.manager.bbaddress.delete")
	@SLog(tag = "删除区域", msg = "删除区域:id:${args[0].id},名称:${args[0].addrname}")
	public Object delete(long id,@Param("ids") Integer[] ids, HttpServletRequest req) {
		try {
			//查询用户区域表,获取到这个id有片区在使用,就不进行删除
			if(ids!=null&&ids.length>0){
				int row=0;
				String str="";
				List<Bb_user_address> useraddrlist = useraddressservice.query(Cnd.where("addrid", "in", ids).and("code", "=", "countyUser"));
				for (int i = 0; i < ids.length; i++) {
					for (int j = 0; j < useraddrlist.size(); j++) {
						if(useraddrlist.get(j).getAddrid()==ids[i]) {
							row=1;
							str+=ids[i]+",";
						}
					}
				}
				if(row==0) {
					useraddressservice.delete(ids);//删除片区管理和区域管理关系表
					bbAddressService.delete(ids);//删除区域表
				}else {
					String s="区域存在片区管理,id:"+str.substring(0, str.length()-1)+"";
					return Result.error(s);
				}
			}else{
				Bb_user_address useraddr = useraddressservice.fetch(Cnd.where("addrid", "in", ids).and("code", "=", "countyUser"));
				if(useraddr==null) {
					bbAddressService.delete(id);
				}else {
					return Result.error("区域存在片区管理");
				}
			}
			return Result.success("system.success");
		} catch (Exception e) {
			return Result.error("system.error");
		}
	}
6 回复

看SLog的模板写错了

@SLog(tag = "删除区域", msg = "删除区域:id:${id},ids:${ids},名称:${req.addrname}")
public Object delete(long id,@Param("ids") Integer[] ids, HttpServletRequest req) {
@SLog(tag = "删除区域", msg = "删除区域:id:${id},ids:${ids}")
public Object delete(long id,@Param("ids") Integer[] ids, HttpServletRequest req) {

没有对象有 addrname 啊

感谢,今天一早才想到这个

随便问一下,能在进行delete的时候加这种用法吗? xxxservice.delete(Cnd.where("","","").and())

一贴一问,ps 你应该用clear

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