Reputation: 21236
I have build a library using some of the Symfony2 components and Doctrine. I now want to use this library inside a Symfony2 console app. I have included my library through Composer as a vendor, however, I'm getting the following error when I execute my library code:
PHP Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Bundle "default" does not exist or it is not enabled.' in /home/user/project/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php:90
I'm not sure what the "default" bundle would be, how this is related to Doctrine or how to start to debug this.
Any help much appreciated.
UPDATE:
This is the Composer.json for my console app:
{
"name": "my/console",
"type": "application",
"repositories": [
{
"type": "vcs",
"url": "[email protected]:my/library.git"
}
],
"require": {
"php": ">=5.3.3",
"my/library": "dev-dev-master"
},
"autoload": {
"psr-0": {
"My\\": ["src/"]
}
}
}
This is the Composer.json for my library:
{
"name": "my/library",
"type": "library",
"keywords": [
"my", "library"
],
"homepage": "https://www.mine.com/",
"autoload": {
"psr-0": { "My\\": ["src/"] }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"doctrine/orm": "2.3.*",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"underscore/underscore.php": "1.3.1",
"sami/sami": "v1.1"
},
"scripts": {
"post-install-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache"
],
"post-update-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "stable",
"extra": {
"symfony-app-dir": "app"
}
}
Upvotes: 1
Views: 2091
Reputation: 31919
You can see what is causing this in the AbstractDoctrineExtension. As you can see, this error has something to do with the mappings you have defined in your config file.
It is also mentioned here that this error is triggered by an error in the mappings, just try to comment out what you have in the mappings.
orm:
auto_generate_proxy_classes: %kernel.debug%
default_entity_manager: default
entity_managers:
default:
mappings:
#whatever you have here
Upvotes: 2