Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't load Application/Sonata/ApplicationSonataUserBundle #902

Closed
tmac14 opened this issue Sep 6, 2017 · 6 comments
Closed

Can't load Application/Sonata/ApplicationSonataUserBundle #902

tmac14 opened this issue Sep 6, 2017 · 6 comments

Comments

@tmac14
Copy link

tmac14 commented Sep 6, 2017

Hi, Im following the installation guide step-by-step and Im getting the next error:

PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "ApplicationSonataUserBundle" from namespace "Application\Sonata\UserBundle".
Did you forget a "use" statement for another namespace? in /home/josecostas/Programming/tuttocars/app/AppKernel.php:35
Stack trace:
#0 /home/josecostas/Programming/tuttocars/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(450): AppKernel->registerBundles()
#1 /home/josecostas/Programming/tuttocars/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(116): Symfony\Component\HttpKernel\Kernel->initializeBundles()
#2 /home/josecostas/Programming/tuttocars/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(69): Symfony\Component\HttpKernel\Kernel->boot()
#3 /home/josecostas/Programming/tuttocars/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(125): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(S in /home/josecostas/Programming/tuttocars/app/AppKernel.php on line 35

Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "ApplicationSonataUserBundle" from namespace "Application\Sonata\UserBundle".
Did you forget a "use" statement for another namespace? in /home/josecostas/Programming/tuttocars/app/AppKernel.php:35
Stack trace:
#0 /home/josecostas/Programming/tuttocars/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(450): AppKernel->registerBundles()
#1 /home/josecostas/Programming/tuttocars/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(116): Symfony\Component\HttpKernel\Kernel->initializeBundles()
#2 /home/josecostas/Programming/tuttocars/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(69): Symfony\Component\HttpKernel\Kernel->boot()
#3 /home/josecostas/Programming/tuttocars/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(125): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(S in /home/josecostas/Programming/tuttocars/app/AppKernel.php on line 35
`
```

The symfony version is 3.3.6 and it's a clear installation. Maybe there is the problem.
Im not an expert in symfony and github either and Im spanish (excuse me about my english level).
Please, tell me if you need more details about code and versions.

Thanks.
@tarlepp
Copy link

tarlepp commented Sep 6, 2017

Problem solved in IRC with using

{
    ...
    "autoload": {
        "psr-4": {
            "": "src/"
        },
}

instead of

{
    ...
    "autoload": {
        "psr-4": {
            "AppBundle\\": "src/AppBundle"
        },
}

@tmac14
Copy link
Author

tmac14 commented Sep 6, 2017

Yes, thanks you. Im newbie.

@tmac14 tmac14 closed this as completed Sep 6, 2017
@RaphArbuz
Copy link

Thanks @tarlepp and one shouldn't forget to run composer update after that.

@TELLO0815
Copy link

@tarlepp I have the same problem. I don't get it where to change. Can u specify for me the file please?

THX Mike
PS: Newbie ;-)

@tarlepp
Copy link

tarlepp commented Dec 4, 2017

@TELLO0815 see your composer.json file on root of your project.

@TELLO0815
Copy link

THX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants