Symfony2.8 - > 3,3尝试从命名空间“Acme \ TopBundle”加载类“AcmeTopBundle”

I am upgrading symfony 2.8 -> 3.3

I have bumped into the issue.

in AppKernel.app

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
     new Acme\TopBundle\AcmeTopBundle(),
     new Acme\UserBundle\UserBundle(),
     new Acme\AdminBundle\AcmeAdminBundle(),

Normally I register my original bundles like this.

However in 3.3 it shows the error,

Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "AcmeTopBundle" from namespace "Acme\TopBundle".

All part of AppKernel.php except registerBundles(), I copy and paste from new 3.3 skeleton project. Also AppCache.php is also copied.

How can I register my original bundle into 3.3????


The problem is solved , thanks to the comments.

my solution is like this below in composer.json

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

        "Acme\\TopBundle\\": "src/Acme/TopBundle", //add
        "Acme\\UserBundle\\": "src/Acme/UserBundle", //add
        "Acme\\MemberBundle\\": "src/Acme/MemberBundle", //add
        "Acme\\AdminBundle\\": "src/Acme/AdminBundle" //add
    },