Wednesday, October 22, 2014

[Semantical Error] in Apigility and Symfony2 with MongoDB

If you encountered similar error below when you send a request to your Apigility REST service:
type: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html,
title: "Internal Server Error",
status: 500,
detail: "[Semantical Error] The annotation \"@Doctrine\\ODM\\MongoDB\\Mapping\\Annotations\\ReferenceOne\" in property Shop\\StoreBundle\\Document\\Product::$shop does not exist, or could not be auto-loaded."
You made some changes in your MongoDB Document and somehow corrupted the app/cache/dev of your Symfony2 installation.

Quick Fix

Delete the app/cache/dev directory in your Symfony2 installation then visit your Symfony2 application page in your browser e.g. http://acmestore.local/app_dev.php/hello/user, Symfony2 will create new app/cache/dev directory then try sending your request to your Apigility REST service.

No comments:

Post a Comment