I've been searching forever to solve my problem. But I can't find any solution.
I always get this error message when I try to open the homepage:
Uncaught exception 'Doctrine\Common\Persistence\Mapping\MappingException' with message 'The class 'Test\Bundle\UserBundle\Entity\User' was not found in the chain configured namespaces ' in...
The weird thing is that I only get it when I have following URL:
But when I run it on this URL I don't get any error and my page is being displayed correctly:
My Configuration looks like this (config.yml):
# Doctrine Configuration
dbal:
default_connection: default
connections:
default:
driver: "%database_driver%"
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
test:
driver: "%database_driver2%"
host: "%database_host2%"
port: "%database_port2%"
dbname: "%database_name2%"
user: "%database_user2%"
password: "%database_password2%"
charset: UTF8
orm:
default_entity_manager: default
entity_managers:
default:
connection: default
mappings:
TestUserBundle:
type: annotation
And I call Doctrine in my custom service like this:
public function __construct(EntityManager $em)
{
$repositiory = $em->getRepository('Test\Bundle\UserBundle\Entity\User');
$this->user = $repositiory->find($_SERVER['AUTH_USER']);
}
My Symfony Application is running on an IIS Webserver.
Do you guys know where I made a mistake?