-1

Currently, I'm working with Rest and Spring. The database is MongoDB.

I have a function which returns DBcursor as the response. Data extraction from MongoDB is working fine, but the response is:

'No message body has been found for response class DBCursor'

Is there any way to solve this??

1 Answers1

0

Doing a quick search with Google I have been able to locate some info on this (1)(2).

You don't specify if you are programming in Java, but all associated problems appear to be Java related, so I'm assuming yours probably is too. It looks like your problem might be related to the incorrect usage or absence of @XmlRootElement in your code, so I would look into that.

Hope this points you in the right track.

Pau Garcia
  • 45
  • 5
  • Yes Its java. But actually, i need response as json Not xml – Sreerag A.K May 23 '19 at 05:49
  • In that case I believe you should check documentation on how to use a similar directive to do it in JSON instead of XML. With a quick search in Stackoverflow I found some related use cases, I think. As I don't know that much about this functionality you are trying to use, all I can recommend is that you find and use the related documentation for this. Good luck! – Pau Garcia May 23 '19 at 10:53