title: FOS\OAuthServerBundle unrecognized field error
body: <p>In Symfony2 I'm trying to implement FOS\OAuthServerBundle, but am getting a weird error. After following the guide <a href="http://blog.tankist.de/blog/2013/07/17/oauth2-explained-part-2-setting-up-oauth2-with-symfony2-using-fosoauthserverbundle/" rel="nofollow">here</a> and also the <a href="https://github.com/FriendsOfSymfony/FOSOAuthServerBundle/blob/master/Resources/doc/index.md" rel="nofollow">official guide on GitHub</a>, I'm met with an error that says:</p>
  
  <pre><code>Unrecognized field: randomId
  500 Internal Server Error - ORMException
  </code></pre>
  
  <p>This is a protected variable in the Client Entity/Model in FOS\OAuthServerBundle. I must be missing something simple here, but for the life of me I can not figure out what. </p>
  
  <p>Has anyone else experienced a similar error to this?</p>
  
  <p>This error happens when trying to go to:</p>
  
  <pre><code>http://symfony.local/app_dev.php/oauth/v2/token?grant_type=client_credentials&amp;client_id=fd87dddb-6c29-11e4-90f3-b8ca3aa16897_fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk&amp;client_secret=[secret redacted]
  </code></pre>
  
  <h3>Stack trace</h3>
  
  <pre><code>Doctrine\ORM\ORMException: Unrecognized field: randomId
  at n/a
      in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php line 100
  
  at Doctrine\ORM\ORMException::unrecognizedField('randomId')
      in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 1681
  
  at Doctrine\ORM\Persisters\BasicEntityPersister-&gt;getSelectConditionStatementColumnSQL('randomId', null)
      in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 1610
  
  at Doctrine\ORM\Persisters\BasicEntityPersister-&gt;getSelectConditionStatementSQL('randomId', 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk', null)
      in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 1701
  
  at Doctrine\ORM\Persisters\BasicEntityPersister-&gt;getSelectConditionSQL(array('id' =&gt; 'fd87dddb-6c29-11e4-90f3-b8ca3aa16897', 'randomId' =&gt; 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk'), null)
      in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 1115
  
  at Doctrine\ORM\Persisters\BasicEntityPersister-&gt;getSelectSQL(array('id' =&gt; 'fd87dddb-6c29-11e4-90f3-b8ca3aa16897', 'randomId' =&gt; 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk'), null, '0', '1', null, null)
      in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 746
  
  at Doctrine\ORM\Persisters\BasicEntityPersister-&gt;load(array('id' =&gt; 'fd87dddb-6c29-11e4-90f3-b8ca3aa16897', 'randomId' =&gt; 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk'), null, null, array(), '0', '1', null)
      in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php line 196
  
  at Doctrine\ORM\EntityRepository-&gt;findOneBy(array('id' =&gt; 'fd87dddb-6c29-11e4-90f3-b8ca3aa16897', 'randomId' =&gt; 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk'))
      in /home/johnny/Development/symfonyProject/vendor/friendsofsymfony/oauth-server-bundle/FOS/OAuthServerBundle/Entity/ClientManager.php line 55
  
  at FOS\OAuthServerBundle\Entity\ClientManager-&gt;findClientBy(array('id' =&gt; 'fd87dddb-6c29-11e4-90f3-b8ca3aa16897', 'randomId' =&gt; 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk'))
      in /home/johnny/Development/symfonyProject/vendor/friendsofsymfony/oauth-server-bundle/FOS/OAuthServerBundle/Model/ClientManager.php line 41
  
  at FOS\OAuthServerBundle\Model\ClientManager-&gt;findClientByPublicId('fd87dddb-6c29-11e4-90f3-b8ca3aa16897_fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk')
      in /home/johnny/Development/symfonyProject/vendor/friendsofsymfony/oauth-server-bundle/FOS/OAuthServerBundle/Storage/OAuthStorage.php line 102
  
  at FOS\OAuthServerBundle\Storage\OAuthStorage-&gt;getClient('fd87dddb-6c29-11e4-90f3-b8ca3aa16897_fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk')
      in /home/johnny/Development/symfonyProject/vendor/friendsofsymfony/oauth2-php/lib/OAuth2/OAuth2.php line 707
  
  at OAuth2\OAuth2-&gt;grantAccessToken(object(Request))
      in /home/johnny/Development/symfonyProject/vendor/friendsofsymfony/oauth-server-bundle/FOS/OAuthServerBundle/Controller/TokenController.php line 40
  
  at FOS\OAuthServerBundle\Controller\TokenController-&gt;tokenAction(object(Request))
      in  line 
  
  at call_user_func_array(array(object(TokenController), 'tokenAction'), array(object(Request)))
      in /home/johnny/Development/symfonyProject/app/bootstrap.php.cache line 2976
  
  at Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(object(Request), '1')
      in /home/johnny/Development/symfonyProject/app/bootstrap.php.cache line 2938
  
  at Symfony\Component\HttpKernel\HttpKernel-&gt;handle(object(Request), '1', true)
      in /home/johnny/Development/symfonyProject/app/bootstrap.php.cache line 3087
  
  at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel-&gt;handle(object(Request), '1', true)
      in /home/johnny/Development/symfonyProject/app/bootstrap.php.cache line 2337
  
  at Symfony\Component\HttpKernel\Kernel-&gt;handle(object(Request))
      in /home/johnny/Development/symfonyProject/web/app_dev.php line 18
  </code></pre>