FOSOAuthServerBundle
FOSOAuthServerBundle copied to clipboard
Attempted to load class "BaseClient" from namespace "FOS\OAuthServerBundle\Propel\om" error message when using Guzzle
Hello,
I am opening this ticket because i'm getting an issue like #418 but i think it's an other problem.
I'm creating a user provider which needs to call an URL before returns an user. I use Guzzle to do that :
When i use a GuzzleClient which implements a ClientInterface (as Propel/Client.php implements a ClientInterface which is not the same, in your bundle), i'm getting this error message : Attempted to load class "BaseClient" from namespace "FOS\OAuthServerBundle\Propel\om". Did you forget a "use" statement for another namespace?
My config is clean, i use orm as db_drive in fos_oauth_server configuration and when i'm not using a GuzzleClient, i have no problem, my user provider works.
I have not been able to determine the source of the problem for the moment but i think there is a namespace conflict between these bundles.
Got the same error, don't no where this comes from.
I've got the same! How have I solve it:
- remove vendor/friendsofsymfony/oauth-server-bundle/Propel/*
- fix bugs in MY code
- test that everything works
- reinstall friendsofsymfony/oauth-server-bundle
- test that everything still works
Thanks @GSokol !
This works. I deleted those files, and another exception came up which makes sense. I fixed the issues, removed vendor/friendsofsymfony/oauth-server-bundle
and did a composer install
.
Old issue, but the solving process don't really work.
Removing the vendor/friendsofsymfony/oauth-server-bundle/Propel/*
and test that everything work generate the autoloader or container definition. Then you can restore the deleted path and it don't cause any more trouble because it doesn't try to reach again this folder.
It can't work I you're trying to retrieve vendor during a build process (like travis or dockerization).
I've add a "exclude-from-classmap": ["**/oauth-server-bundle/Propel/**"]
in the composer.json to have only warning.
There's a similar issue on FOS/user-bundle where they're about to no longer support Propel.
Encountering this same exact problem. Can anyone explain why this happens and how to properly solve it?
For me the same happened after requiring Guzzle in a Sylius-Project and initiate an instance of Guzzle/Client. Strange thing.
@GSokol Thanks for the hint, I didn't get what you explained at first, so if it can help:
remove vendor/friendsofsymfony/oauth-server-bundle/Propel/*
fix bugs in MY code
test that everything works
reinstall friendsofsymfony/oauth-server-bundle
test that everything still works
- remove vendor/friendsofsymfony/oauth-server-bundle/Propel/*
- then re-execute the code triggering the issue
- the error should be much more explicit of what is the root cause of this issue