0

i'm trying to set 2 databases to my symfony 2.5 project, but got this error:

 Fatal error: Uncaught exception 'Symfony\Component\DependencyInjection\Exception\InvalidArgumentException' with message 'The service definition "doctrine.dbal.default_connection" does not exist.' \services\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass.php on line 48

Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: The service definition "doctrine.dbal.default_connection" does not exist. in services\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ContainerBuilder.php on line 867

Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: Unable to replace alias "doctrine.dbal.default_connection" with "database_connection"

Here is my doctrine definition config.yml

doctrine:    
    dbal:
        default_connection:   default
        connections:
            default:
                driver:   pdo_mysql
                host:     localhost
                port:     ~
                name:     db1
                user:     root
                password: ~
            log:
                driver:   pdo_mysql
                host:     localhost
                port:     ~
                name:     db2
                user:     root
                password: ~

Any suggestion?

3
  • Your config looks good. Try clearing your cache. Commented Aug 18, 2014 at 18:06
  • Solved: Changed by parameters Commented Aug 18, 2014 at 19:40
  • symfony.com/doc/current/cookbook/doctrine/… Commented Aug 18, 2014 at 19:47

1 Answer 1

1

The error message Unable to replace aliaswhen fidling with multiple databases hints to a typo in your configuration.

Double check your configuration using this reference: http://symfony.com/doc/current/cookbook/doctrine/multiple_entity_managers.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.