FOSUserBundle SonataAdminBundle [InvalidArgumentException]

Discuss Symfony 2 bundles here

Moderators: tiagojsag, dcobalt

FOSUserBundle SonataAdminBundle [InvalidArgumentException]

Postby barry_j » Tue Nov 29, 2011 12:25 am

Hi

A couple of days ago, I installed the the FOS User Bundle (which involved creating a bundle called UserBundle with an Entity file called User.php. I went step by step through the install process for this, even keeping my company name as Acme. As far as I can tell this section all went ok, since I was able to use Doctrine to create databases, register, login, logout etc

Next I installed the Sonata User Bundle (which has an option to work with FOSUserBundle). This also meant installing Sonata ORM Bundle and Sonata Admin Bundle as part of the process. Again I followed the install step by step.

Now, when I try to load any page I get the following Exception:



InvalidArgumentException: Bundle "UserBundle" does not exist or it is not enabled.




I have definitely included the
Code: Select all
new Acme\UserBundle\AcmeUserBundle(),

into the Appkernel


My AcmeUserBundle.php looks like this:


Code: Select all
namespace Acme\UserBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class AcmeUserBundle extends Bundle
{
}





My User.php looks like this:

Code: Select all
// src/Acme/UserBundle/Entity/User.php

namespace Acme\UserBundle\Entity;

use FOS\UserBundle\Entity\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity
 * @ORM\Table(name="fos_user")
 */
class User extends BaseUser
   {
       /**
        * @ORM\Id
        * @ORM\Column(type="integer")
        * @ORM\GeneratedValue(strategy="AUTO")
        */
       protected $id;
   
      public function __construct()
       {
           parent::__construct();
           // your own logic
       }
      

      
   }




Does anybody have any idea what might be broken?

I have spend hours looking at this, and would be grateful for any ideas, for what do look at next

Thanks in Advance

Barry
barry_j
Member
 
Posts: 35
Joined: Fri Jul 29, 2011 2:02 pm
Location: Warwickshire, UK

Re: FOSUserBundle SonataAdminBundle [InvalidArgumentExceptio

Postby barry_j » Tue Nov 29, 2011 5:45 pm

Well, it looks like I did something wrong on the install.

I started again and it worked. Once I had finished, i actually found a really good guide to installing these bundles, if I had found this earlier, it would have taken a few hours less :oops:

this is the link:

http://blog.quadspot.de/wordpress/symfony2/setting-up-a-symfony2-project-with-fosuserbundle-sonatauserbundle-and-sonataadminbundle
barry_j
Member
 
Posts: 35
Joined: Fri Jul 29, 2011 2:02 pm
Location: Warwickshire, UK


Return to Bundles discussion

Who is online

Users browsing this forum: Bing [Bot] and 1 guest