Symfony2:SecurityExtension::addUserProviderFactory()和PropelBundle

Symfony2:SecurityExtension::addUserProviderFactory()和PropelBundle,symfony,propel,Symfony,Propel,我目前正在迁移一个Symfony2网站,我遇到了一个无法修复的问题 我收到的错误消息是: 致命错误:调用未定义的方法 Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension::addUserProviderFactory() 在第73行的[…]vendor/bundles/prople/PropelBundle/PropelBundle.php中 这是我的deps文件: [symfony] git=http:

我目前正在迁移一个Symfony2网站,我遇到了一个无法修复的问题

我收到的错误消息是:

致命错误:调用未定义的方法 Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension::addUserProviderFactory() 在第73行的[…]vendor/bundles/prople/PropelBundle/PropelBundle.php中

这是我的deps文件:

[symfony]
    git=http://github.com/symfony/symfony.git
    version=origin/2.0

[twig]
    git=http://github.com/fabpot/Twig.git
    version=v1.8.2

[monolog]
    git=http://github.com/Seldaek/monolog.git
    version=1.0.2

[doctrine-common]
    git=http://github.com/doctrine/common.git
    version=2.1.4

[doctrine-dbal]
    git=http://github.com/doctrine/dbal.git
    version=2.1.5

[doctrine]
    git=http://github.com/doctrine/doctrine2.git
    version=2.1.6

[swiftmailer]
    git=http://github.com/swiftmailer/swiftmailer.git
    version=v4.2.0

[assetic]
    git=http://github.com/kriswallsmith/assetic.git
    version=v1.0.3

[twig-extensions]
    git=http://github.com/fabpot/Twig-extensions.git

[metadata]
    git=http://github.com/schmittjoh/metadata.git
    version=1.0.0

[SensioFrameworkExtraBundle]
    git=http://github.com/sensio/SensioFrameworkExtraBundle.git
    target=/bundles/Sensio/Bundle/FrameworkExtraBundle
    version=origin/2.0

[JMSSecurityExtraBundle]
    git=http://github.com/schmittjoh/JMSSecurityExtraBundle.git
    target=/bundles/JMS/SecurityExtraBundle
    version=origin/1.0.x

[SensioDistributionBundle]
    git=http://github.com/sensio/SensioDistributionBundle.git
    target=/bundles/Sensio/Bundle/DistributionBundle
    version=origin/2.0

[SensioGeneratorBundle]
    git=http://github.com/sensio/SensioGeneratorBundle.git
    target=/bundles/Sensio/Bundle/GeneratorBundle
    version=origin/2.0

[AsseticBundle]
    git=http://github.com/symfony/AsseticBundle.git
    target=/bundles/Symfony/Bundle/AsseticBundle
    version=origin/2.0

[Phing]
    git=https://github.com/phingofficial/phing.git

[Propel]
    git=https://github.com/propelorm/Propel.git

[PropelBundle]
    git=https://github.com/propelorm/PropelBundle.git
    target=/bundles/Propel/PropelBundle
    branch=origin/1.0

[PdfBundle]
    git=git://github.com/psliwa/PdfBundle.git
    target=/bundles/Ps/PdfBundle

[PHPPdf]
    git=git://github.com/psliwa/PHPPdf.git
    version=origin/1.1.x
总之,我使用的是Symfony 2.0(我不能使用2.1:远程服务器在PHP5.3.2中,由于Plesk的原因,不可能迁移到PHP5.3.3)和相关的推进版本(1.0)

这也是我的AppKernel:

$bundles = array(
    new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
    new Symfony\Bundle\SecurityBundle\SecurityBundle(),
    new Symfony\Bundle\TwigBundle\TwigBundle(),
    new Symfony\Bundle\MonologBundle\MonologBundle(),
    new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
    new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
    new Symfony\Bundle\AsseticBundle\AsseticBundle(),
    new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
    new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
    // My application bundles
    new Ps\PdfBundle\PsPdfBundle(),
    new Propel\PropelBundle\PropelBundle(),
);
以及我的autoload.php文件,如果可以帮助:

$loader->registerNamespaces(array(
    'Symfony'          => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
    'Sensio'           => __DIR__.'/../vendor/bundles',
    'JMS'              => __DIR__.'/../vendor/bundles',
    'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib',
    'Doctrine\\DBAL'   => __DIR__.'/../vendor/doctrine-dbal/lib',
    'Doctrine'         => __DIR__.'/../vendor/doctrine/lib',
    'Monolog'          => __DIR__.'/../vendor/monolog/src',
    'Assetic'          => __DIR__.'/../vendor/assetic/src',
    'Metadata'         => __DIR__.'/../vendor/metadata/src',
    'Ps' => __DIR__.'/../vendor/bundles',
    'PHPPdf' => __DIR__.'/../vendor/PHPPdf/lib',
    'Imagine' => array(__DIR__.'/../vendor/PHPPdf/lib', __DIR__.'/../vendor/PHPPdf/lib/vendor/Imagine/lib'),
    'Zend' => __DIR__.'/../vendor/PHPPdf/lib/vendor/Zend/library',//If you have used ZF2 packages already, you should skip this entry
    'ZendPdf' => __DIR__.'/../vendor/PHPPdf/lib/vendor/ZendPdf/library',
    'Propel' => __DIR__.'/../vendor/bundles',
    'Phing'  => __DIR__.'/../vendor/phing/classes/phing',
));

你知道我如何修复它吗?

你似乎加载了错误版本的PropelBundle

在deps文件中,不要为属性绑定写入
branch=origin/1.0
,而是写入
version=origin/1.0

[PropelBundle]
    git=https://github.com/propelorm/PropelBundle.git
    target=/bundles/Propel/PropelBundle
    version=origin/1.0

事实上,我的deps文件中有一个错误。我写的是分支而不是版本。我讨厌这种错误。修复起来非常简单,但很难定位。现在一切都好了!谢谢。:)