Java serialization of RESTful interface calls

Source: Internet
Author: User

Some time ago, when doing an internal data processing project, there would be HTTP service calls between the systems, and we were using spring rest programming, which is the resttemplate implementation provided by spring.

After the data in the program is read in the Excel file, the RESTful interface is sent back to the backend, since the transmitted data is a collection of array types, but when acquired in the background, the data type is programmed with the ArrayList type, the result may be known, and the error is made when forcing the type conversion to Java. Lang. ClassCastException.

Later found the reason to find that the call to the RESTful interface, the transmitted data type should be to implement the serialization interface is serializable, because the array is not a certain type, not to mention serialization, all later instead of using ArrayList to do the data carrier is OK.


Java serialization of RESTful interface calls

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.