title: Spring JSON Jackson Marshaller adding additional parameter in my response object
body: <p>This is one of the strangest errors I have encountered in a long time. </p>
  
  <p>I have a ServerResponse POJO that I respond with from my Spring MVC REST app using JSON or XML Marshaller configured with ContentNegotiatingViewResolver. </p>
  
  <p>Now my standard JSON response in case of error should look like -></p>
  
  <p>{ response: { result: null, error: {code: "500", message: "Internal Server Error"}}</p>
  
  <p>and a similar XML.</p>
  
  <p>Instead I'm getting the following in case a Hibernate exception occurs in:</p>
  
  <pre><code>   {
  "response": {
  "result": null,
  "error": {
  "message": "Internal Server Error",
  "code": "500"
  },
  "respTime": "100 ms"
  },
  "exception": {
  "cause": null,
  "message": null,
  "localizedMessage": null,
  "stackTrace": [(45)
  {
  "fileName": "NativeConstructorAccessorImpl.java",
  "lineNumber": -2,
  "className": "sun.reflect.NativeConstructorAccessorImpl",
  "methodName": "newInstance0",
  "nativeMethod": true
  },
  {
  "fileName": "NativeConstructorAccessorImpl.java",
  "lineNumber": 39,
  "className": "sun.reflect.NativeConstructorAccessorImpl",
  "methodName": "newInstance",
  "nativeMethod": false
  },
  {
  "fileName": "DelegatingConstructorAccessorImpl.java",
  "lineNumber": 27,
  "className": "sun.reflect.DelegatingConstructorAccessorImpl",
  "methodName": "newInstance",
  "nativeMethod": false
  },
  {
  "fileName": "Constructor.java",
  "lineNumber": 513,
  "className": "java.lang.reflect.Constructor",
  "methodName": "newInstance",
  "nativeMethod": false
  },
  {
  "fileName": "BeanUtils.java",
  "lineNumber": 147,
  "className": "org.springframework.beans.BeanUtils",
  "methodName": "instantiateClass",
  "nativeMethod": false
  },
  {
  "fileName": "BeanUtils.java",
  "lineNumber": 104,
  "className": "org.springframework.beans.BeanUtils",
  "methodName": "instantiateClass",
  "nativeMethod": false
  },
  {
  "fileName": "ModelAttributeMethodProcessor.java",
  "lineNumber": 125,
  "className": "org.springframework.web.method.annotation.support.ModelAttributeMethodProcessor",
  "methodName": "createDataBinder",
  "nativeMethod": false
  },
  {
  "fileName": "ModelAttributeMethodProcessor.java",
  "lineNumber": 92,
  "className": "org.springframework.web.method.annotation.support.ModelAttributeMethodProcessor",
  "methodName": "resolveArgument",
  "nativeMethod": false
  },
  {
  "fileName": "HandlerMethodArgumentResolverComposite.java",
  "lineNumber": 65,
  "className": "org.springframework.web.method.support.HandlerMethodArgumentResolverComposite",
  "methodName": "resolveArgument",
  "nativeMethod": false
  },
  {
  "fileName": "InvocableHandlerMethod.java",
  "lineNumber": 153,
  "className": "org.springframework.web.method.support.InvocableHandlerMethod",
  "methodName": "getMethodArgumentValues",
  "nativeMethod": false
  },
  {
  "fileName": "InvocableHandlerMethod.java",
  "lineNumber": 117,
  "className": "org.springframework.web.method.support.InvocableHandlerMethod",
  "methodName": "invokeForRequest",
  "nativeMethod": false
  },
  {
  "fileName": "ModelFactory.java",
  "lineNumber": 118,
  "className": "org.springframework.web.method.annotation.ModelFactory",
  "methodName": "invokeAttributeMethods",
  "nativeMethod": false
  },
  {
  "fileName": "ModelFactory.java",
  "lineNumber": 100,
  "className": "org.springframework.web.method.annotation.ModelFactory",
  "methodName": "initModel",
  "nativeMethod": false
  },
  {
  "fileName": "RequestMappingHandlerAdapter.java",
  "lineNumber": 500,
  "className": "org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter",
  "methodName": "invokeHandlerMethod",
  "nativeMethod": false
  },
  {
  "fileName": "RequestMappingHandlerAdapter.java",
  "lineNumber": 465,
  "className": "org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter",
  "methodName": "handleInternal",
  "nativeMethod": false
  },
  {
  "fileName": "AbstractHandlerMethodAdapter.java",
  "lineNumber": 80,
  "className": "org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter",
  "methodName": "handle",
  "nativeMethod": false
  },
  {
  "fileName": "DispatcherServlet.java",
  "lineNumber": 863,
  "className": "org.springframework.web.servlet.DispatcherServlet",
  "methodName": "doDispatch",
  "nativeMethod": false
  },
  {
  "fileName": "BaseDispatcherServlet.java",
  "lineNumber": 31,
  "className": "com.locationguru.framework.base.BaseDispatcherServlet",
  "methodName": "doDispatch",
  "nativeMethod": false
  },
  {
  "fileName": "DispatcherServlet.java",
  "lineNumber": 792,
  "className": "org.springframework.web.servlet.DispatcherServlet",
  "methodName": "doService",
  "nativeMethod": false
  },
  {
  "fileName": "BaseDispatcherServlet.java",
  "lineNumber": 24,
  "className": "com.locationguru.framework.base.BaseDispatcherServlet",
  "methodName": "doService",
  "nativeMethod": false
  },
  {
  "fileName": "FrameworkServlet.java",
  "lineNumber": 851,
  "className": "org.springframework.web.servlet.FrameworkServlet",
  "methodName": "processRequest",
  "nativeMethod": false
  },
  {
  "fileName": "FrameworkServlet.java",
  "lineNumber": 767,
  "className": "org.springframework.web.servlet.FrameworkServlet",
  "methodName": "doPost",
  "nativeMethod": false
  },
  {
  "fileName": "HttpServlet.java",
  "lineNumber": 641,
  "className": "javax.servlet.http.HttpServlet",
  "methodName": "service",
  "nativeMethod": false
  },
  {
  "fileName": "BaseDispatcherServlet.java",
  "lineNumber": 38,
  "className": "com.locationguru.framework.base.BaseDispatcherServlet",
  "methodName": "service",
  "nativeMethod": false
  },
  {
  "fileName": "HttpServlet.java",
  "lineNumber": 722,
  "className": "javax.servlet.http.HttpServlet",
  "methodName": "service",
  "nativeMethod": false
  },
  {
  "fileName": "ApplicationFilterChain.java",
  "lineNumber": 304,
  "className": "org.apache.catalina.core.ApplicationFilterChain",
  "methodName": "internalDoFilter",
  "nativeMethod": false
  },
  {
  "fileName": "ApplicationFilterChain.java",
  "lineNumber": 210,
  "className": "org.apache.catalina.core.ApplicationFilterChain",
  "methodName": "doFilter",
  "nativeMethod": false
  },
  {
  "fileName": "OpenSessionInViewFilter.java",
  "lineNumber": 198,
  "className": "org.springframework.orm.hibernate3.support.OpenSessionInViewFilter",
  "methodName": "doFilterInternal",
  "nativeMethod": false
  },
  {
  "fileName": "OncePerRequestFilter.java",
  "lineNumber": 76,
  "className": "org.springframework.web.filter.OncePerRequestFilter",
  "methodName": "doFilter",
  "nativeMethod": false
  },
  {
  "fileName": "ApplicationFilterChain.java",
  "lineNumber": 243,
  "className": "org.apache.catalina.core.ApplicationFilterChain",
  "methodName": "internalDoFilter",
  "nativeMethod": false
  },
  {
  "fileName": "ApplicationFilterChain.java",
  "lineNumber": 210,
  "className": "org.apache.catalina.core.ApplicationFilterChain",
  "methodName": "doFilter",
  "nativeMethod": false
  },
  {
  "fileName": "StandardWrapperValve.java",
  "lineNumber": 224,
  "className": "org.apache.catalina.core.StandardWrapperValve",
  "methodName": "invoke",
  "nativeMethod": false
  },
  {
  "fileName": "StandardContextValve.java",
  "lineNumber": 185,
  "className": "org.apache.catalina.core.StandardContextValve",
  "methodName": "invoke",
  "nativeMethod": false
  },
  {
  "fileName": "AuthenticatorBase.java",
  "lineNumber": 472,
  "className": "org.apache.catalina.authenticator.AuthenticatorBase",
  "methodName": "invoke",
  "nativeMethod": false
  },
  {
  "fileName": "StandardHostValve.java",
  "lineNumber": 151,
  "className": "org.apache.catalina.core.StandardHostValve",
  "methodName": "invoke",
  "nativeMethod": false
  },
  {
  "fileName": "ErrorReportValve.java",
  "lineNumber": 100,
  "className": "org.apache.catalina.valves.ErrorReportValve",
  "methodName": "invoke",
  "nativeMethod": false
  },
  {
  "fileName": "AccessLogValve.java",
  "lineNumber": 929,
  "className": "org.apache.catalina.valves.AccessLogValve",
  "methodName": "invoke",
  "nativeMethod": false
  },
  {
  "fileName": "StandardEngineValve.java",
  "lineNumber": 118,
  "className": "org.apache.catalina.core.StandardEngineValve",
  "methodName": "invoke",
  "nativeMethod": false
  },
  {
  "fileName": "CoyoteAdapter.java",
  "lineNumber": 405,
  "className": "org.apache.catalina.connector.CoyoteAdapter",
  "methodName": "service",
  "nativeMethod": false
  },
  {
  "fileName": "Http11Processor.java",
  "lineNumber": 269,
  "className": "org.apache.coyote.http11.Http11Processor",
  "methodName": "process",
  "nativeMethod": false
  },
  {
  "fileName": "AbstractProtocol.java",
  "lineNumber": 515,
  "className": "org.apache.coyote.AbstractProtocol$AbstractConnectionHandler",
  "methodName": "process",
  "nativeMethod": false
  },
  {
  "fileName": "JIoEndpoint.java",
  "lineNumber": 300,
  "className": "org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor",
  "methodName": "run",
  "nativeMethod": false
  },
  {
  "fileName": "ThreadPoolExecutor.java",
  "lineNumber": 886,
  "className": "java.util.concurrent.ThreadPoolExecutor$Worker",
  "methodName": "runTask",
  "nativeMethod": false
  },
  {
  "fileName": "ThreadPoolExecutor.java",
  "lineNumber": 908,
  "className": "java.util.concurrent.ThreadPoolExecutor$Worker",
  "methodName": "run",
  "nativeMethod": false
  },
  {
  "fileName": "Thread.java",
  "lineNumber": 680,
  "className": "java.lang.Thread",
  "methodName": "run",
  "nativeMethod": false
  }
  ]
  }
  }
  </code></pre>
  
  <p>While the XML is still coming out correctly.</p>
  
  <p>Any Ideas?</p>