schmittjoh / JMSDiExtraBundle

Provides Advanced Dependency Injection Features for Symfony2
http://jmsyst.com/bundles/JMSDiExtraBundle
330 stars 130 forks source link

Trouble with config #124

Open maninhat opened 11 years ago

maninhat commented 11 years ago

I want to use this bundle. but it has problem with sonata/mediaBundle. FatalErrorException: Error: Class 'Sonata\BlockBundle\Block\BaseBlockService' not found in ..../www/vendor/sonata-project/media-bundle/Sonata/MediaBundle/Block/MediaBlockService.php

I tried to exclude MediaBundle with config parameters: jms_di_extra: locations: all_bundles: false bundles: [B2BSiteBundle, B2BMessageBundle] directories: ["%kernel.root_dir%/../src"]

but it does not help

stof commented 11 years ago

The exception has nothing to do with JMSDiExtraBundle. It is thrown in SonataMediaBundle

maninhat commented 11 years ago

Yes, but without JMSDiExtraBundle all work perfectly. Because i don't use base block service. When include JMSDiExtraBundle throwing fatal exception. I think JMSDiExtraBundle look into SonataMediaBundle and do something with it.

stof commented 11 years ago

Can you paste the stack trace of the exception ? It could help debugging this

maninhat commented 11 years ago

i see only: Whoops, looks like something went wrong. 1/1FatalErrorException: Error: Class 'Sonata\BlockBundle\Block\BaseBlockService' not found in /usr/local/chroots/devel/agreg/www/vendor/sonata-project/media-bundle/Sonata/MediaBundle/Block/MediaBlockService.php line 37 in /usr/local/chroots/devel/agreg/www/vendor/sonata-project/media-bundle/Sonata/MediaBundle/Block/MediaBlockService.php line 37 apache error.log has same message

stof commented 11 years ago

You are giving me the error message only, not the stack trace

maninhat commented 11 years ago

How can i see "stack trace"?

stof commented 11 years ago

are you getting the error in the browser or in the CLI ?

maninhat commented 11 years ago

in the browser

stof commented 11 years ago

then simply look at the following lines of the error page. It should display the full stack trace of the exception

maninhat commented 11 years ago

There is no following lines after error message. On error page displays only FatalErrorException that i posted above

stof commented 11 years ago

do you have xdebug enabled ?

maninhat commented 11 years ago

just installed stack trace:

in /usr/local/chroots/devel/agreg/www/vendor/sonata-project/media-bundle/Sonata/MediaBundle/Block/MediaBlockService.php line 37
at ErrorHandler->handleFatal() in /usr/local/chroots/devel/agreg/www/vendor/symfony/symfony/src/Symfony/Component/Debug/ErrorHandler.php line 0
in /usr/local/chroots/devel/agreg/www/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/DebugClassLoader.php line 96
at DebugClassLoader->loadClass() in /usr/local/chroots/devel/agreg/www/vendor/jms/aop-bundle/JMS/AopBundle/DependencyInjection/Compiler/PointcutMatchingPass.php line 0
at ??class_exists() in /usr/local/chroots/devel/agreg/www/vendor/jms/aop-bundle/JMS/AopBundle/DependencyInjection/Compiler/PointcutMatchingPass.php line 96
at PointcutMatchingPass->processDefinition() in /usr/local/chroots/devel/agreg/www/vendor/jms/aop-bundle/JMS/AopBundle/DependencyInjection/Compiler/PointcutMatchingPass.php line 59
at PointcutMatchingPass->process() in /usr/local/chroots/devel/agreg/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php line 119
at Compiler->compile() in /usr/local/chroots/devel/agreg/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php line 629
at ContainerBuilder->compile() in /usr/local/chroots/devel/agreg/www/app/bootstrap.php.cache line 2362
at Kernel->initializeContainer() in /usr/local/chroots/devel/agreg/www/app/bootstrap.php.cache line 2142
at Kernel->boot() in /usr/local/chroots/devel/agreg/www/app/bootstrap.php.cache line 2173
at Kernel->handle() in /usr/local/chroots/devel/agreg/www/web/app_dev.php line 29
at ??{main}() in /usr/local/chroots/devel/agreg/www/web/app_dev.php line 0
shieldo commented 11 years ago

Are you sure you want to include your src directory for parsing? I don't know where your bundles live, but if they're in that directory, that may be the issue.

maninhat commented 11 years ago

Without directories: ["%kernel.root_dir%/../src"] i have same error.

shieldo commented 11 years ago

Thanks - it's good to rule that out. In that case, it looks like a similar issue to #126 - bundles being parsed that haven't been explicitly configured to be parsed.