eZ Community » Forums » eZ Publish 5 Platform » Attempted to call method...
expandshrink

Attempted to call method "hasInstance" on class "eZ\Publish\Core\MVC\Legacy\Kernel". after composer update

Attempted to call method "hasInstance" on class "eZ\Publish\Core\MVC\Legacy\Kernel". after composer update

Tuesday 14 April 2015 4:17:17 pm - 13 replies

Hi,

I just add doctrine/orm and make a composer update, and i have this error :
[Symfony\Component\Debug\Exception\UndefinedMethodException]                           
Attempted to call method "hasInstance" on class "eZ\Publish\Core\MVC\Legacy\Kernel". 

This is my composer.json

Have you an idea ?

Thanks

Wednesday 15 April 2015 10:38:59 am

Hi,
any stack trace on that? (enable xdebug, and optionally use dev/debug env)
Besides, might be better to use stable version of orm, like doctrine/orm": "~2.4" (2.5 is out, but some headroom to make sure you don't have conflicts in other deps causing composer to give you older version of something else)

Modified on Wednesday 15 April 2015 10:40:33 am by André R

Wednesday 15 April 2015 11:14:26 am

In fact, if i remove the line doctrine/orm and i make a new composer install, i have the same error. It's not in relation with doctrine, but with the default package of the last version of eZ and the ezsystems/legacy-bridge, i think

Modified on Wednesday 15 April 2015 11:14:57 am by Johann Roc

Wednesday 15 April 2015 2:22:11 pm

You have to update ezpublish_legacy. this method was added to its kernel a little while ago.

Wednesday 15 April 2015 2:38:36 pm

Hi Douglas.

When i do a composer update, ezpublish_legacy is updated ? And i have the problem :/

Wednesday 15 April 2015 4:24:09 pm

I thought is should too but I had to cd ezpublish_legacy && git pull to get the changes.
This is the commit that added it

https://github.com/ezsystems/ezpu...a72390fcf8b186326685ed2eacf9c0c200b2

Wednesday 15 April 2015 7:59:23 pm

The reason is that all deps here, except the one in legacy bridge towards legacy kernel, points to dev master. ref: https://github.com/ezsystems/LegacyBridge/blob/master/composer.json

Did you start with dev-master for this install or a release?
You can probably fix it by adding:

"ezsystems/ezpublish-legacy": "dev-master",

However might have to use "as" composer version alias syntax.

But then again, you should be following tags rather then dev-master if you want to avoid possible issues happy.gif Emoticon

Modified on Wednesday 15 April 2015 8:02:21 pm by André R

Wednesday 15 April 2015 8:22:44 pm

Adding "ezsystems/ezpublish-legacy": "dev-master" to the projects composer.json worked like a charm without the "as" alias.

Is there a reason why "ezsystems/legacy-bridge": "dev-master" is not using "ezsystems/ezpublish-legacy": "dev-master"?  I would have thought they would go hand in hand.

Thanks André

Wednesday 15 April 2015 9:45:04 pm

Hello Douglas,

I think it's important to remember that it's not such a good idea to always use the latest dev master of a repository since the stability of it / any repository may not be stable let alone usable. As Andre points out tags are one way to help void (some) stability problems.

That said with so much work still in flux as ezplatform is separated from the older ezpublish-community repository, LegacyBridge and ezpublish-legacy it's not much of a surprise to find that there are issues being encountered.

Here's to hoping that by the next community build of ezpublish-community (ez5) the build/tag will help everyone avoid this and other issues currently being encountered happy.gif Emoticon

I hope this helps!

Cheers,
Heath 

Thursday 16 April 2015 9:35:26 am

