title: JMSSerializer stand alone - Annotation does not exist, or cannot be auto-loaded
body: <p>I am attempting to use JMSSerializer as a stand alone library to map JSON responses from an API to my model classes and am running into some issues.</p>
  
  <p>Executing the following code results in an exception:</p>
  
  <pre><code>&lt;?php
  require dirname(__DIR__) . '/vendor/autoload.php';
  
  use JMS\Serializer\Annotation AS JMS;
  
  class Trii {
      /**
       * User ID for this session
       * @JMS\SerializedName("userID")
       * @JMS\Annotation(getter="getUserId")
       * @JMS\Type("string")
       * @var string
       */
      private $userId;
  
      public function getUserId() {
          return $this-&gt;userId;
      }
  
      public function setUserId($userId) {
          $this-&gt;userId = $userId;
      }
  }
  
  $serializer = \JMS\Serializer\SerializerBuilder::create()-&gt;setDebug(true)-&gt;build();
  $object = $serializer-&gt;deserialize('{"userID":"Trii"}', 'Trii', 'json');
  var_dump($object);
  ?&gt;
  </code></pre>
  
  <p>Here is the exception</p>
  
  <pre><code>Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@JMS\Serializer\Annotation\SerializedName" in property Trii::$userId does not exist, or could not be auto-loaded.
  </code></pre>
  
  <p>I have the following libraries installed for the project via composer</p>
  
  <pre><code>{
      "require": {
          "jms/serializer": "1.0.*@dev"
      }
  }
  </code></pre>
  
  <p>Is there something obvious I am missing since I am not using the whole Doctrine 2 solution?</p>
  
  <p>EDIT: my final solution was to create a bootstrap file with the following content:</p>
  
  <pre><code>&lt;?php
  // standard composer install vendor autoload magic
  require dirname(__DIR__) . '/vendor/autoload.php';
  
  // Bootstrap the JMS custom annotations for Object to Json mapping
  \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace(
      'JMS\Serializer\Annotation',
      dirname(__DIR__).'/vendor/jms/serializer/src'
  );
  ?&gt;
  </code></pre>