title: ClassNotFoundException: Attempted to load class... Symfony
body: <p>I start to use Symfony about 5-7 days ago, if my question is very simple, sorry, but I can't find a solution of my problem.
  I've created 2 form classes - UserType and ClientType. Difference between them is that in ClientType form exists few additional fields.
  Here is Usertype class:</p>
  
  <pre><code>namespace Acme\Gyvfiles\GyvefileBundle\Form\Type;
  use Symfony\Component\Form\AbstractType;
  use Symfony\Component\Form\FormBuilderInterface;
  use Symfony\Component\OptionsResolver\OptionsResolverInterface;
  
  class UserType extends AbstractType
  {
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
      $builder-&gt;add('name', 'text');
      $builder-&gt;add('username', 'text');
      $builder-&gt;add('email', 'email', array(
          'attr' =&gt; array('class'=&gt;'email') ) );
      $builder-&gt;add('Password', 'repeated', array(
          'first_name'  =&gt; 'password',
          'second_name' =&gt; 'confirm',
          'type'        =&gt; 'password',
      ));
      $builder-&gt;add( 'roles', 'choice', array(
          'choices' =&gt; array('ROLE_SYSTEM_ADMIN' =&gt; 'System Administrator', 'ROLE_ACCOUNT_ADMIN' =&gt; 'Account Manager', 'ROLE_UPLOADER' =&gt; 'Uploader'),
          'mapped' =&gt; false ) );
      $builder-&gt;add('is_active', 'checkbox', array(
          'label'     =&gt; 'Active (user can log in)',
          'required'  =&gt; false,
      ));
      $builder-&gt;add('add_user', 'submit');
  }
  
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver-&gt;setDefaults(array(
          'data_class' =&gt; 'Acme\Gyvfiles\GyvefileBundle\Entity\User'
      ));
    }
  
    public function getName()
    {
      return 'user';
    }
  }
  </code></pre>
  
  <p>And at last ClientType class. All the same, except this part:
  <strong>Update:</strong></p>
  
  <pre><code>&lt;?php
  namespace Acme\Gyvfiles\GyvefileBundle\Form\Type;
  
  use Symfony\Component\Form\AbstractType;
  use Symfony\Component\Form\FormBuilderInterface;
  use Symfony\Component\OptionsResolver\OptionsResolverInterface;
  
  class ClientType extends AbstractType
  {
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
      $builder-&gt;add('name', 'text');
      $builder-&gt;add('username', 'text');
      $builder-&gt;add('email', 'email', array(
          'attr' =&gt; array('class'=&gt;'email') ) );
      $builder-&gt;add('Password', 'repeated', array(
          'first_name'  =&gt; 'password',
          'second_name' =&gt; 'confirm',
          'type'        =&gt; 'password',
      ));
      $builder-&gt;add('address', 'text');
      $builder-&gt;add('telephone', 'text');
      $builder-&gt;add('internalContactName', 'text');telephone
      $builder-&gt;add( 'roles', 'checkbox', array(
          'choices' =&gt; array('label' =&gt; 'Client can upload', ),
          'required'  =&gt; false ) );
      $builder-&gt;add('is_active', 'checkbox', array(
          'label'     =&gt; 'Active (user can log in)',
          'required'  =&gt; false,
      ));
      $builder-&gt;add('add_client', 'submit');
    }
  
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
      $resolver-&gt;setDefaults(array(
          'data_class' =&gt; 'Acme\Gyvfiles\GyvefileBundle\Entity\Client'
      ));
    }
  
    public function getName()
    {
      return 'client';
    }
  }
  </code></pre>
  
  <p>And after this steps I've used Usertype class in user controller successfully with this statement:</p>
  
  <pre><code> $objUser = new User();
   $objForm = $this-&gt;get( 'form.factory')-&gt;create( new UserType(), $objUser ); 
  </code></pre>
  
  <p>But when I tried to use ClientType in Client Controller with similar syntax:</p>
  
  <p><strong>Update: ClientController</strong>
      
  
  <pre><code>use Acme\Gyvfiles\GyvefileBundle\Entity\Permission;
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
  use Symfony\Component\Security\Core\SecurityContext;
  use Symfony\Component\HttpFoundation\Request;
  use Symfony\Component\Security\Core\Util\StringUtils;
  
  use Acme\Gyvfiles\GyvefileBundle\Entity\Client;
  use Acme\Gyvfiles\GyvefileBundle\Form\Type\ClientType;
  
  class ClientController extends Controller
  {
    public function addclientAction()
    {
      $em = $this-&gt;get( 'doctrine' )-&gt;getEntityManager();
      $objClient = new Client();
      $objForm = $this-&gt;get( 'form.factory')-&gt;create( new ClientType(), $objClient );
      //$objForm-&gt;add('address', 'text');
      return $this-&gt;render( 'AcmeGyvfilesGyvefileBundle:Client:addclient.html.twig', array(
          'form'  =&gt;  $objForm-&gt;createView(),
      ));
    }
  }
  </code></pre>
  
  <p>appears Class not found exception.</p>
  
  <p>"ClassNotFoundException: Attempted to load class "ClientType" from namespace "Acme\Gyvfiles\GyvefileBundle\Form\Type" in C:\wamp\www\Symfony\src\Acme\Gyvfiles\GyvefileBundle\Controller\ClientController.php line 22. Do you need to "use" it from another namespace?"</p>
  
  <p>Can anyone help my with this problem? Thanks!</p>