Thank You for yours answers. I had this line in my composer.json and made a composer.update (I don't understand the mechanism of alias with as ??) :

        "ezsystems/ezpublish-legacy": "dev-master"

My first problem is resolved. But now i have a new problem happy.gif Emoticon

 Invalid search engine 'legacy'. Could not find a service tagged as 'ezpublish.searchEngine' with alias 'legacy'.

This is my stack trace :
 

1] eZ\Bundle\EzPublishCoreBundle\ApiLoader\Exception\InvalidSearchEngine: Invalid search engine 'legacy'. Could not find a service tagged as 'ezpublish.searchEngine' with alias 'legacy'.    at n/a        in /var/www/mywebsite.com/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/ApiLoader/SearchEngineFactory.php line 80
    at eZ\Bundle\EzPublishCoreBundle\ApiLoader\SearchEngineFactory->buildSearchEngine()        in /var/www/mywebsite.com/ezpublish/cache/dev/ezpublishDevDebugProjectContainer.php line 7955
    at ezpublishDevDebugProjectContainer->getEzpublish_Spi_SearchService()        in /var/www/mywebsite.com/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php line 326
    at Symfony\Component\DependencyInjection\Container->get('ezpublish.spi.search')        in /var/www/mywebsite.com/ezpublish/cache/dev/ezpublishDevDebugProjectContainer.php line 1943
    at ezpublishDevDebugProjectContainer->getEzpublish_Api_InnerRepositoryService(false)        in /var/www/mywebsite.com/ezpublish/cache/dev/ezpublishDevDebugProjectContainer.php line 1934
    at ezpublishDevDebugProjectContainer->{closure}(null, object(eZPublishCoreRepositoryRepository_000000001a4251c20000000126ff6089), 'getUserService', array(), object(Closure))        in /var/www/mywebsite.com/ezpublish/cache/dev/ezpublishDevDebugProjectContainer.php line 35763
    at Closure->__invoke(null, object(eZPublishCoreRepositoryRepository_000000001a4251c20000000126ff6089), 'getUserService', array(), object(Closure))        in /var/www/mywebsite.com/ezpublish/cache/dev/ezpublishDevDebugProjectContainer.php line 35763
    at eZPublishCoreRepositoryRepository_000000001a4251c20000000126ff6089->getUserService()        in /var/www/mywebsite.com/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/Repository.php line 346
    at eZ\Publish\Core\SignalSlot\Repository->getUserService()        in /var/www/mywebsite.com/ezpublish/cache/dev/ezpublishDevDebugProjectContainer.php line 40459
    at eZPublishCoreSignalSlotRepository_000000001a4250100000000126ff6089->getUserService()        in /var/www/mywebsite.com/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Symfony/Security/Authentication/AnonymousAuthenticationProvider.php line 43
    at eZ\Publish\Core\MVC\Symfony\Security\Authentication\AnonymousAuthenticationProvider->authenticate(object(AnonymousToken))        in /var/www/mywebsite.com/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php line 74
    at Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager->authenticate(object(AnonymousToken))        in /var/www/mywebsite.com/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall/AnonymousAuthenticationListener.php line 56
    at Symfony\Component\Security\Http\Firewall\AnonymousAuthenticationListener->handle(object(GetResponseEvent))        in /var/www/mywebsite.com/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Firewall.php line 69
    at Symfony\Component\Security\Http\Firewall->onKernelRequest(object(GetResponseEvent), 'kernel.request', object(TraceableEventDispatcher))        in  line 
    at call_user_func(array(object(Firewall), 'onKernelRequest'), object(GetResponseEvent), 'kernel.request', object(TraceableEventDispatcher))        in /var/www/mywebsite.com/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php line 61
    at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(object(GetResponseEvent), 'kernel.request', object(ContainerAwareEventDispatcher))        in  line 
    at call_user_func(object(WrappedListener), object(GetResponseEvent), 'kernel.request', object(ContainerAwareEventDispatcher))        in /var/www/mywebsite.com/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php line 164
    at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.request', object(GetResponseEvent))        in /var/www/mywebsite.com/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php line 53
    at Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.request', object(GetResponseEvent))        in /var/www/mywebsite.com/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php line 167
    at Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.request', object(GetResponseEvent))        in /var/www/mywebsite.com/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php line 112
    at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch('kernel.request', object(GetResponseEvent))        in /var/www/mywebsite.com/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 126
    at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')        in /var/www/mywebsite.com/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 66
    at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)        in /var/www/mywebsite.com/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php line 64
    at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)        in /var/www/mywebsite.com/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php line 186
    at Symfony\Component\HttpKernel\Kernel->handle(object(Request))        in /var/www/mywebsite.com/htdocs/index.php line 85

Thanks happy.gif Emoticon

Modified on Thursday 16 April 2015 9:35:53 am by Johann Roc

Thursday 16 April 2015 5:44:19 pm

This PR was just merged and probably is your issue.

it looks like you will have to configure your setup according to the notes.

https://github.com/ezsystems/ezpu...rnel/pull/1224#issuecomment-93655357

EDIT:

In the note it looks like legacy search engine is implemented, but I am not sure if the legacy drive will use ezfind. 

Modified on Thursday 16 April 2015 5:49:35 pm by Douglas Hammond

Thursday 16 April 2015 11:52:15 pm

Hello Everyone,

I thought it would be worth pointing out that Andre just created a new ezpublish-legacy tag 'v2015.01.02' about 15min ago:

https://github.com/ezsystems/ezpublish-legacy/releases/tag/v2015.01.2

This should address this threads original issue and do so by providing an ezpublish-legacy tag which can be used instead of dev-master which I hope can help the folks who wish to use the fix but have concerns using dev-master.

I hope this helps!

Cheers,
Heath

Friday 17 April 2015 9:22:28 am

Quote from Johann Roc :

My first problem is resolved. But now i have a new problem happy.gif Emoticon

 Invalid search engine 'legacy'. Could not find a service tagged as 'ezpublish.searchEngine' with alias 'legacy'.

Hi Johann,

Douglas is right about semantic configuration for search engines pull request. Now that corresponding PR on ezplatform is merged, this problem should be resolved.

See https://github.com/ezsystems/ezplatform/pull/9

 

Cheers,

Petar

Tuesday 28 April 2015 4:54:02 pm

Hi Petar,

It's ok with the PR happy.gif Emoticon

Thanks

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from