The request sent by the client was syntactically incorrect

               


HTTP Status 400 -


type Status report

message

description The request sent by the client was syntactically incorrect ().


Apache Tomcat/7.0.27


     自从使用spring mvc框架后,就频繁遭遇这个问题。刚开始一般都是表单的name字段和Controller里的参数名不匹配,这个时候逐个排查改吧改吧就可以搞定。但是今天逐个参数排查了几遍,发现根参数名无关。

    把项目的日志就别降到最低的DEBUG级别,重新发出请求。这才找到了真凶。

2016-01-28 10:41:20,869 [  19027]  DEBUG - efaultHandlerExceptionResolver - Resolving exception from handler [public java.lang.String com.jd.im.king.tracker.web.controller.ClientLocateController.addRule(org.springframework.ui.Model,com.jd.im.king.tracker.domain.route.rule.TrackerClient)]: org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 2 errorsField error in object 'trackerClient' on field 'tcp_list': rejected value []; codes [methodInvocation.trackerClient.tcp_list,methodInvocation.tcp_list,methodInvocation.java.lang.String,methodInvocation]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [trackerClient.tcp_list,tcp_list]; arguments []; default message [tcp_list]]; default message [Property 'tcp_list' threw exception; nested exception is com.alibaba.fastjson.JSONException: exepct '[', but EOF]Field error in object 'trackerClient' on field 'web_list': rejected value []; codes [methodInvocation.trackerClient.web_list,methodInvocation.web_list,methodInvocation.java.lang.String,methodInvocation]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [trackerClient.web_list,web_list]; arguments []; default message [web_list]]; default message [Property 'web_list' threw exception; nested exception is com.alibaba.fastjson.JSONException: exepct '[', but EOF] 2016-01-28 10:41:20,869 [  19027]  DEBUG - .web.servlet.DispatcherServlet - Null ModelAndView returned to DispatcherServlet with name 'appServlet': assuming HandlerAdapter completed request handling 2016-01-28 10:41:20,869 [  19027]  DEBUG - .web.servlet.DispatcherServlet - Successfully completed request 

    原来参数名确实没有任何问题,表单参数在转java对象发生了错误。spring把异常作为debug级别打出来了。如此重要的日志信息,不应该打error级别吗?

           
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值