在测试一个方法,dubug查看查询结果已经出来了,结果页面上是The server encountered an internal error that prevented it from fulfilling this request.,再debug ,发现ServletInvocableHandlerMethod#invokeAndHandle中 发现如下异常:

org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Conflicting getter definitions for property "buyNow":..........nested exception is org.codehaus.jackson.map.JsonMappingException: Conflicting getter definitions for property "buyNow".....xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx#isBuyNow(0 params) vs xxxxxxxxxxxxxxxx#getBuyNow(0 params)
从上面的异常找到相应的bean,如下图3行和11行
 /** 是否直接购买(1|是,0|不是,默认0) */
private Integer buyNow;
public Integer getBuyNow (){
return buyNow;
} public void setBuyNow (Integer buyNow){
this.buyNow = buyNow;
} public boolean isBuyNow() {
return BUY_NOW_YES.equals(buyNow);
}

从异常提示的信息可以看出jackson处理bean时不知道该调用#isBuyNow还是#getBuyNow,对于此次当然可以告诉jackson忽略,加个@JsonIgnore是可以的,但是这个地方其实平时代码规范的问题,其实不仅是jackson处理上还有其它的地方也会有此问题,所以方法命名上就要杜绝这种is打头的命名方式是最好的(我认为的)。

The server encountered an internal error that prevented it from fulfilling this request.(JsonMappingException: Conflicting getter definitions)的更多相关文章

  1. The server encountered an internal error that prevented it from fulfilling this request.

    type Exception report message Request processing failed; nested exception is org.mybatis.spring.MyBa ...

  2. PHP错误The server encountered an internal error or misconfiguration and was unable to complete your re

    我的笔记本电脑上的环境安装了很多次,但是运行项目时总是会报The server encountered an internal error or misconfiguration and was un ...

  3. windows上zend server安装 报The server encountered an internal error or misconfiguration and was unable to complete your request -解决方法 摘自网络

    windows上zend server安装完成后报如下错误:   Internal Server Error The server encountered an internal error or m ...

  4. eclipse里报:An internal error occurred during: "Building workspace". Java heap space(内存溢出)

    当在eclipse中的web工程中增加了extjs4,出现An internal error occurred during: "Building workspace".Java ...

  5. IDEA链接mySql问题 : You have an error in your SQL syntax : 'OPTION SQL_SELECT_LIMIT=1000' (or 'OPTION SQL_SELECT_LIMIT=DEFAULT')

    IDEA控制台错误信息: check the manual that corresponds to your MySQL server version for the right Code: 1064 ...

  6. 【iOS】iOS Error Domain=NSCocoaErrorDomain Code=3840 "未能完成操作。(“Cocoa”错误 3840。)"

    昨天遇到的这个问题,详细信息: ----->类和方法__25+[Manager noticeRequest:]_block_invoke399----->错误信息Error Domain= ...

  7. EBS Webservice Timeout,HTTP Server Return "500 Internal Server Error"

    http://blog.itpub.net/26687597/viewspace-1207571/ 基于Oracle EBS R12,开发了一个Webservice用于返回某项主数据,当请求的数据量非 ...

  8. python appium自动化报“Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server

    运行app自动化代码时报"Encountered internal error running command: UnknownError: An unknown server-side e ...

  9. mac上运行appium提示错误Encountered internal error running command 解决办法

    [debug] [iOS] App is not installed. Will try to install. [MJSONWP] Encountered internal error runnin ...

随机推荐

  1. python 判断字符串中是否只有中文字符

    python 判断字符串中是否只有中文字符 学习了:https://segmentfault.com/q/1010000007898150 def is_all_zh(s): for c in s: ...

  2. [Spring boot] A quick REST API Guide

    Controller: Code below shows a basic Controller to handle GET, POST; DELETE, PUT requests. package h ...

  3. Android项目总结

    功能: 1.图片载入 ImageLoader 參数配置要合理    cacheMemory 一次性的图片最好不要缓存在内存中   合理控制在内存中的内存大小 ,适当的释放   volley是googl ...

  4. VMware中Nat方式设置静态IP

    一.共享无线连接或本地连接,给VMnet8. 在网络配置中.选着无线连接,右键属性.共享. 这里默认给虚拟网卡VMnet8.分配了IP:192.168.137.1. 二,在VMware中配置VMnet ...

  5. OpenStack-Heat中的AWS::WaitCondition的使用

    在heat中.一个instance的创建成功信号是在这个instance状态成为active之后发出的,这时候user-data可能还没有运行.可是heat已经觉得这个resource创建成功了,開始 ...

  6. (一)Shiro笔记——简介、 架构分析

    1. Shiro是什么 Apache Shiro是一个强大灵活的开源安全框架,可以完全处理身份验证,授权,企业会话管理和加密. Apache Shiro的首要目标是易于使用和理解. 安全有时可能非常复 ...

  7. oracle闪回某个时间段的数据

    闪回2013-08-08 08:08:08的数据: insert into  table_1   select * from table_2 as of timestamp to_date('2013 ...

  8. unity, 内存profile,ImageEffects Temp和Unity GI SystemTex RGBM

    最近用unity的Profiler对公司项目进行内存profile,发现一些问题,记录一下. 用Memory Area的Detailed View,用法见:http://docs.unity3d.co ...

  9. NIO之缓冲区(Buffer)的数据存取

    缓冲区(Buffer) 一个用于特定基本数据类行的容器.有java.nio包定义的,所有缓冲区都是抽象类Buffer的子类. Java NIO中的Buffer主要用于与NIO通道进行交互,数据是从通道 ...

  10. 680. Valid Palindrome II【easy】

    680. Valid Palindrome II[easy] Given a non-empty string s, you may delete at most one character. Jud ...