Skip to content
This repository has been archived by the owner on May 14, 2018. It is now read-only.

Unable to fetch or create an instance for doctrine.entity_manager.orm_default' after update #166

Closed
webdevilopers opened this issue Jul 11, 2013 · 7 comments
Labels

Comments

@webdevilopers
Copy link

I just updated my packages with the following composer config:

    "require": {
        "php": ">=5.3.3",
        "zendframework/zendframework": "2.*",
        "doctrine/orm": "dev-master",
        "doctrine/dbal": "dev-master",
        "doctrine/common": "dev-master",
        "doctrine/doctrine-module": "0.8.*",
        "doctrine/doctrine-orm-module": "dev-master",        
        "bjyoungblood/bjy-authorize": "1.4.*",
        "bjyoungblood/bjy-profiler": "dev-master",
        "darkmatus/roleuserbridge": "@dev",
        "zf-commons/zfc-user": "0.1.*",
        "zf-commons/zfc-user-doctrine-orm": "dev-master",
    },

Since the I get this message:

**'Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for doctrine.entity_manager.orm_default' ... bjyoungblood/bjy-authorize/src/BjyAuthorize/Service/ObjectRepositoryRoleProviderFactory.php(50): Zend\ServiceManager\ServiceManager->get('doctrine.entity...') #1 [internal function]: BjyAuthorize\Service\ObjectRepositoryRoleProviderFactory->createService(Object(Zend\ServiceManager\ServiceManager)**

l. 49 ff.:

        /* @var $objectManager \Doctrine\Common\Persistence\ObjectManager */
        $objectManager = $serviceLocator->get($providerConfig['object_manager']);

Wrong requirements?

@Ocramius
Copy link
Contributor

@webdevilopers what are the previous exceptions?

@webdevilopers
Copy link
Author

Indeed it is the first exception that is thrown. I thought it was a change inside the Doctrine packages but loading the old BETA did not reverse the error.

@Ocramius
Copy link
Contributor

@webdevilopers can you try using doctrine.entitymanager instead of doctrine.entity_manager ?

@webdevilopers
Copy link
Author

Where exactely should I change this key?

@webdevilopers
Copy link
Author

When I dump the $providerConfig in line 39 of ObjectRepositoryRoleProviderFactory I see the object_manager:

array(2) {
  ["object_manager"]=>
  string(35) "doctrine.entity_manager.orm_default"
  ["role_entity_class"]=>
  string(23) "Application\Entity\Role"
}

But I don't see any config where I set this by hand.

@webdevilopers
Copy link
Author

Correct me, I found a config in my Application:

    'bjyauthorize' => array(
        // Using the authentication identity provider, which basically reads the roles from the auth service's identity
        'identity_provider' => 'BjyAuthorize\Provider\Identity\AuthenticationIdentityProvider',
        #'identity_provider' => 'BjyAuthorize\Provider\Identity\AuthenticationDoctrineEntity',

        'role_providers'        => array(
            // using an object repository (entity repository) to load all roles into our ACL
            'BjyAuthorize\Provider\Role\ObjectRepositoryProvider' => array(
                #'object_manager'    => 'doctrine.entity_manager.orm_default',
                'object_manager'    => 'doctrine.entitymanager.orm_default',
                'role_entity_class' => 'Application\Entity\Role',
            ),
        ),

I corrected the key and it seems to work again!

@Ocramius
Copy link
Contributor

@webdevilopers good :D

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

No branches or pull requests

2 participants