DataTables warning: table=userTable - Invalid JSON response?

There are couple issues with your code:

  • You have enabled server-side processing mode with "serverSide": true but your data is formatted for client-side processing mode instead. Remove "serverSide": true to use client-side processing mode.

  • You need to use dataSrc: "" ash shown below to match your JSON data format, see dataSrc for more information.

    "ajax" : {
        "url" : "ListAllUserServlet",
        "type" : "POST",
        "dataSrc": ""
    },
    

Even though all data are showing correctly and also when you get this warning, it can be handled as,

$.fn.dataTable.ext.errMode = function(obj,param,err){
                var tableId = obj.sTableId;
                console.log('Handling DataTable issue of Table '+tableId);
        };