Unexpected response code 500 Android
<p>This is my code...</p>

<pre><code>      b2 = (Button) findViewById(R.id.button3);
    b2.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            getResults();
            StringRequest request= new StringRequest(Request.Method.POST, server_url, new Response.Listener&lt;String&gt;() {
                @Override
                public void onResponse(String response) {

                }
            }, new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {

                }
            }){
protected Map&lt;String,String&gt;getParams() throws AuthFailureError{
Map&lt;String,String&gt; parameters = new HashMap&lt;String, String&gt;();
getResults().put(parameters);
return parameters;

}
            };
                requestQueue.add(request);


        }
    });
}


private JSONArray getResults() {

    String myPath = "/data/data/com.example.sebastian.patientdetails/databases/" + "MyDBName.db";

    String myTable = "patients";


    SQLiteDatabase myDataBase = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);

    String searchQuery = "SELECT  * FROM " + myTable;
    Cursor cursor = myDataBase.rawQuery(searchQuery, null);

    JSONArray resultSet = new JSONArray();

    cursor.moveToFirst();
    JSONArray jsonArray = null;
    while (!cursor.isAfterLast()) {

        int totalColumn = cursor.getColumnCount();
        JSONObject rowObject = new JSONObject();
        //new jsonarray
        jsonArray = new JSONArray();
        for (int i = 0; i &lt; totalColumn; i++) {
            if (cursor.getColumnName(i) != null) {
                //new jsonarray of items jsonObject
                JSONObject object = new JSONObject();
                try {
                    if (cursor.getString(i) != null) {
                        Log.d("TAG_NAME", cursor.getString(i));
                        object.put(cursor.getColumnName(i), cursor.getString(i));

                    } else {
                        object.put(cursor.getColumnName(i), "");
                    }
                    //put  jsonarray
                    jsonArray.put(object);
                } catch (Exception e) {
                    Log.d("TAG_NAME", e.getMessage());
                }
            }
        }
        //put request jsonobject
        jsonArray.put(rowObject);
        resultSet.put(rowObject);
        cursor.moveToNext();
    }


    return jsonArray;
}


}
</code></pre>

<p>When i click the button to sent my json object to server i got this error ' Unexpected response code 500 ' . Whats the reason. How can i fix this issue. Is there any issue in converting my sqlite to json object.?</p>