I'm having a problem in production environment while using two entity managers, with a "class not found" problem while Doctrine tries to get my custom User class.
I think that the problem can be related with this strange behaviour:
If I execute
php app/console doctrine:mapping:info
Found 1 mapped entities:
[OK] MyFirm\UserManagerBundle\Entity\User
But if I execute:
php app/console doctrine:mapping:info --env=prod
[Exception]
You do not have any mapped Doctrine ORM entities according to the current configuration. If you have entities or mapping files you should check your mapping configuration for
errors.
Only if specify the actual entity manager I get my User class:
________________________________
Este mensaje y cualquier fichero anexo está dirigido exclusivamente a los destinatarios especificados. La información contenida puede ser confidencial y/o estar legalmente protegida y no necesariamente refleja la opinión de esta compañía. Si usted recibe este mensaje por error, por favor comuníqueselo inmediatamente al remitente y elimínelo.
This message and any attached files are intended solely for the addressee/s identified herein. It may contain confidential and/or legally privileged information and may not necessarily represent the opinion of this Company. If you receive this message in error, please immediately notify the sender and delete it.
___________________________________________________________________________ ___________________________________________________________________________ _______________________________________________________
I've found what seems to be a bug in Symfony: the default entity manager must be named "default" if you want it to work in Production environment.
After changing it, now it works flawlessly.
El 11/10/2012 9:24, David Marín Carreño escribió:
Hello all.
I'm having a problem in production environment while using two entity managers, with a "class not found" problem while Doctrine tries to get my custom User class.
I think that the problem can be related with this strange behaviour:
If I execute
php app/console doctrine:mapping:info
Found 1 mapped entities:
[OK] MyFirm\UserManagerBundle\Entity\User
But if I execute:
php app/console doctrine:mapping:info --env=prod
[Exception]
You do not have any mapped Doctrine ORM entities according to the current configuration. If you have entities or mapping files you should check your mapping configuration for
errors.
Only if specify the actual entity manager I get my User class:
________________________________
Este mensaje y cualquier fichero anexo está dirigido exclusivamente a los destinatarios especificados. La información contenida puede ser confidencial y/o estar legalmente protegida y no necesariamente refleja la opinión de esta compañía. Si usted recibe este mensaje por error, por favor comuníqueselo inmediatamente al remitente y elimínelo.
This message and any attached files are intended solely for the addressee/s identified herein. It may contain confidential and/or legally privileged information and may not necessarily represent the opinion of this Company. If you receive this message in error, please immediately notify the sender and delete it.
___________________________________________________________________________ ___________________________________________________________________________ _______________________________________________________
--
If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to symfony2@googlegroups.com<mailto:symfony2@googlegroups.com>
To unsubscribe from this group, send email to
symfony2+unsubscribe@googlegroups.com<mailto:symfony2+unsubscribe@googlegro ups.com>
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
________________________________
Este mensaje y cualquier fichero anexo está dirigido exclusivamente a los destinatarios especificados. La información contenida puede ser confidencial y/o estar legalmente protegida y no necesariamente refleja la opinión de esta compañía. Si usted recibe este mensaje por error, por favor comuníqueselo inmediatamente al remitente y elimínelo.
This message and any attached files are intended solely for the addressee/s identified herein. It may contain confidential and/or legally privileged information and may not necessarily represent the opinion of this Company. If you receive this message in error, please immediately notify the sender and delete it.
___________________________________________________________________________ ___________________________________________________________________________ _______________________________________________________
The main problem on multiple entity managers is that you had to define which bundle what entity manger should manage for you, so the default auto_mapping want work anymore.
As second be sure you clear your cache of the dev an prod environment (if i change something in my configuration and clear it everytime i got less nasty moments)
And the third, be sure you set in the orm and dbal config the default entity_manager
best regards,
Treml Martin
Am Donnerstag, 11. Oktober 2012 10:24:42 UTC+2 schrieb David Marín:
> I've found what seems to be a bug in Symfony: the default entity manager > must be named "default" if you want it to work in Production environment.
> After changing it, now it works flawlessly.
> El 11/10/2012 9:24, David Marín Carreño escribió:
> Hello all.
> I'm having a problem in production environment while using two entity > managers, with a "class not found" problem while Doctrine tries to get my custom > User class.
> I think that the problem can be related with this strange behaviour:
> If I execute
> php app/console doctrine:mapping:info
> Found 1 mapped entities:
> [OK] MyFirm\UserManagerBundle\Entity\User
> [Exception]
> You do not have any mapped Doctrine ORM entities according to the current > configuration. If you have entities or mapping files you should check your > mapping configuration for
> errors.
> Only if specify the actual entity manager I get my User class:
> ------------------------------
> Este mensaje y cualquier fichero anexo está dirigido exclusivamente a los > destinatarios especificados. La información contenida puede ser > confidencial y/o estar legalmente protegida y no necesariamente refleja la > opinión de esta compañía. Si usted recibe este mensaje por error, por favor > comuníqueselo inmediatamente al remitente y elimínelo.
> This message and any attached files are intended solely for the > addressee/s identified herein. It may contain confidential and/or legally > privileged information and may not necessarily represent the opinion of > this Company. If you receive this message in error, please immediately > notify the sender and delete it.
> ___________________________________________________________________________ ___________________________________________________________________________ _______________________________________________________
> -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com
> You received this message because you are subscribed to the Google
> Groups "Symfony2" group.
> To post to this group, send email to sym...@googlegroups.com <javascript:>
> To unsubscribe from this group, send email to
> symfony2+u...@googlegroups.com <javascript:>
> For more options, visit this group at
> http://groups.google.com/group/symfony2?hl=en
> ------------------------------
> Este mensaje y cualquier fichero anexo está dirigido exclusivamente a los > destinatarios especificados. La información contenida puede ser > confidencial y/o estar legalmente protegida y no necesariamente refleja la > opinión de esta compañía. Si usted recibe este mensaje por error, por favor > comuníqueselo inmediatamente al remitente y elimínelo.
> This message and any attached files are intended solely for the > addressee/s identified herein. It may contain confidential and/or legally > privileged information and may not necessarily represent the opinion of > this Company. If you receive this message in error, please immediately > notify the sender and delete it.
Hello. You are right: I've realized that the problem was also related to my security configuration, because whenever I disabled user authentication I had no problems.
As a matter of fact, I had a problem even in development environment if the User entity was not managed by default entity manager...
The main problem on multiple entity managers is that you had to define which bundle what entity manger should manage for you, so the default auto_mapping want work anymore.
As second be sure you clear your cache of the dev an prod environment (if i change something in my configuration and clear it everytime i got less nasty moments)
And the third, be sure you set in the orm and dbal config the default entity_manager
best regards,
Treml Martin
Am Donnerstag, 11. Oktober 2012 10:24:42 UTC+2 schrieb David Marín:
I've found what seems to be a bug in Symfony: the default entity manager must be named "default" if you want it to work in Production environment.
After changing it, now it works flawlessly.
El 11/10/2012 9:24, David Marín Carreño escribió:
Hello all.
I'm having a problem in production environment while using two entity managers, with a "class not found" problem while Doctrine tries to get my custom User class.
I think that the problem can be related with this strange behaviour:
If I execute
php app/console doctrine:mapping:info
Found 1 mapped entities:
[OK] MyFirm\UserManagerBundle\Entity\User
But if I execute:
php app/console doctrine:mapping:info --env=prod
[Exception]
You do not have any mapped Doctrine ORM entities according to the current configuration. If you have entities or mapping files you should check your mapping configuration for
errors.
Only if specify the actual entity manager I get my User class:
________________________________
Este mensaje y cualquier fichero anexo está dirigido exclusivamente a los destinatarios especificados. La información contenida puede ser confidencial y/o estar legalmente protegida y no necesariamente refleja la opinión de esta compañía. Si usted recibe este mensaje por error, por favor comuníqueselo inmediatamente al remitente y elimínelo.
This message and any attached files are intended solely for the addressee/s identified herein. It may contain confidential and/or legally privileged information and may not necessarily represent the opinion of this Company. If you receive this message in error, please immediately notify the sender and delete it.
___________________________________________________________________________ ___________________________________________________________________________ _______________________________________________________
--
If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com<http://symfony-project.com>
You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to sym...@googlegroups.com<javascript:>
To unsubscribe from this group, send email to
symfony2+u...@googlegroups.com<javascript:>
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
________________________________
Este mensaje y cualquier fichero anexo está dirigido exclusivamente a los destinatarios especificados. La información contenida puede ser confidencial y/o estar legalmente protegida y no necesariamente refleja la opinión de esta compañía. Si usted recibe este mensaje por error, por favor comuníqueselo inmediatamente al remitente y elimínelo.
This message and any attached files are intended solely for the addressee/s identified herein. It may contain confidential and/or legally privileged information and may not necessarily represent the opinion of this Company. If you receive this message in error, please immediately notify the sender and delete it.
___________________________________________________________________________ ___________________________________________________________________________ _______________________________________________________
--
If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to symfony2@googlegroups.com<mailto:symfony2@googlegroups.com>
To unsubscribe from this group, send email to
symfony2+unsubscribe@googlegroups.com<mailto:symfony2+unsubscribe@googlegro ups.com>
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
--
David Marín Carreño
SICE
Dirección Técnica.
Dpto. de Software Interurbano.
Tfno 91 623 23 36
E-mail: dma...@sice.com<mailto:dma...@sice.com>
________________________________
Este mensaje y cualquier fichero anexo está dirigido exclusivamente a los destinatarios especificados. La información contenida puede ser confidencial y/o estar legalmente protegida y no necesariamente refleja la opinión de esta compañía. Si usted recibe este mensaje por error, por favor comuníqueselo inmediatamente al remitente y elimínelo.
This message and any attached files are intended solely for the addressee/s identified herein. It may contain confidential and/or legally privileged information and may not necessarily represent the opinion of this Company. If you receive this message in error, please immediately notify the sender and delete it.
___________________________________________________________________________ ___________________________________________________________________________ _______________________________________________________
I think this is because the User Provider uses the default entity manger.
So you had to overwrite you UserProvider and set the entity manager to the on you need.
There are some Tutorials for custom user providers on symfony.com inside the book.
regards
Am Donnerstag, 11. Oktober 2012 16:51:35 UTC+2 schrieb David Marín:
> Hello. You are right: I've realized that the problem was also related to > my security configuration, because whenever I disabled user authentication > I had no problems.
> As a matter of fact, I had a problem even in development environment if > the User entity was not managed by default entity manager...
> other:
> connection: other
> mappings:
> DataBundle: ~
> The main problem on multiple entity managers is that you had to define > which bundle what entity manger should manage for you, so the default > auto_mapping want work anymore.
> As second be sure you clear your cache of the dev an prod environment (if > i change something in my configuration and clear it everytime i got less > nasty moments)
> And the third, be sure you set in the orm and dbal config the default > entity_manager
> best regards,
> Treml Martin
> Am Donnerstag, 11. Oktober 2012 10:24:42 UTC+2 schrieb David Marín:
>> I've found what seems to be a bug in Symfony: the default entity >> manager must be named "default" if you want it to work in Production >> environment.
>> After changing it, now it works flawlessly.
>> El 11/10/2012 9:24, David Marín Carreño escribió:
>> Hello all.
>> I'm having a problem in production environment while using two entity >> managers, with a "class not found" problem while Doctrine tries to get >> my custom User class.
>> I think that the problem can be related with this strange behaviour:
>> If I execute
>> php app/console doctrine:mapping:info
>> Found 1 mapped entities:
>> [OK] MyFirm\UserManagerBundle\Entity\User
>> [Exception]
>> You do not have any mapped Doctrine ORM entities according to the current >> configuration. If you have entities or mapping files you should check your >> mapping configuration for
>> errors.
>> Only if specify the actual entity manager I get my User class:
>> ------------------------------
>> Este mensaje y cualquier fichero anexo está dirigido exclusivamente a los >> destinatarios especificados. La información contenida puede ser >> confidencial y/o estar legalmente protegida y no necesariamente refleja la >> opinión de esta compañía. Si usted recibe este mensaje por error, por favor >> comuníqueselo inmediatamente al remitente y elimínelo.
>> This message and any attached files are intended solely for the >> addressee/s identified herein. It may contain confidential and/or legally >> privileged information and may not necessarily represent the opinion of >> this Company. If you receive this message in error, please immediately >> notify the sender and delete it.
>> ___________________________________________________________________________ ___________________________________________________________________________ _______________________________________________________
>> -- >> If you want to report a vulnerability issue on symfony, please send it to >> security at symfony-project.com
>> You received this message because you are subscribed to the Google
>> Groups "Symfony2" group.
>> To post to this group, send email to sym...@googlegroups.com
>> To unsubscribe from this group, send email to
>> symfony2+u...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/symfony2?hl=en
>> ------------------------------
>> Este mensaje y cualquier fichero anexo está dirigido exclusivamente a los >> destinatarios especificados. La información contenida puede ser >> confidencial y/o estar legalmente protegida y no necesariamente refleja la >> opinión de esta compañía. Si usted recibe este mensaje por error, por favor >> comuníqueselo inmediatamente al remitente y elimínelo.
>> This message and any attached files are intended solely for the >> addressee/s identified herein. It may contain confidential and/or legally >> privileged information and may not necessarily represent the opinion of >> this Company. If you receive this message in error, please immediately >> notify the sender and delete it.
> -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com
> You received this message because you are subscribed to the Google
> Groups "Symfony2" group.
> To post to this group, send email to sym...@googlegroups.com <javascript:>
> To unsubscribe from this group, send email to
> symfony2+u...@googlegroups.com <javascript:>
> For more options, visit this group at
> http://groups.google.com/group/symfony2?hl=en
> ------------------------------
> Este mensaje y cualquier fichero anexo está dirigido exclusivamente a los > destinatarios especificados. La información contenida puede ser > confidencial y/o estar legalmente protegida y no necesariamente refleja la > opinión de esta compañía. Si usted recibe este mensaje por error, por favor > comuníqueselo inmediatamente al remitente y elimínelo.
> This message and any attached files are intended solely for the > addressee/s identified herein. It may contain confidential and/or legally > privileged information and may not necessarily represent the opinion of > this Company. If you receive this message in error, please immediately > notify the sender and delete it.
El 11/10/2012 17:01, Mr. Tool escribió:
I think this is because the User Provider uses the default entity manger.
I think that User Provider uses the default entity manager in development environment.
In production environment, it seems that it uses the entity manager named "default".
So you had to overwrite you UserProvider and set the entity manager to the on you need.
There are some Tutorials for custom user providers on symfony.com inside the book.
Yes, in development env it worked flawlessly. In production, I can do it only if the entity manager is called "default".
regards
Am Donnerstag, 11. Oktober 2012 16:51:35 UTC+2 schrieb David Marín:
Hello. You are right: I've realized that the problem was also related to my security configuration, because whenever I disabled user authentication I had no problems.
As a matter of fact, I had a problem even in development environment if the User entity was not managed by default entity manager...
The main problem on multiple entity managers is that you had to define which bundle what entity manger should manage for you, so the default auto_mapping want work anymore.
As second be sure you clear your cache of the dev an prod environment (if i change something in my configuration and clear it everytime i got less nasty moments)
And the third, be sure you set in the orm and dbal config the default entity_manager
best regards,
Treml Martin
Am Donnerstag, 11. Oktober 2012 10:24:42 UTC+2 schrieb David Marín:
I've found what seems to be a bug in Symfony: the default entity manager must be named "default" if you want it to work in Production environment.
After changing it, now it works flawlessly.
El 11/10/2012 9:24, David Marín Carreño escribió:
Hello all.
I'm having a problem in production environment while using two entity managers, with a "class not found" problem while Doctrine tries to get my custom User class.
I think that the problem can be related with this strange behaviour:
If I execute
php app/console doctrine:mapping:info
Found 1 mapped entities:
[OK] MyFirm\UserManagerBundle\Entity\User
But if I execute:
php app/console doctrine:mapping:info --env=prod
[Exception]
You do not have any mapped Doctrine ORM entities according to the current configuration. If you have entities or mapping files you should check your mapping configuration for
errors.
Only if specify the actual entity manager I get my User class:
________________________________
Este mensaje y cualquier fichero anexo está dirigido exclusivamente a los destinatarios especificados. La información contenida puede ser confidencial y/o estar legalmente protegida y no necesariamente refleja la opinión de esta compañía. Si usted recibe este mensaje por error, por favor comuníqueselo inmediatamente al remitente y elimínelo.
This message and any attached files are intended solely for the addressee/s identified herein. It may contain confidential and/or legally privileged information and may not necessarily represent the opinion of this Company. If you receive this message in error, please immediately notify the sender and delete it.
___________________________________________________________________________ ___________________________________________________________________________ _______________________________________________________
--
If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com<http://symfony-project.com>
You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to sym...@googlegroups.com
To unsubscribe from this group, send email to
symfony2+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
________________________________
Este mensaje y cualquier fichero anexo está dirigido exclusivamente a los destinatarios especificados. La información contenida puede ser confidencial y/o estar legalmente protegida y no necesariamente refleja la opinión de esta compañía. Si usted recibe este mensaje por error, por favor comuníqueselo inmediatamente al remitente y elimínelo.
This message and any attached files are intended solely for the addressee/s identified herein. It may contain confidential and/or legally privileged information and may not necessarily represent the opinion of this Company. If you receive this message in error, please immediately notify the sender and delete it.
___________________________________________________________________________ ___________________________________________________________________________ _______________________________________________________
--
If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com<http://symfony-project.com>
You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to sym...@googlegroups.com<javascript:>
To unsubscribe from this group, send email to
symfony2+u...@googlegroups.com<javascript:>
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
--
David Marín Carreño
SICE
Dirección Técnica.
Dpto. de Software Interurbano.
Tfno 91 623 23 36
E-mail: dma...@sice.com<javascript:>
________________________________
Este mensaje y cualquier fichero anexo está dirigido exclusivamente a los destinatarios especificados. La información contenida puede ser confidencial y/o estar legalmente protegida y no necesariamente refleja la opinión de esta compañía. Si usted recibe este mensaje por error, por favor comuníqueselo inmediatamente al remitente y elimínelo.
This message and any attached files are intended solely for the addressee/s identified herein. It may contain confidential and/or legally privileged information and may not necessarily represent the opinion of this Company. If you receive this message in error, please immediately notify the sender and delete it.
___________________________________________________________________________ ___________________________________________________________________________ _______________________________________________________
--
If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to symfony2@googlegroups.com<mailto:symfony2@googlegroups.com>
To unsubscribe from this group, send email to
symfony2+unsubscribe@googlegroups.com<mailto:symfony2+unsubscribe@googlegro ups.com>
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
--
David Marín Carreño
SICE
Dirección Técnica.
Dpto. de Software Interurbano.
Tfno 91 623 23 36
E-mail: dma...@sice.com<mailto:dma...@sice.com>
________________________________
Este mensaje y cualquier fichero anexo está
> I think this is because the User Provider uses the default entity manger.
> I think that User Provider uses the default entity manager in > development environment.
> In production environment, it seems that it uses the entity manager named > "default".
> So you had to overwrite you UserProvider and set the entity manager to > the on you need.
> There are some Tutorials for custom user providers on symfony.com inside > the book.
> Yes, in development env it worked flawlessly. In production, I can do it > only if the entity manager is called "default".
> regards
> Am Donnerstag, 11. Oktober 2012 16:51:35 UTC+2 schrieb David Marín:
>> Hello. You are right: I've realized that the problem was also related >> to my security configuration, because whenever I disabled user >> authentication I had no problems.
>> As a matter of fact, I had a problem even in development environment if >> the User entity was not managed by default entity manager...
>> other:
>> connection: other
>> mappings:
>> DataBundle: ~
>> The main problem on multiple entity managers is that you had to define >> which bundle what entity manger should manage for you, so the default >> auto_mapping want work anymore.
>> As second be sure you clear your cache of the dev an prod environment (if >> i change something in my configuration and clear it everytime i got less >> nasty moments)
>> And the third, be sure you set in the orm and dbal config the default >> entity_manager
>> best regards,
>> Treml Martin
>> Am Donnerstag, 11. Oktober 2012 10:24:42 UTC+2 schrieb David Marín:
>>> I've found what seems to be a bug in Symfony: the default entity >>> manager must be named "default" if you want it to work in Production >>> environment.
>>> After changing it, now it works flawlessly.
>>> El 11/10/2012 9:24, David Marín Carreño escribió:
>>> Hello all.
>>> I'm having a problem in production environment while using two entity >>> managers, with a "class not found" problem while Doctrine tries to get >>> my custom User class.
>>> I think that the problem can be related with this strange behaviour:
>>> If I execute
>>> php app/console doctrine:mapping:info
>>> Found 1 mapped entities:
>>> [OK] MyFirm\UserManagerBundle\Entity\User
>>> [Exception]
>>> You do not have any mapped Doctrine ORM entities according to the >>> current configuration. If you have entities or mapping files you should >>> check your mapping configuration for
>>> errors.
>>> Only if specify the actual entity manager I get my User class:
>>> ------------------------------
>>> Este mensaje y cualquier fichero anexo está dirigido exclusivamente a >>> los destinatarios especificados. La información contenida puede ser >>> confidencial y/o estar legalmente protegida y no necesariamente refleja la >>> opinión de esta compañía. Si usted recibe este mensaje por error, por favor >>> comuníqueselo inmediatamente al remitente y elimínelo.
>>> This message and any attached files are intended solely for the >>> addressee/s identified herein. It may contain confidential and/or legally >>> privileged information and may not necessarily represent the opinion of >>> this Company. If you receive this message in error, please immediately >>> notify the sender and delete it.
>>> ___________________________________________________________________________ ___________________________________________________________________________ _______________________________________________________
>>> -- >>> If you want to report a vulnerability issue on symfony, please send it >>> to security at symfony-project.com
>>> You received this message because you are subscribed to the Google
>>> Groups "Symfony2" group.
>>> To post to this group, send email to sym...@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> symfony2+u...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/symfony2?hl=en
>>> ------------------------------
>>> Este mensaje y cualquier fichero anexo está dirigido exclusivamente a >>> los destinatarios especificados. La información contenida puede ser >>> confidencial y/o estar legalmente protegida y no necesariamente refleja la >>> opinión de esta compañía. Si usted recibe este mensaje por error, por favor >>> comuníqueselo inmediatamente al remitente y elimínelo.
>>> This message and any attached files are intended solely for the >>> addressee/s identified herein. It may contain confidential and/or legally >>> privileged information and may not necessarily represent the opinion of >>> this Company. If you receive this message in error, please immediately >>> notify the sender and delete it.
>> -- >> If you want to report a vulnerability issue on symfony, please send it to >> security at symfony-project.com
>> You received this message because you are subscribed to the Google
>> Groups "Symfony2" group.
>> To post to this group, send email to sym...@googlegroups.com
>> To unsubscribe from this group, send email to
>> symfony2+u...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/symfony2?hl=en
>> ------------------------------
>> Este mensaje y cualquier fichero anexo está dirigido exclusivamente a los >> destinatarios especificados. La información contenida puede ser >> confidencial y/o estar legalmente protegida y no necesariamente refleja la >> opinión de esta compañía. Si usted recibe este mensaje por error, por favor >> comuníqueselo inmediatamente al remitente y elimínelo.
El jueves, 11 de octubre de 2012 17:25:36 UTC+2, Mr. Tool escribió:
> Be sure you are using the right config and clearing cache before using > prod environment.
I'm totally sure of that. And I have repeated it several times. I have even renamed the default entity manager to "core", trying to mimic your configuration, with no luck.
> Also clear metadata cache of doctrine.
I think that the metadata cache is kept in web server memory through APC, and it is not used when using php app/console. Am I right?
The MappingException for class 'MyFirm\UserManagerBundle\Entity\User' is reproduced while trying to make a php app/console cache:warmup after a successful cache:clear.
> My entity manager is called core and also works in production environment > so i think its miss configuration or cache problem.
Perhaps the problem is related with the custom password encoder I am also using. Do you have a custom password encoder?
> Could you post your doctrine configuration!?
I can, but not today: it's holliday in Spain and I have access to the code only from the office. On next Monday I'll send it.
> Am Donnerstag, 11. Oktober 2012 17:10:17 UTC+2 schrieb David Marín:
>> El 11/10/2012 17:01, Mr. Tool escribió:
>> I think this is because the User Provider uses the default entity manger.
>> I think that User Provider uses the default entity manager in >> development environment.
>> In production environment, it seems that it uses the entity manager named >> "default".
>> So you had to overwrite you UserProvider and set the entity manager to >> the on you need.
>> There are some Tutorials for custom user providers on symfony.com inside >> the book.
>> Yes, in development env it worked flawlessly. In production, I can do it >> only if the entity manager is called "default".
>> regards
>> Am Donnerstag, 11. Oktober 2012 16:51:35 UTC+2 schrieb David Marín:
>>> Hello. You are right: I've realized that the problem was also related >>> to my security configuration, because whenever I disabled user >>> authentication I had no problems.
>>> As a matter of fact, I had a problem even in development environment if >>> the User entity was not managed by default entity manager...
>>> other:
>>> connection: other
>>> mappings:
>>> DataBundle: ~
>>> The main problem on multiple entity managers is that you had to define >>> which bundle what entity manger should manage for you, so the default >>> auto_mapping want work anymore.
>>> As second be sure you clear your cache of the dev an prod environment >>> (if i change something in my configuration and clear it everytime i got >>> less nasty moments)
>>> And the third, be sure you set in the orm and dbal config the default >>> entity_manager
>>> best regards,
>>> Treml Martin
>>> Am Donnerstag, 11. Oktober 2012 10:24:42 UTC+2 schrieb David Marín:
>>>> I've found what seems to be a bug in Symfony: the default entity >>>> manager must be named "default" if you want it to work in Production >>>> environment.
>>>> After changing it, now it works flawlessly.
>>>> El 11/10/2012 9:24, David Marín Carreño escribió:
>>>> Hello all.
>>>> I'm having a problem in production environment while using two entity >>>> managers, with a "class not found" problem while Doctrine tries to get >>>> my custom User class.
>>>> I think that the problem can be related with this strange behaviour:
>>>> If I execute
>>>> php app/console doctrine:mapping:info
>>>> Found 1 mapped entities:
>>>> [OK] MyFirm\UserManagerBundle\Entity\User
>>>> [Exception]
>>>> You do not have any mapped Doctrine ORM entities according to the >>>> current configuration. If you have entities or mapping files you should >>>> check your mapping configuration for
>>>> errors.
>>>> Only if specify the actual entity manager I get my User class:
>>>> ------------------------------
>>>> Este mensaje y cualquier fichero anexo está dirigido exclusivamente a >>>> los destinatarios especificados. La información contenida puede ser >>>> confidencial y/o estar legalmente protegida y no necesariamente refleja la >>>> opinión de esta compañía. Si usted recibe este mensaje por error, por favor >>>> comuníqueselo inmediatamente al remitente y elimínelo.
>>>> This message and any attached files are intended solely for the >>>> addressee/s identified herein. It may contain confidential and/or legally >>>> privileged information and may not necessarily represent the opinion of >>>> this Company. If you receive this message in error, please immediately >>>> notify the sender and delete it.
>>>> ___________________________________________________________________________ ___________________________________________________________________________ _______________________________________________________
>>>> -- >>>> If you want to report a vulnerability issue on symfony, please send it >>>> to security at symfony-project.com
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Symfony2" group.
>>>> To post to this group, send email to sym...@googlegroups.com
>>>> To unsubscribe from this group, send email to
>>>> symfony2+u...@googlegroups.com
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/symfony2?hl=en
>>>> ------------------------------
>>>> Este mensaje y cualquier fichero anexo está dirigido exclusivamente a >>>> los destinatarios especificados. La información contenida puede ser >>>> confidencial y/o estar legalmente protegida y no necesariamente refleja la >>>> opinión de esta compañía. Si usted recibe este mensaje por error, por favor >>>> comuníqueselo inmediatamente al remitente y elimínelo.
>>>> This message and any attached files are intended solely for the >>>> addressee/s identified herein. It may contain confidential and/or legally >>>> privileged information and may not necessarily represent the opinion of >>>> this Company. If you receive this message in error, please immediately >>>> notify the sender and delete it.
Here is my full doctrine configuration in config.yml:
# Doctrine Configuration
doctrine:
dbal:
default_connection: event_db
connections:
event_db:
driver: %event_database_driver%
host: %event_database_host%
port: %event_database_port%
dbname: %event_database_name%
user: %event_database_user%
password: %event_database_password%
charset: UTF8
user_config_db:
driver: %user_config_database_driver%
host: %user_config_database_host%
port: %user_config_database_port%
dbname: %user_config_database_name%
user: %user_config_database_user%
password: %user_config_database_password%
charset: UTF8
orm:
# Here we must set the db in which users info is kept
default_entity_manager: default
auto_generate_proxy_classes: %kernel.debug%
entity_managers:
event_db:
connection: event_db
mappings:
MyFirmEventManagerBundle: ~
default:
connection: user_config_db
mappings:
MyFirmUserManagerBundle: ~
El 12/10/2012 10:20, David Marín Carreño escribió:
El jueves, 11 de octubre de 2012 17:25:36 UTC+2, Mr. Tool escribió:
Be sure you are using the right config and clearing cache before using prod environment.
I'm totally sure of that. And I have repeated it several times. I have even renamed the default entity manager to "core", trying to mimic your configuration, with no luck.
Also clear metadata cache of doctrine.
I think that the metadata cache is kept in web server memory through APC, and it is not used when using php app/console. Am I right?
The MappingException for class 'MyFirm\UserManagerBundle\Entity\User' is reproduced while trying to make a php app/console cache:warmup after a successful cache:clear.
My entity manager is called core and also works in production environment so i think its miss configuration or cache problem.
Perhaps the problem is related with the custom password encoder I am also using. Do you have a custom password encoder?
Could you post your doctrine configuration!?
I can, but not today: it's holliday in Spain and I have access to the code only from the office. On next Monday I'll send it.
Am Donnerstag, 11. Oktober 2012 17:10:17 UTC+2 schrieb David Marín:
El 11/10/2012 17:01, Mr. Tool escribió:
I think this is because the User Provider uses the default entity manger.
I think that User Provider uses the default entity manager in development environment.
In production environment, it seems that it uses the entity manager named "default".
So you had to overwrite you UserProvider and set the entity manager to the on you need.
There are some Tutorials for custom user providers on symfony.com<http://symfony.com> inside the book.
Yes, in development env it worked flawlessly. In production, I can do it only if the entity manager is called "default".
regards
Am Donnerstag, 11. Oktober 2012 16:51:35 UTC+2 schrieb David Marín:
Hello. You are right: I've realized that the problem was also related to my security configuration, because whenever I disabled user authentication I had no problems.
As a matter of fact, I had a problem even in development environment if the User entity was not managed by default entity manager...
The main problem on multiple entity managers is that you had to define which bundle what entity manger should manage for you, so the default auto_mapping want work anymore.
As second be sure you clear your cache of the dev an prod environment (if i change something in my configuration and clear it everytime i got less nasty moments)
And the third, be sure you set in the orm and dbal config the default entity_manager
best regards,
Treml Martin
Am Donnerstag, 11. Oktober 2012 10:24:42 UTC+2 schrieb David Marín:
I've found what seems to be a bug in Symfony: the default entity manager must be named "default" if you want it to work in Production environment.
After changing it, now it works flawlessly.
El 11/10/2012 9:24, David Marín Carreño escribió:
Hello all.
I'm having a problem in production environment while using two entity managers, with a "class not found" problem while Doctrine tries to get my custom User class.
I think that the problem can be related with this strange behaviour:
If I execute
php app/console doctrine:mapping:info
Found 1 mapped entities:
[OK] MyFirm\UserManagerBundle\Entity\User
But if I execute:
php app/console doctrine:mapping:info --env=prod
[Exception]
You do not have any mapped Doctrine ORM entities according to the current configuration. If you have entities or mapping files you should check your mapping configuration for
errors.
Only if specify the actual entity manager I get my User class:
________________________________
Este mensaje y cualquier fichero anexo está dirigido exclusivamente a los destinatarios especificados. La información contenida puede ser confidencial y/o estar legalmente protegida y no necesariamente refleja la opinión de esta compañía. Si usted recibe este mensaje por error, por favor comuníqueselo inmediatamente al remitente y elimínelo.
This message and any attached files are intended solely for the addressee/s identified herein. It may contain confidential and/or legally privileged information and may not necessarily represent the opinion of this Company. If you receive this message in error, please immediately notify the sender and delete it.
___________________________________________________________________________ ___________________________________________________________________________ _______________________________________________________
--
If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com<http://symfony-project.com>
You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to sym...@googlegroups.com
To unsubscribe from this group, send email to
symfony2+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
________________________________
Este mensaje y cualquier fichero anexo está dirigido exclusivamente a los destinatarios especificados. La información contenida puede ser confidencial y/o estar legalmente protegida y no necesariamente refleja la opinión de esta compañía. Si usted recibe este mensaje por error, por favor comuníqueselo inmediatamente al remitente y elimínelo.
This message and any attached files are intended solely for the addressee/s identified herein. It may contain confidential and/or legally privileged information and may not