title: symfony validation constraint ClassNotFoundException
body: <p>My custom constraint class is not found and I don't know where is the problem.<br />
  this is the error</p>
  
  <blockquote>
    <p>Attempted to load class "CompanyTransferConstraint" from namespace
    "FM\FMBundle\Validator\Constraints". Did you forget a "use" statement
    for another namespace? 500 Internal Server Error -
    ClassNotFoundException</p>
  </blockquote>
  
  <p>the constraint class and the validator class are both located in <strong>src/FM\FMBundle\Validator\Constraints</strong><br /></p>
  
  <p>here is my code :<br />
  CompanyTransferConstraint</p>
  
  <pre><code>&lt;?php
  
  namespace FM\FMBundle\Validator\Constraints;
  
  use Symfony\Component\Validator\Constraint;
  
  /**
   * @Annotation
   */
  
  class CompanyTransferConstraint extends Constraint
  {
      public $message = 'You do not have the requested amount';
      public function validatedBy()
      {
          return get_class($this).'Validator';
      }
  }
  </code></pre>
  
  <p>CompanyTransferConstraintValidator</p>
  
  <pre><code>&lt;?php
  namespace FM\FMBundle\Validator\Constraints;
  
  use Symfony\Component\Validator\Constraint;
  use Symfony\Component\Validator\ConstraintValidator;
  
  class CompanyTransferConstraintValidator extends ConstraintValidator
  {
      public function validate($value, Constraint $constraint)
          {
  
              if ($value&gt;200) {
                  $this-&gt;context-&gt;buildViolation($constraint-&gt;message)
                      -&gt;addViolation();
              }
          }
  }
  </code></pre>
  
  <p>the Form Type</p>
  
  <pre><code>&lt;?php
  
  namespace FM\FmBundle\Form\Type\Dash;
  
  use Symfony\Component\Form\AbstractType;
  use Symfony\Component\Form\FormBuilderInterface;
  use Symfony\Component\Validator\Constraints\NotBlank;
  use FM\FMBundle\Validator\Constraints\CompanyTransferConstraint;
  use Symfony\Component\Validator\Constraints\Type;
  
  class CompanyTransferType extends AbstractType
  {
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $builder
              -&gt;add('totalAmount','integer',
                      array(
                          'constraints' =&gt; 
                              array(
                                  new NotBlank(),
                                  new Type('integer'),
                                  new CompanyTransferConstraint(),
                              )
                      )
  
              )
              -&gt;add('save','submit')
          ;
      }
      public function getName()
      {
          return 'fm_fmbundle_company_transfer';
      }
  }
  </code></pre>
  
  <p>I also tested it with a User entity like this</p>
  
  <pre><code>/*
  ...
  */
  use FM\FMBundle\Validator\Constraints as FmAssert;
  class User extends BaseUser 
  {
    /*
       .....
    */
      /**
       * @FmAssert\CompanyTransferConstraint
       */
      protected $phone;
  
    /*
       .....
    */
  }
  </code></pre>
  
  <p>and I get this error</p>
  
  <blockquote>
    <p>AnnotationException in AnnotationException.php line 54: [Semantical
    Error] The annotation
    "@FM\FMBundle\Validator\Constraints\CompanyTransferConstraint" in
    property FM\FmBundle\Entity\User::$phone does not exist, or could not
    be auto-loaded.</p>
  </blockquote>