Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception: Target ManagerRegistry is not instantiable #85

Closed
fsasvari opened this issue Dec 16, 2019 · 8 comments
Closed

Exception: Target ManagerRegistry is not instantiable #85

fsasvari opened this issue Dec 16, 2019 · 8 comments

Comments

@fsasvari
Copy link

fsasvari commented Dec 16, 2019

Hi there!

I'm getting a weird error when I updated the package to version "1.3.3". Working with Laravel 6 version and Doctrine, tried to do the composer update and getting the following error:

Illuminate\Contracts\Container\BindingResolutionException : Target [Doctrine\Persistence\ManagerRegistry] is not instantiable while building [App\Console\Commands\SomeCommand, App\Support\EntityManager].

In my construct() method I inject the Doctrine\Common\Persistence\ManagerRegistry class. When I downgrade to version "1.2.0" everything works fine. Any help with this? Thank you!

@alcaeus
Copy link
Member

alcaeus commented Dec 16, 2019

The stack trace should show what is trying to instantiate that class - please report this error to that library instead. I'm not very familiar with Laravel and how they use the persistence library, but you may want to create an issue at https://github.com/laravel/framework/issues and cross-reference this issue here.

In particular, the Doctrine\Persistence\ManagerRegistry and Doctrine\Common\Persistence\ManagerRegistry interfaces are the same, except that the latter is deprecated.

@fsasvari
Copy link
Author

Yeah, but the problem is because 1.2.0 version works, but 1.3.3 version does not. I saw that the ManagerRegistry is deprecated, but which one should I use than in the newer version?

@alcaeus
Copy link
Member

alcaeus commented Dec 17, 2019

The problem is that a library that uses the persistence interfaces apparently doesn't handle the new class accordingly. That's nothing to be fixed here, it needs to be fixed downstream.

@xtrasmal
Copy link

xtrasmal commented Jan 7, 2020

@alcaeus Have you already researched the problem?

@malarzm
Copy link
Member

malarzm commented Jan 7, 2020

@xtrasmal there's nothing we can really investigate on our end.

@alcaeus
Copy link
Member

alcaeus commented Jan 7, 2020

@xtrasmal we've had a similar issue with a different framework, see neos/flow-development-collection#1891 for that fix. There's nothing else we can do.

@alcaeus alcaeus closed this as completed Jan 7, 2020
@xtrasmal
Copy link

xtrasmal commented Jan 7, 2020

@alcaeus @malarzm Thanks for your replies. I quickly looked into it and the problem is actually quite understandable. Frameworks that have some kind of Doctrine adapter or bridge have interfaces that alias ManagerRegistry into the service container(DIC or IOC) of the framework.
Changing the bootstrapping of the ManagerRegistry will solve those problems.

@olenchenko-a
Copy link

@alcaeus @malarzm Thanks for your replies. I quickly looked into it and the problem is actually quite understandable. Frameworks that have some kind of Doctrine adapter or bridge have interfaces that alias ManagerRegistry into the service container(DIC or IOC) of the framework. Changing the bootstrapping of the ManagerRegistry will solve those problems.

Hi, in which way you changed bootstrapig of ManagerRegistry ?

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

No branches or pull requests

5 participants