Home  >  Forum  >  Spring
Post New Query

Response status 500 error



Asked on January 10, 2018
Hello,

I have spring micro-service project, when i login first time it works properly after some time if i hit continuously to end point it starts giving error code 500.

Can anyone give me the solution?

Thanks & Regards
Anita



Replied on January 11, 2018
Check your log file for any error. 
500 is Internal Server Error. Application is throwing error such as Null Pointer Exception. That is why you are 500 status code. 



Replied on January 16, 2018
Hello @amit,

Thank you for the reply.

Now i am not getting 500 error, but i am getting error like "JSON.parse: unexpected end of data at line 1 column 1 of the JSON data". In my java backend data printing properly but in angular 2 i am facing that error.

private extractData(res: Response) {
let body = res.json();
return body;
}
 the above function should return the json but i get exception when i continuously hit the url and throwing the exception.

Kindly help me out in this.

Thanks



Replied on January 16, 2018
According to error, something is wrong in JSON fromat and that is why you are getting JSON.parse error.
Error says that unexpected end of data in your JSON. 

Provide your sample JSON data from backend.





Replied on January 17, 2018
Hello @amit,

[{"pk_location_id":1,"tenant_id":null,"locationname":"India","locationpath":null,"location_phone":"9972317626","location_fax":null,"locationcode":"loc01","location_user_license_code":null,"location_license":null,"location_description":null,"location_area":null,"location_district":null,"location_street_address_1":null,"location_street_address_2":null,"location_city":null,"location_state":null,"location_postal_code":null,"location_country":"India","location_roles_id":null,"parent_location_id":0,"created_date":null,"modified_date":null,"deleted":0,"has_children":true},{"pk_location_id":2,"tenant_id":null,"locationname":"Karnataka","locationpath":"/[India]","location_phone":"9448124312","location_fax":null,"locationcode":"loc02","location_user_license_code":null,"location_license":null,"location_description":null,"location_area":null,"location_district":null,"location_street_address_1":null,"location_street_address_2":null,"location_city":null,"location_state":null,"location_postal_code":null,"location_country":"India","location_roles_id":null,"parent_location_id":1,"created_date":null,"modified_date":null,"deleted":0,"has_children":false}]

the above format is my json data.



Replied on January 17, 2018
JSON is valid. You need to debug more to find the exact error.

Write Answer




©2019 concretepage.com | Privacy Policy | Contact Us