You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have asked this question in StackOverflow before FOSRestBundle and JMS Serializer, error when geting JSON, and there was a good answer walking me through the correct way to setup the application, which I had before I decided to post the question. I decided to use Doctrine ORM rather than MongoDB ODM and the code worked.
Basically every time I request json or xml formats I get an error, I don't have the same problem if I request HTML format.
I'm wondering if there may be an issue with the latest version of the FOSRestBundle and the JMSSerializer when using Doctrine MongoDB ODM?
Well, from what I see in the stack trace, you are trying to serialize your logger, which contains a resource and so cannot be serialized.
It is because you are serializing a Doctrine\ODM\MongoDB\LoggableCursor which contains a reference to the Connection which itself contains the logger
I found a workaround to this issue, you can see the updated question in SO, although I don't think is ideal.
I'm still wondering what would be the best way to address this problem. If Doctrine ODM returns cursor for any query that contains more than one result... well that means Doctrine ODM can not be used out of the box with the serializer :( . Any alternatives other than my workaround?
I have asked this question in StackOverflow before FOSRestBundle and JMS Serializer, error when geting JSON, and there was a good answer walking me through the correct way to setup the application, which I had before I decided to post the question. I decided to use Doctrine ORM rather than MongoDB ODM and the code worked.
Basically every time I request json or xml formats I get an error, I don't have the same problem if I request HTML format.
I'm wondering if there may be an issue with the latest version of the FOSRestBundle and the JMSSerializer when using Doctrine MongoDB ODM?
This is the full error message I get.
The text was updated successfully, but these errors were encountered: