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

Still an issue: Class Doctrine\Common\Proxy\AbstractProxyFactory does not exist #908

Closed
lbayerl opened this issue Jan 24, 2019 · 8 comments
Assignees

Comments

@lbayerl
Copy link

lbayerl commented Jan 24, 2019

The issue mentioned here and to my understanding should have been fixed with version 1.10.1 with this merge still seems to exist for me.

After using composer create-project symfony/skeleton myproject and composer require doctrine/doctrine-bundle it installs 1.10.1 of the Doctrine bundle but I still receive the following error message:

In BaseNode.php line 422:
Invalid configuration for path "doctrine.orm.auto_generate_proxy_classes": Class Doctrine\Common\Proxy\AbstractProxyFactory does not exist

In Configuration.php line 714:
Class Doctrine\Common\Proxy\AbstractProxyFactory does not exist

@SenseException
Copy link
Member

Thank you. Did you take a look if the mentioned fix hasn't covered this bug completely or if this has another cause? Can you please contribute a failing test that reproduces this error?

@Majkl578
Copy link
Contributor

Majkl578 commented Feb 2, 2019

Can you please post your configuration for Doctrine bundle (the doctrine: section)?

The Symfony recipe for this bundle naively assumes you will also use ORM and adds default section: https://github.com/symfony/recipes/blob/481ce0a9f1619c0bea95d1b37c4477a9880f7039/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml#L19
So you need this to be deleted, with only dbal: left.

@barell
Copy link

barell commented Feb 5, 2019

I just had the same issue described here. This is my doctrine configuration generated by recipe:

in config/packages/doctrine.yml

doctrine:
    dbal:
        # configure these for your database server
        driver: 'pdo_mysql'
        server_version: '5.7'
        charset: utf8mb4
        default_table_options:
            charset: utf8mb4
            collate: utf8mb4_unicode_ci

        url: '%env(resolve:DATABASE_URL)%'
    orm:
        auto_generate_proxy_classes: true
        naming_strategy: doctrine.orm.naming_strategy.underscore
        auto_mapping: true
        mappings:
            App:
                is_bundle: false
                type: annotation
                dir: '%kernel.project_dir%/src/Entity'
                prefix: 'App\Entity'
                alias: App

in config/packages/prod/doctrine.yml

doctrine:
    orm:
        auto_generate_proxy_classes: false
        metadata_cache_driver:
            type: service
            id: doctrine.system_cache_provider
        query_cache_driver:
            type: service
            id: doctrine.system_cache_provider
        result_cache_driver:
            type: service
            id: doctrine.result_cache_provider

To resolve, I had to manually run composer require doctrine/orm

@alcaeus
Copy link
Member

alcaeus commented Feb 5, 2019

To resolve, I had to manually run composer require doctrine/orm

If you're not planning to use the ORM, remove the orm configuration instead.

@alcaeus alcaeus self-assigned this Feb 5, 2019
@alcaeus
Copy link
Member

alcaeus commented Feb 5, 2019

Closing here: this is an issue with the default configuration applied by the Symfony Flex recipe that doesn't take into account that ORM may not be installed. Nothing we can do here.

@alcaeus alcaeus closed this as completed Feb 5, 2019
@Majkl578
Copy link
Contributor

Majkl578 commented Feb 5, 2019

Maybe it could thow more meaningful error than "ReflectionException: Class ... not found"?

@xabbuh
Copy link
Member

xabbuh commented Feb 5, 2019

see #919 for an attempt to improve the reported error

@anjanasilva
Copy link

I just had the same issue described here. This is my doctrine configuration generated by recipe:

in config/packages/doctrine.yml

doctrine:
    dbal:
        # configure these for your database server
        driver: 'pdo_mysql'
        server_version: '5.7'
        charset: utf8mb4
        default_table_options:
            charset: utf8mb4
            collate: utf8mb4_unicode_ci

        url: '%env(resolve:DATABASE_URL)%'
    orm:
        auto_generate_proxy_classes: true
        naming_strategy: doctrine.orm.naming_strategy.underscore
        auto_mapping: true
        mappings:
            App:
                is_bundle: false
                type: annotation
                dir: '%kernel.project_dir%/src/Entity'
                prefix: 'App\Entity'
                alias: App

in config/packages/prod/doctrine.yml

doctrine:
    orm:
        auto_generate_proxy_classes: false
        metadata_cache_driver:
            type: service
            id: doctrine.system_cache_provider
        query_cache_driver:
            type: service
            id: doctrine.system_cache_provider
        result_cache_driver:
            type: service
            id: doctrine.result_cache_provider

To resolve, I had to manually run composer require doctrine/orm

Running composer require doctrine/orm did the trick. Thank you @barell .

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

No branches or pull requests

7 participants