关于Json在SSh框架中出现的问题

异常信息:

10:13:48,540 DEBUG JSONUtil:72 - [JSON]{"exception":{"cause":{"cause":{"cause":{"cause":{"cause":{"cause":{"cause":
{"cause":null,"localizedMessage":"
{"className":"com.opensymphony.xwork2.interceptor.PrepareInterceptor","fileName":"PrepareInterceptor.java","lineNumber":171,"methodName":"doIntercept","nativeMethod":false}
,{"className":"com.opensymphony.xwork2.interceptor.MethodFilterInterceptor","fileName":"MethodFilterInterceptor.java","lineNumber":98,"methodName":"intercept","nativeMethod":false}
,{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},
{"className":"com.opensymphony.xwork2.interceptor.I18nInterceptor","fileName":"I18nInterceptor.java","lineNumber":139,"methodName":"intercept","nativeMethod":false},
{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},
{"className":"org.apache.struts2.interceptor.ServletConfigInterceptor","fileName":"ServletConfigInterceptor.java","lineNumber":164,"methodName":"intercept","nativeMethod":false},
{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},
{"className":"com.opensymphony.xwork2.interceptor.AliasInterceptor","fileName":"AliasInterceptor.java","lineNumber":193,"methodName":"intercept","nativeMethod":false},
{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},
{"className":"com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor","fileName":"ExceptionMappingInterceptor.java","lineNumber":189,"methodName":"intercept","nativeMethod":false},
{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},
{"className":"org.apache.struts2.impl.StrutsActionProxy","fileName":"StrutsActionProxy.java","lineNumber":54,"methodName":"execute","nativeMethod":false},
{"className":"org.apache.struts2.dispatcher.Dispatcher","fileName":"Dispatcher.java","lineNumber":562,"methodName":"serviceAction","nativeMethod":false},
{"className":"org.apache.struts2.dispatcher.ng.ExecuteOperations","fileName":"ExecuteOperations.java","lineNumber":77,"methodName":"executeAction","nativeMethod":false},
{"className":"org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter","fileName":"StrutsPrepareAndExecuteFilter.java","lineNumber":99,"methodName":"doFilter","nativeMethod":false},
{"className":"org.apache.catalina.core.ApplicationFilterChain","fileName":"ApplicationFilterChain.java","lineNumber":241,"methodName":"internalDoFilter","nativeMethod":false},
{"className":"org.apache.catalina.core.ApplicationFilterChain","fileName":"ApplicationFilterChain.java","lineNumber":208,"methodName":"doFilter","nativeMethod":false},
{"className":"org.apache.catalina.core.StandardWrapperValve","fileName":"StandardWrapperValve.java","lineNumber":220,"methodName":"invoke","nativeMethod":false},
{"className":"org.apache.catalina.core.StandardContextValve","fileName":"StandardContextValve.java","lineNumber":122,"methodName":"invoke","nativeMethod":false},
{"className":"org.apache.catalina.authenticator.AuthenticatorBase","fileName":"AuthenticatorBase.java","lineNumber":501,"methodName":"invoke","nativeMethod":false},
{"className":"org.apache.catalina.core.StandardHostValve","fileName":"StandardHostValve.java","lineNumber":171,"methodName":"invoke","nativeMethod":false},
{"className":"org.apache.catalina.valves.ErrorReportValve","fileName":"ErrorReportValve.java","lineNumber":102,"methodName":"invoke","nativeMethod":false},
{"className":"org.apache.catalina.valves.AccessLogValve","fileName":"AccessLogValve.java","lineNumber":950,"methodName":"invoke","nativeMethod":false},
{"className":"org.apache.catalina.core.StandardEngineValve","fileName":"StandardEngineValve.java","lineNumber":116,"methodName":"invoke","nativeMethod":false},
{"className":"org.apache.catalina.connector.CoyoteAdapter","fileName":"CoyoteAdapter.java","lineNumber":408,"methodName":"service","nativeMethod":false},
{"className":"org.apache.coyote.http11.AbstractHttp11Processor","fileName":"AbstractHttp11Processor.java","lineNumber":1040,"methodName":"process","nativeMethod":false},
{"className":"org.apache.coyote.AbstractProtocol$AbstractConnectionHandler","fileName":"AbstractProtocol.java","lineNumber":607,"methodName":"process","nativeMethod":false},
{"className":"org.apache.tomcat.util.net.AprEndpoint$SocketProcessor","fileName":"AprEndpoint.java","lineNumber":2442,"methodName":"doRun","nativeMethod":false}
,{"className":"org.apache.tomcat.util.net.AprEndpoint$SocketProcessor","fileName":"AprEndpoint.java","lineNumber":2431,"methodName":"run","nativeMethod":false},
{"className":"java.util.concurrent.ThreadPoolExecutor$Worker","fileName":"ThreadPoolExecutor.java","lineNumber":895,"methodName":"runTask","nativeMethod":false},
{"className":"java.util.concurrent.ThreadPoolExecutor$Worker","fileName":"ThreadPoolExecutor.java","lineNumber":918,"methodName":"run","nativeMethod":false},
{"className":"org.apache.tomcat.util.threads.TaskThread$WrappingRunnable","fileName":"TaskThread.java","lineNumber":61,"methodName":"run","nativeMethod":false},
{"className":"java.lang.Thread","fileName":"Thread.java","lineNumber":662,"methodName":"run","nativeMethod":false}],
"targetException":{"cause":null,"localizedMessage":"Dialect does not support identity key generation","message":"Dialect does not support identity key generation",
"stackTrace":[{"className":"org.hibernate.dialect.Dialect","fileName":"Dialect.java","lineNumber":549,"methodName":"getIdentitySelectString","nativeMethod":false},
{"className":"org.hibernate.dialect.Dialect","fileName":"Dialect.java","lineNumber":538,"methodName":"getIdentitySelectString","nativeMethod":false},
{"className":"org.hibernate.persister.entity.AbstractEntityPersister","fileName":"AbstractEntityPersister.java","lineNumber":2181,"methodName":"getIdentitySelectString","nativeMethod":false},
{"className":"sun.reflect.NativeMethodAccessorImpl","fileName":"NativeMethodAccessorImpl.java","lineNumber":-2,"methodName":"invoke0","nativeMethod":true},
{"className":"sun.reflect.NativeMethodAccessorImpl","fileName":"NativeMethodAccessorImpl.java","lineNumber":39,"methodName":"invoke","nativeMethod":false}
,{"className":"sun.reflect.DelegatingMethodAccessorImpl","fileName":"DelegatingMethodAccessorImpl.java","lineNumber":25,"methodName":"invoke","nativeMethod":false},
{"className":"java.lang.reflect.Method","fileName":"Method.java","lineNumber":597,"methodName":"invoke","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":226,"methodName":"bean","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":178,"methodName":"processCustom","nativeMethod":false}
,{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":168,"methodName":"process","nativeMethod":false}
,{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":134,"methodName":"value","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":436,"methodName":"map","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":154,"methodName":"process","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":134,"methodName":"value","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":390,"methodName":"add","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":231,"methodName":"bean","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":178,"methodName":"processCustom","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":168,"methodName":"process","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":134,"methodName":"value","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":390,"methodName":"add","nativeMethod":false}
,{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":231,"methodName":"bean","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":178,"methodName":"processCustom","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":168,"methodName":"process","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":134,"methodName":"value","nativeMethod":false}
,{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":390,"methodName":"add","nativeMethod":false},
{"{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":134,"methodName":"value","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":390,"methodName":"add","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":231,"methodName":"bean","nativeMethod":false}
,{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":178,"methodName":"processCustom","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":168,"methodName":"process","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":134,"methodName":"value","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":102,"methodName":"write","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONUtil","fileName":"JSONUtil.java","lineNumber":116,"methodName":"serialize","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONResult","fileName":"JSONResult.java","lineNumber":202,"methodName":"createJSONString","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONResult","fileName":"JSONResult.java","lineNumber":176,"methodName":"execute","nativeMethod":false},
{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":371,"methodName":"executeResult","nativeMethod":false},
{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":275,"methodName":"invoke","nativeMethod":false},
{"className":"org.apache.struts2.interceptor.DeprecationInterceptor","fileName":"DeprecationInterceptor.java","lineNumber":41,"methodName":"intercept","nativeMethod":false},
{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},
{"className":"org.apache.struts2.interceptor.debugging.DebuggingInterceptor","fileName":"DebuggingInterceptor.java","lineNumber":256,"methodName":"intercept","nativeMethod":false},
{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},
{"className":"com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor","fileName":"DefaultWorkflowInterceptor.java","lineNumber":167,"methodName":"doIntercept","nativeMethod":false}
,{"className":"com.opensymphony.xwork2.interceptor.MethodFilterInterceptor","fileName":"MethodFilterInterceptor.java","lineNumber":98,"methodName":"intercept","nativeMethod":false},
{{"className":"com.opensymphony.xwork2.interceptor.MethodFilterInterceptor","fileName":"MethodFilterInterceptor.java","lineNumber":98,"methodName":"intercept","nativeMethod":false},
{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},
{"className":"com.opensymphony.xwork2.interceptor.StaticParametersInterceptor","fileName":"StaticParametersInterceptor.java","lineNumber":191,"methodName":"intercept","nativeMethod":false}
,{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false}
,{"className":"org.apache.struts2.interceptor.MultiselectInterceptor","fileName":"MultiselectInterceptor.java","lineNumber":73,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"org.apache.struts2.interceptor.CheckboxInterceptor","fileName":"CheckboxInterceptor.java","lineNumber":91,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"org.apache.struts2.interceptor.FileUploadInterceptor","fileName":"FileUploadInterceptor.java","lineNumber":252,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor","fileName":"ModelDrivenInterceptor.java","lineNumber":100,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},
{"className":"com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor","fileName":"ScopedModelDrivenInterceptor.java","lineNumber":141,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"com.opensymphony.xwork2.interceptor.ChainingInterceptor","fileName":"ChainingInterceptor.java","lineNumber":145,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"com.opensymphony.xwork2.interceptor.PrepareInterceptor","fileName":"PrepareInterceptor.java","lineNumber":171,"methodName":"doIntercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.interceptor.MethodFilterInterceptor","fileName":"MethodFilterInterceptor.java","lineNumber":98,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"com.opensymphony.xwork2.interceptor.I18nInterceptor","fileName":"I18nInterceptor.java","lineNumber":139,"methodName":"intercept","nativeMethod":false},
{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"org.apache.struts2.interceptor.ServletConfigInterceptor","fileName":"ServletConfigInterceptor.java","lineNumber":164,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"com.opensymphony.xwork2.interceptor.AliasInterceptor","fileName":"AliasInterceptor.java","lineNumber":193,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor","fileName":"ExceptionMappingInterceptor.java","lineNumber":189,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"org.apache.struts2.impl.StrutsActionProxy","fileName":"StrutsActionProxy.java","lineNumber":54,"methodName":"execute","nativeMethod":false},
{"className":"org.apache.struts2.dispatcher.Dispatcher","fileName":"Dispatcher.java","lineNumber":562,"methodName":"serviceAction","nativeMethod":false},{"className":"org.apache.struts2.dispatcher.ng.ExecuteOperations","fileName":"ExecuteOperations.java","lineNumber":77,"methodName":"executeAction","nativeMethod":false},{"className":"org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter","fileName":"StrutsPrepareAndExecuteFilter.java","lineNumber":99,"methodName":"doFilter","nativeMethod":false},{"className":"org.apache.catalina.core.ApplicationFilterChain","fileName":"ApplicationFilterChain.java","lineNumber":241,"methodName":"internalDoFilter","nativeMethod":false},{"className":"org.apache.catalina.core.ApplicationFilterChain","fileName":"ApplicationFilterChain.java","lineNumber":208,"methodName":"doFilter","nativeMethod":false},{"className":"org.apache.catalina.core.StandardWrapperValve","fileName":"StandardWrapperValve.java","lineNumber":220,"methodName":"invoke","nativeMethod":false},{"className":"org.apache.catalina.core.StandardContextValve","fileName":"StandardContextValve.java","lineNumber":122,"methodName":"invoke","nativeMethod":false},{"className":"org.apache.catalina.authenticator.AuthenticatorBase","fileName":"AuthenticatorBase.java","lineNumber":501,"methodName":"invoke","nativeMethod":false},
{"className":"org.apache.catalina.core.StandardHostValve","fileName":"StandardHostValve.java","lineNumber":171,"methodName":"invoke","nativeMethod":false},{"className":"org.apache.catalina.valves.ErrorReportValve","fileName":"ErrorReportValve.java","lineNumber":102,"methodName":"invoke","nativeMethod":false},{"className":"org.apache.catalina.valves.AccessLogValve","fileName":"AccessLogValve.java","lineNumber":950,"methodName":"invoke","nativeMethod":false},{"className":"org.apache.catalina.core.StandardEngineValve","fileName":"StandardEngineValve.java","lineNumber":116,"methodName":"invoke","nativeMethod":false},{"className":"org.apache.catalina.connector.CoyoteAdapter","fileName":"CoyoteAdapter.java","lineNumber":408,"methodName":"service","nativeMethod":false},{"className":"org.apache.coyote.http11.AbstractHttp11Processor","fileName":"AbstractHttp11Processor.java","lineNumber":1040,"methodName":"process","nativeMethod":false},{"className":"org.apache.coyote.AbstractProtocol$AbstractConnectionHandler","fileName":"AbstractProtocol.java","lineNumber":607,"methodName":"process","nativeMethod":false},{"className":"org.apache.tomcat.util.net.AprEndpoint$SocketProcessor","fileName":"AprEndpoint.java","lineNumber":2442,"methodName":"doRun","nativeMethod":false},{"className":"org.apache.tomcat.util.net.AprEndpoint$SocketProcessor","fileName":"AprEndpoint.java","lineNumber":2431,"methodName":"run","nativeMethod":false},{"className":"java.util.concurrent.ThreadPoolExecutor$Worker","fileName":"ThreadPoolExecutor.java","lineNumber":895,"methodName":"runTask","nativeMethod":false},
{"className":"java.util.concurrent.ThreadPoolExecutor$Worker","fileName":"ThreadPoolExecutor.java","lineNumber":918,"methodName":"run","nativeMethod":false},{"className":"org.apache.tomcat.util.threads.TaskThread$WrappingRunnable","fileName":"TaskThread.java","lineNumber":61,"methodName":"run","nativeMethod":false},{"className":"java.lang.Thread","fileName":"Thread.java","lineNumber":662,"methodName":"run","nativeMethod":false}]}},"localizedMessage":"java.lang.reflect.InvocationTargetException","message":"java.lang.reflect.InvocationTargetException","stackTrace":[{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":246,"methodName":"bean","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":178,"methodName":"processCustom","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":168,"methodName":"process","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":134,"methodName":"value","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":436,"methodName":"map","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":154,"methodName":"process","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":134,"methodName":"value","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":390,"methodName":"add","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":231,"methodName":"bean","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":178,"methodName":"processCustom","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":168,"methodName":"process","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":134,"methodName":"value","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":390,"methodName":"add","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":231,"methodName":"bean","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":178,"methodName":"processCustom","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":168,"methodName":"process","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":134,"methodName":"value","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":390,"methodName":"add","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":231,"methodName":"bean","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":178,"methodName":"processCustom","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":168,"methodName":"process","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":134,"methodName":"value","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":390,"methodName":"add","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":231,"methodName":"bean","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":178,"methodName":"processCustom","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":168,"methodName":"process","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":134,"methodName":"value","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":390,"methodName":"add","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":231,"methodName":"bean","nativeMethod":false},
{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":178,"methodName":"processCustom","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":168,"methodName":"process","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":134,"methodName":"value","nativeMethod":false},{"className":"org.apache.struts2.json.JSONWriter","fileName":"JSONWriter.java","lineNumber":102,"methodName":"write","nativeMethod":false},{"className":"org.apache.struts2.json.JSONUtil","fileName":"JSONUtil.java","lineNumber":116,"methodName":"serialize","nativeMethod":false},{"className":"org.apache.struts2.json.JSONResult","fileName":"JSONResult.java","lineNumber":202,"methodName":"createJSONString","nativeMethod":false},{"className":"org.apache.struts2.json.JSONResult","fileName":"JSONResult.java","lineNumber":176,"methodName":"execute","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":371,"methodName":"executeResult","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":275,"methodName":"invoke","nativeMethod":false},{"className":"org.apache.struts2.interceptor.DeprecationInterceptor","fileName":"DeprecationInterceptor.java","lineNumber":41,"methodName":"intercept","nativeMethod":false},
{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"org.apache.struts2.interceptor.debugging.DebuggingInterceptor","fileName":"DebuggingInterceptor.java","lineNumber":256,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor","fileName":"DefaultWorkflowInterceptor.java","lineNumber":167,"methodName":"doIntercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.interceptor.MethodFilterInterceptor","fileName":"MethodFilterInterceptor.java","lineNumber":98,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"com.opensymphony.xwork2.validator.ValidationInterceptor","fileName":"ValidationInterceptor.java","lineNumber":265,"methodName":"doIntercept","nativeMethod":false},{"className":"org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor","fileName":"AnnotationValidationInterceptor.java","lineNumber":68,"methodName":"doIntercept","nativeMethod":false},
{"className":"com.opensymphony.xwork2.interceptor.MethodFilterInterceptor","fileName":"MethodFilterInterceptor.java","lineNumber":98,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor","fileName":"ConversionErrorInterceptor.java","lineNumber":138,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"com.opensymphony.xwork2.interceptor.ParametersInterceptor","fileName":"ParametersInterceptor.java","lineNumber":254,"methodName":"doIntercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.interceptor.MethodFilterInterceptor","fileName":"MethodFilterInterceptor.java","lineNumber":98,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"com.opensymphony.xwork2.interceptor.ParametersInterceptor","fileName":"ParametersInterceptor.java","lineNumber":254,"methodName":"doIntercept","nativeMethod":false},
{"className":"com.opensymphony.xwork2.interceptor.MethodFilterInterceptor","fileName":"MethodFilterInterceptor.java","lineNumber":98,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"com.opensymphony.xwork2.interceptor.StaticParametersInterceptor","fileName":"StaticParametersInterceptor.java","lineNumber":191,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"org.apache.struts2.interceptor.MultiselectInterceptor","fileName":"MultiselectInterceptor.java","lineNumber":73,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"org.apache.struts2.interceptor.CheckboxInterceptor","fileName":"CheckboxInterceptor.java","lineNumber":91,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},{"className":"org.apache.struts2.interceptor.FileUploadInterceptor","fileName":"FileUploadInterceptor.java","lineNumber":252,"methodName":"intercept","nativeMethod":false},{"className":"com.opensymphony.xwork2.DefaultActionInvocation","fileName":"DefaultActionInvocation.java","lineNumber":246,"methodName":"invoke","nativeMethod":false},
{"className":"org.apache.catalina.connector.CoyoteAdapter","fileName":"CoyoteAdapter.java","lineNumber":408,"methodName":"service","nativeMethod":false},{"className":"org.apache.coyote.http11.AbstractHttp11Processor","fileName":"AbstractHttp11Processor.java","lineNumber":1040,"methodName":"process","nativeMethod":false},{"className":"org.apache.coyote.AbstractProtocol$AbstractConnectionHandler","fileName":"AbstractProtocol.java","lineNumber":607,"methodName":"process","nativeMethod":false},{"className":"org.apache.tomcat.util.net.AprEndpoint$SocketProcessor","fileName":"AprEndpoint.java","lineNumber":2442,"methodName":"doRun","nativeMethod":false},{"className":"org.apache.tomcat.util.net.AprEndpoint$SocketProcessor","fileName":"AprEndpoint.java","lineNumber":2431,"methodName":"run","nativeMethod":false},{"className":"java.util.concurrent.ThreadPoolExecutor$Worker","fileName":"ThreadPoolExecutor.java","lineNumber":895,"methodName":"runTask","nativeMethod":false},{"className":"java.util.concurrent.ThreadPoolExecutor$Worker","fileName":"ThreadPoolExecutor.java","lineNumber":918,"methodName":"run","nativeMethod":false},{"className":"org.apache.tomcat.util.threads.TaskThread$WrappingRunnable","fileName":"TaskThread.java","lineNumber":61,"methodName":"run","nativeMethod":false},{"className":"java.lang.Thread","fileName":"Thread.java","lineNumber":662,"methodName":"run","nativeMethod":false}]},"localizedMessage":"org.apache.struts2.json.JSONException: java.lang.reflect.InvocationTargetException","message":"org.apache.struts2.json.JSONException: java.lang.reflect.InvocationTargetException",

以上是异常信息

-------------------------------------------------------------------------------------------------------

<script type="text/javascript" src="js/jquery-1.7.2.js"></script>    
<script type="text/javascript" >
     $(function(){
       $("#rname").blur(function(){
         var rname=$(this).val();
          $.ajax({
       url:"user/checkname",
       data:"rname="+rname,
       type:"post",
       dataType:"text",
       success:function(data){
      $("#span1").html($.parseJSON(data).msg);
       
       },
       error:function(msg){
        $("#span1").html($.parseJSON(data).msg); 
       
       }             
       });     
     });
     } );
     
</script>

上面为前端jsp页面Json数据的传输和接收

--------------------------------------------------------

public class UsersAction extends ActionSupport{
    private UsersService ;
    private Users ;
    private int ;        
    Map<String,Object> session=ActionContext.getContext().getSession();        
    private String rname;    
    private String ;        
    public String checkname() {        
      int i=us.findName(rname);            
       if(i==1){              
          msg="用户名已经存在";            
            return "success";        
              }else{             
                 msg="用户名正确";         
                    return  "error";        }                    }
   public UsersService getUs() {        
          return us;    }    
     public void setUs(UsersService us) {     
       this.us = us;    }    
   public Users getUsers() {     
      return users;    }  
    public void setUsers(Users users) {     
       this.users = users;    }    
    public int getPermission() {       
     return permission;    } 
   public void setPermission(int permission) {   
        this.permission = permission;    }   
    public String getRname() {     
       return rname;    }    
    public void setRname(String rname) {      
      this.rname = rname;    }    
    public String getMsg() {       
     return msg;    }    
    public void setMsg(String msg) {     
       this.msg = msg;    
       }
       
       }

简单的将实现的验证Action后台的数据粘在这里,具体的就不多复制

--------------------------------------------------------

struts的配置文件内容:

<action name="checkname" class="action.UsersAction" method="checkname">       
    <result name="success"  type="json">  </result>      
     <result name="error" type="json"></result>
<interceptor-ref name="defaultStack"></interceptor-ref>
 </action>

打算获取文件所有的属性的值

------------------------------------------------------

实体类的配置文件:

<hibernate-mapping package="entity"> <class name="entity.Users" schema="SCOTT" table="USER1"> 
 <id name="id" type="java.lang.Integer">   
 <generator >
 </generator>  
 </id>
//其他配置省略

使用的<generator class="assigned"></generator>属性为assigned

开始查找以为是实体类配置问题,按网上有的说法是:<generator class="assigned"/>中的assigned为identity   可是检查半天也不是,而且配置方言也没有问题,怀疑过是否是dao的底层实现类造成的,用debug跟半天也没发现异常出现,一直执行到action返回"success"后,myEclipse出现死机,猛然蹦出开头复制的异常.据此推测就是struts2的配置出现的问题,后来更改的:

<action name="checkname" class="action.UsersAction" method="checkname">
           <result name="success"  type="json"> 
                        
           </result>           
           <result name="error" type="json">
             
           </result>
          <interceptor-ref name="defaultStack"></interceptor-ref>
         </action>

将里面的参数进行细化加上了name="includeProperties"可以获取msg的值,单个获取us,users,rname,permission均可以将其传到前端的jsp页面 但是整体获得却不可以

由此可见对于获取特定的信息时明确所获得的数据进行限制

时间: 2024-10-12 13:25:20

关于Json在SSh框架中出现的问题的相关文章

spring在SSH框架中的作用

从网上了搜了下sring 在ssh中起的作用,在百度知道上看到下面的回答,觉得简单移动,记录下来备查,原文地址: http://zhidao.baidu.com/link?url=JiONrax-Flkpi5hqs_g1HQOrMm1Dk8U1WT88l5T0Gg01bm3M8fMcjUCpqastVxQTd63gxUl5NLyHUQPdq6E-OK 在SSH框假中spring充当了管理容器的角色.我们都知道Hibernate用来做持久层,因为它将JDBC做了一个良好的封装,程序员在与数据库进行

在SSH框架中,如何得到POST请求的URL和参数列表

在做项目的API通知接口的时候,发现在SSH框架中无法获取到对方服务器发来的异步通知信息.最后排查到的原因可能是struts2对HttpServletRequest进行了二次处理,那么该如何拿到post的请求数据呢,方法很多,下面只给出一种方式. 在servlet中GET请求可以通过HttpServletRequest的getRequestURL方法和getQueryString()得到完 整的请求路径和请求所有参数列表, POST的需要getParameterMap()方法遍历得到,不论GET

ssh框架中.xml文件小技巧分离xml

struts.xml文件 struts.xml文件里的action可以分离出来,如: <!-- 预警信息监测 --> <include file="config/struts/warningInformAtion-struts.xml"></include> 注: include是放在</struts>标签的前面 在src下面新建 package 名为:config.struts,再新建xml文件为warningInformAtion-s

在SSH框架中使用Spring的好处(转)

以下是我总结下今天笔试中SSh中的总结: 在SSH框架中spring充当了管理容器的角色.我们都知道Hibernate用来做持久层,因为它将JDBC做了一个良好的封装,程序员在与数据库进行交互时可以不用书写大量的SQL语句.Struts是用来做应用层的,他它负责调用业务逻辑serivce层.所以SSH框架的流程大致是:Jsp页面----Struts------Service(业务逻辑处理类)---Hibernate(左到右)    struts负责控制Service(业务逻辑处理类),从而控制了

SSH框架中hibernate 出现 user is not mapped 问题

SSH框架中hibernate 出现 user is not mapped 问题 在做SSH框架整合时,在进行DAO操作时.这里就只调用了chekUser()方法.运行时报  user is not mapped 错误 :  chekUser()方法如下:  public boolean chekUser(User user){           String hql="from user u where u.id=? and u.name=?";        Query quer

SSH框架中session问题

使用SSH框架做项目的时候避免不了使用session,有时候使用session会很方便,但是有时候也是个很麻烦的事情,我今天就遇到一个这样的情况,搞的我很不爽,还是记录一下吧. 首先是登录的时候,如果用户名密码正确就把该用户的信息存到session中去, //登录成功后将用户信息保存到session中 SessionUtils.setSysUserToSession(request, sysUser); /** * 保存当前登录用户的信息到session中去 * @param request *

SSH框架中Spring框架搭建的初步理解(一)

接手基于SSH框架的web项目已经一个月有余了.早有听说javaweb三大框架,第一次接触,先来说下感受. 我感觉SSH框架最明显的优点有如下: 采用MVC模式,层次结构清晰,使程序员只需关注业务逻辑的实现. 通过配置文件,就可以掌握整个系统各个部分之间的关系. 通过AOP,可以实现事务管理和日志管理. 其中Spring框架能使你通过最简单可行的方法来解决问题,这是非常高效的.但是它的搭建也略微复杂,尤其是对于我这样的新手来说,所以开此篇记录一下SPring框架的搭建: 创建web项目,导入SS

SSH框架中spring的原理

在ssh项目中,是有明确分工的,spring的作用就相当于将struts和hibernate连接起来,是将两个没有关系的框架的特性,方法,action都放在spring的配置文件中使他们建立关系.取他门各自所长.而这些做法他们自己不知道,他们是听命于spring调度的,他的的任务只是做好自己的事情.    这样做的好处就是任务结构分明,struts只管理显示与做什么,hibernate只关心怎么做,而spring就相当于领导,所以一切的类都要交给spring的工厂创建,这是一种良好的开发模式,体

在SSH框架中使用Spring的好处

在SSH框假中spring充当了管理容器的角色.我们都知道Hibernate用来做持久层,因为它将JDBC做了一个良好的封装,程序员在与数据库进行交互时可以不用书写大量的SQL语句.Struts是用来做应用层的,他它负责调用业务逻辑serivce层.所以SSH框架的流程大致是:Jsp页面----Struts------Service(业务逻辑处理类)---Hibernate(左到右)   struts负责控制Service(业务逻辑处理类),从而控制了Service的生命周期,这样层与层之间的依