Are you aliasing the default object constructor to the DoctrineObjectConstructor
? E.g.
jms_serializer.object_constructor:
alias: jms_serializer.doctrine_object_constructor
If you are, it appears that the DoctrineObjectConstructor
assumes the use of Doctrine's ORM solution, not an ODM solution like MongoDB. Another user commented on the use of the DoctrineObjectConstructor
with MongoDB here.
In summary, you need to redefine the DoctrineObjectConstructor
with a reference to doctrine_mongodb
instead of doctrine
, e.g.:
jms_serializer.doctrine_object_constructor:
class: %jms_serializer.doctrine_object_constructor.class%
public: false
arguments: ["@doctrine_mongodb", "@jms_serializer.unserialize_object_constructor"]
Even if the issue isn't explicitly related to the DoctrineObjectConstructor
, you may find that the above solution can be translated to the service or object causing problems in your configuration.