After building the SPRING3+MYBATIS+REST+BOOTSTRAP+JBPM project environment, the test found a fucking problem.
When using spring MVC's automatic type conversion to JSON, background data list/map get completely normal, but JS gets the data report 500 error.
There is no exception information in the background.
Problem Solving Ideas:
The background data is working properly, the data returns to the front-end exception, and the problem is centered on the spring's Jackson JSON conversion.
And spring uses the third-party Jackson JSON data conversion, the exception information to rely on it, the code to add the following parts:
1 /**2 * Check all records of the bank3 * @paramreq4 * @paramModel5 * @return6 */7 @RequestMapping8 @ResponseBody9 PublicMap<string, object>Getallrecord (httpservletrequest req,Ten Modelmap model) { OneList<questionwh> allquestions =questionwhservice.selectallquestionwh (); AModel.put ("Aadata", allquestions); -Model.put ("Itotalrecords", Allquestions.size ()); -Model.put ("Itotaldisplayrecords", Allquestions.size ()); the - //testing The Jackson JSON transformation of the returned object -Objectmapper om =NewObjectmapper (); - Try { + om.writevalueasstring (allquestions); -}Catch(jsongenerationexception e) { + e.printstacktrace (); A}Catch(jsonmappingexception e) { at e.printstacktrace (); -}Catch(IOException e) { - e.printstacktrace (); - } - - returnmodel; in}
The exception message was successfully typed as follows:
for class Java.io.ByteArrayInputStream and no properties discovered to create Beanserializer (to avoid exception, dis Able SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS) (through reference chain:java.util.arraylist[0]-> java.util.hashmap["Createtime"]->oracle.sql.timestamp["Stream"])
The exception is found, the solution is very simple.
Internal Server error Handling scheme when returning JSON string in SpringMVC3