I have developed application in symfony2.3, it's working perfect in development environment but while I move to production it throws error. I tried but it can't resolve.

Following all error comes form different page : This error comes while I tried to access my home page.

Fatal error: Uncaught exception 'ReflectionException' with message 'Class Cl\CommonBundle\Entity\integer does not exist' in /opt/lampp/htdocs/Cl/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php:795 Stack trace: #0 /opt/lampp/htdocs/Cl/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php(795): ReflectionParameter->getClass() #1 [internal function]: Doctrine\Common\Proxy\ProxyGenerator->generateMethods(Object(Doctrine\ORM\Mapping\ClassMetadata)) #2 /opt/lampp/htdocs/Cl/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php(276): call_user_func(Array, Object(Doctrine\ORM\Mapping\ClassMetadata)) #3 /opt/lampp/htdocs/Cl/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php(155): Doctrine\Common\Proxy\ProxyGenerator->generateProxyClass(Object(Doctrine\ORM\Mapping\ClassMetadata), '/opt/lampp/htdo...') #4 /opt/lampp/htdocs/Cl/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php(71 in /opt/lampp/htdocs/Cl/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php on line 51

When I clear cache of production environment in command line, it throws following exception :

[Doctrine\Common\Proxy\Exception\UnexpectedValueException]
The type hint of parameter "user" in method "setUser" in class "Cl\CommonBundle\Entity\GroupEventComment" is invalid.

[ReflectionException]
Class Collegelife\CommonBundle\Entity\integer does not exist

Once this has been solved then it throws to other class, so I can't understand that what's happen.

When I tried to login into page :

it shows me error like :

Fatal error: require(): Failed opening required '/opt/lampp/htdocs/collegelife/app/cache/prod/doctrine/orm/Proxies/__CG__CollegelifeCommonBundleEntityUniversity.php' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/collegelife/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 207

1

There are 1 answers

1
xuejielili On

I had the same question and resolved it. Because My Entity's setting.

You can't type hint on a scalar type (integer/string/boolean etc) in PHP. e.g.

public function setSortOrder(\integer $sortOrder)

Should be:

public function setSortOrder($sortOrder)