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

Fatal error: Uncaught exception #1215

Closed
eexbee opened this issue Jul 23, 2013 · 4 comments
Closed

Fatal error: Uncaught exception #1215

eexbee opened this issue Jul 23, 2013 · 4 comments

Comments

@eexbee
Copy link

eexbee commented Jul 23, 2013

Hi

My site is working on local host in either app_dev or app as well. I uploaded my website to a host. now just works in app_dev. but in app.php I've got this error

Fatal error: Uncaught exception 'Doctrine\ORM\Mapping\MappingException' with message 'Class "Acme\UserBundle\Entity\User" sub class of "FOS\UserBundle\Model\User" is not a valid entity or mapped super class.' in /home/sbuos/public_html/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php:210 Stack trace: #0

/home/sbuos/public_html/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php(87): Doctrine\ORM\Mapping\MappingException::classIsNotAValidEntityOrMappedSuperClass('Acme\UserBundle...') #1 

/home/sbuos/public_html/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php(104): Doctrine\ORM\Mapping\Driver\AnnotationDriver->loadMetadataForClass('Acme\UserBundle...', Object(Doctrine\ORM\Mapping\ClassMetadata)) #2

 /home/sbuos/public_html/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php(113): Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain->loadMetadataForClass('Acme\UserBundle...', Object(Doctrine\ORM\Mapping\ClassMetadata)) in /home/sbuos/public_html/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php on line 210

apparently this error refers to FOSUserBundle but on the other hand, there is no error in app_dev mode or on localhost.

how can I fix this?

@stof
Copy link
Member

stof commented Jul 24, 2013

Does you host uses EAccelerator ? If yes, you have an issue: eaccelerator is stripping all comments when caching the opcode, including doc comments. This means that annotations get lost.

There is 2 ways to fix it:

  • disable EAccelerator (use APC or Opcache instead)
  • stop using annotations entirely in your project

@eexbee
Copy link
Author

eexbee commented Jul 24, 2013

@stof >> thank u very much. we were using eAccelerator. I should test again after host manager change it to APC.

but on localhost I tried using eAccelerator (after cleaning cache) and everything worked. why?

is there anyway to disable caching or something like what Yii framework does?

@stof
Copy link
Member

stof commented Jul 24, 2013

@eexbee check that you have the same eaccelerator config locally than on your host

@eexbee
Copy link
Author

eexbee commented Jul 24, 2013

@stof no you were right. I have the same problem with eAcc... on localhost too... it is definitely eAccelerator.

thank you very much

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

2 participants