I have a symfony2 app, in my local pc with ubuntu and works well, but in server with CentOS and Cpanel not works, I obtained this error:
Class "Propa\PageBundle\Entity\Page" is not a valid entity or mapped super class.
CRITICAL - Doctrine\ORM\Mapping\MappingException: Class "Propa\PageBundle\Entity\Page" is not a valid entity or mapped super class. (uncaught exception) at /home/estudi83/domains/serverprova.com.es/propa/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php line 216
I prove:
$page=$em->getRepository('PropaPageBundle:Page')->findOneBy(array('codi'=>'0001'));
And obtain this error: Unknown Entity namespace alias 'PropaPageBundle'.
And I prove:
$page=$em->getRepository('Propa\PageBundle\Entity\Page')->findOneBy(array('codi'=>'0001'));
And obtain same error: Class "Propa\PageBundle\Entity\Page" is not a valid entity or mapped super class.
This is the Entity:
<?php
namespace Propa\PageBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\Common\Collections\ArrayCollection;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Propa\PageBundle\Util;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass="Propa\PageBundle\Repository\PageRepository")
* @Gedmo\TranslationEntity(class="Propa\PageBundle\Entity\Translation\PageTranslation")
* @ORM\HasLifecycleCallbacks
* @Vich\Uploadable
*/
class Page {
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*/
protected $id;
I had proved:
auto_mapping: true
and
auto_mapping: false
mappings:
PageBundle: ~
But always obtain the same error.
What Can I do?
UPDATE: Resolved the problem was in eAccelerator with symfony2 annotations, I'm uninstalled eAccelerator and installed APC and works fine!!