Q:

Obscure error on Symfony on form->handleRequest() and validation

I have a Symfony 2.8.9 application where a single form cause a big obscure error on the line
$form->handleRequest($request);

My form is very simple : just an id and a commentaire field. It seems the error occurs during validation tasks (the full trace below).
[ERROR 1824] Element '{http://symfony.com/schema/dic/constraint-mapping}class', attribute 'name': 'Symfony\Component\Form\Form' is not a valid value of the atomic type 'xs:time'. (in file:/D:/Documents/workspace/MyProject/web/ - line 7, column 0)
[ERROR 1824] Element '{http://symfony.com/schema/dic/constraint-mapping}constraint', attribute 'name': 'Symfony\Component\Form\Extension\Validator\Constraints\Form' is not a valid value of the atomic type 'xs:time'. (in file:/D:/Documents/workspace/MyProject/web/ - line 8, column 0)
[ERROR 1824] Element '{http://symfony.com/schema/dic/constraint-mapping}property', attribute 'name': 'children' is not a valid value of the atomic type 'xs:time'. (in file:/D:/Documents/workspace/MyProject/web/ - line 9, column 0)
[ERROR 1824] Element '{http://symfony.com/schema/dic/constraint-mapping}constraint', attribute 'name': 'Valid' is not a valid value of the atomic type 'xs:time'. (in file:/D:/Documents/workspace/MyProject/web/ - line 10, column 0)
500 Internal Server Error - MappingException
1 linked Exception: InvalidArgumentException »

[2/2] MappingException: [ERROR 1824] Element '{http://symfony.com/schema/dic/constraint-mapping}class', attribute 'name': 'Symfony\Component\Form\Form' is not a valid value of the atomic type 'xs:time'. (in file:/D:/Documents/workspace/MyProject/web/ - line 7, column 0)
[ERROR 1824] Element '{http://symfony.com/schema/dic/constraint-mapping}constraint', attribute 'name': 'Symfony\Component\Form\Extension\Validator\Constraints\Form' is not a valid value of the atomic type 'xs:time'. (in file:/D:/Documents/workspace/MyProject/web/ - line 8, column 0)
[ERROR 1824] Element '{http://symfony.com/schema/dic/constraint-mapping}property', attribute 'name': 'children' is not a valid value of the atomic type 'xs:time'. (in file:/D:/Documents/workspace/MyProject/web/ - line 9, column 0)
[ERROR 1824] Element '{http://symfony.com/schema/dic/constraint-mapping}constraint', attribute 'name': 'Valid' is not a valid value of the atomic type 'xs:time'. (in file:/D:/Documents/workspace/MyProject/web/ - line 10, column 0)   -
in vendor\symfony\symfony\src\Symfony\Component\Validator\Mapping\Loader\XmlFileLoader.php at line 179   + 
at XmlFileLoader ->parseFile ('D:\Documents\workspace\MyProject\vendor\symfony\symfony\src\Symfony\Component\Form/Resources/config/validation.xml') 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Mapping\Loader\XmlFileLoader.php at line 40   + 
at XmlFileLoader ->loadClassMetadata (object(ClassMetadata)) 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Mapping\Loader\LoaderChain.php at line 57   + 
at LoaderChain ->loadClassMetadata (object(ClassMetadata)) 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Mapping\Loader\LoaderChain.php at line 57   + 
at LoaderChain ->loadClassMetadata (object(ClassMetadata)) 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory.php at line 128   + 
at LazyLoadingMetadataFactory ->getMetadataFor ('Traversable') 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory.php at line 124   + 
at LazyLoadingMetadataFactory ->getMetadataFor ('IteratorAggregate') 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory.php at line 124   + 
at LazyLoadingMetadataFactory ->getMetadataFor (object(Form)) 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Validator\RecursiveContextualValidator.php at line 343   + 
at RecursiveContextualValidator ->validateObject (object(Form), '', array('Default'), '1', object(ExecutionContext)) 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Validator\RecursiveContextualValidator.php at line 153   + 
at RecursiveContextualValidator ->validate (object(Form), null, false) 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Validator\RecursiveValidator.php at line 132   + 
at RecursiveValidator ->validate (object(Form)) 
in vendor\symfony\symfony\src\Symfony\Component\Form\Extension\Validator\EventListener\ValidationListener.php at line 68   + 
at ValidationListener ->validateForm (object(FormEvent), 'form.post_bind', object(EventDispatcher)) 
at call_user_func (array(object(ValidationListener), 'validateForm'), object(FormEvent), 'form.post_bind', object(EventDispatcher)) 
in app\cache\dev\classes.php at line 1858   + 
at EventDispatcher ->doDispatch (array(array(object(ValidationListener), 'validateForm'), array(object(DataCollectorListener), 'postSubmit')), 'form.post_bind', object(FormEvent)) 
in app\cache\dev\classes.php at line 1773   + 
at EventDispatcher ->dispatch ('form.post_bind', object(FormEvent)) 
in vendor\symfony\symfony\src\Symfony\Component\EventDispatcher\ImmutableEventDispatcher.php at line 43   + 
at ImmutableEventDispatcher ->dispatch ('form.post_bind', object(FormEvent)) 
in vendor\symfony\symfony\src\Symfony\Component\Form\Form.php at line 660   + 
at Form ->submit (array('commentaire' => 'dqsdqs', 'save' => '', '_token' => 'FogMqUyv366NxySj8w1t4PLEI03pIc_V3eoiQ0tHesA'), true) 
in vendor\symfony\symfony\src\Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler.php at line 116   +
at HttpFoundationRequestHandler ->handleRequest (object(Form), object(Request)) 
in vendor\symfony\symfony\src\Symfony\Component\Form\Form.php at line 489   + 
at Form ->handleRequest (object(Request)) 
in src\MyBundle\Controller\CalendrierController.php at line 34   + 
at CalendrierController ->addAction (object(Request)) 
at call_user_func_array (array(object(CalendrierController), 'addAction'), array(object(Request))) 
in vendor\symfony\symfony\src\Symfony\Component\HttpKernel\HttpKernel.php at line 144   + 
at HttpKernel ->handleRaw (object(Request), '1') 
in vendor\symfony\symfony\src\Symfony\Component\HttpKernel\HttpKernel.php at line 64   + 
at HttpKernel ->handle (object(Request), '1', true) 
in vendor\symfony\symfony\src\Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel.php at line 69   + 
at ContainerAwareHttpKernel ->handle (object(Request), '1', true) 
in vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php at line 185   + 
at Kernel ->handle (object(Request)) 
in web\app_dev.php at line 30   + 

[1/2] InvalidArgumentException: [ERROR 1824] Element '{http://symfony.com/schema/dic/constraint-mapping}class', attribute 'name': 'Symfony\Component\Form\Form' is not a valid value of the atomic type 'xs:time'. (in file:/D:/Documents/workspace/MyProject/web/ - line 7, column 0)
[ERROR 1824] Element '{http://symfony.com/schema/dic/constraint-mapping}constraint', attribute 'name': 'Symfony\Component\Form\Extension\Validator\Constraints\Form' is not a valid value of the atomic type 'xs:time'. (in file:/D:/Documents/workspace/MyProject/web/ - line 8, column 0)
[ERROR 1824] Element '{http://symfony.com/schema/dic/constraint-mapping}property', attribute 'name': 'children' is not a valid value of the atomic type 'xs:time'. (in file:/D:/Documents/workspace/MyProject/web/ - line 9, column 0)
[ERROR 1824] Element '{http://symfony.com/schema/dic/constraint-mapping}constraint', attribute 'name': 'Valid' is not a valid value of the atomic type 'xs:time'. (in file:/D:/Documents/workspace/MyProject/web/ - line 10, column 0)   -
in vendor\symfony\symfony\src\Symfony\Component\Config\Util\XmlUtils.php at line 96   + 
at XmlUtils ::loadFile ('D:\Documents\workspace\MyProject\vendor\symfony\symfony\src\Symfony\Component\Form/Resources/config/validation.xml', 'D:\Documents\workspace\MyProject\vendor\symfony\symfony\src\Symfony\Component\Validator\Mapping\Loader/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd') 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Mapping\Loader\XmlFileLoader.php at line 177   + 
at XmlFileLoader ->parseFile ('D:\Documents\workspace\MyProject\vendor\symfony\symfony\src\Symfony\Component\Form/Resources/config/validation.xml') 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Mapping\Loader\XmlFileLoader.php at line 40   + 
at XmlFileLoader ->loadClassMetadata (object(ClassMetadata)) 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Mapping\Loader\LoaderChain.php at line 57   + 
at LoaderChain ->loadClassMetadata (object(ClassMetadata)) 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Mapping\Loader\LoaderChain.php at line 57   + 
at LoaderChain ->loadClassMetadata (object(ClassMetadata)) 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory.php at line 128   + 
at LazyLoadingMetadataFactory ->getMetadataFor ('Traversable') 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory.php at line 124   + 
at LazyLoadingMetadataFactory ->getMetadataFor ('IteratorAggregate') 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory.php at line 124   + 
at LazyLoadingMetadataFactory ->getMetadataFor (object(Form)) 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Validator\RecursiveContextualValidator.php at line 343   + 
at RecursiveContextualValidator ->validateObject (object(Form), '', array('Default'), '1', object(ExecutionContext)) 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Validator\RecursiveContextualValidator.php at line 153   + 
at RecursiveContextualValidator ->validate (object(Form), null, false) 
in vendor\symfony\symfony\src\Symfony\Component\Validator\Validator\RecursiveValidator.php at line 132   + 
at RecursiveValidator ->validate (object(Form)) 
in vendor\symfony\symfony\src\Symfony\Component\Form\Extension\Validator\EventListener\ValidationListener.php at line 68   + 
at ValidationListener ->validateForm (object(FormEvent), 'form.post_bind', object(EventDispatcher)) 
at call_user_func (array(object(ValidationListener), 'validateForm'), object(FormEvent), 'form.post_bind', object(EventDispatcher)) 
in app\cache\dev\classes.php at line 1858   + 
at EventDispatcher ->doDispatch (array(array(object(ValidationListener), 'validateForm'), array(object(DataCollectorListener), 'postSubmit')), 'form.post_bind', object(FormEvent)) 
in app\cache\dev\classes.php at line 1773   + 
at EventDispatcher ->dispatch ('form.post_bind', object(FormEvent)) 
in vendor\symfony\symfony\src\Symfony\Component\EventDispatcher\ImmutableEventDispatcher.php at line 43   + 
at ImmutableEventDispatcher ->dispatch ('form.post_bind', object(FormEvent)) 
in vendor\symfony\symfony\src\Symfony\Component\Form\Form.php at line 660   + 
at Form ->submit (array('commentaire' => 'dqsdqs', 'save' => '', '_token' => 'FogMqUyv366NxySj8w1t4PLEI03pIc_V3eoiQ0tHesA'), true) 
in vendor\symfony\symfony\src\Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler.php at line 116   +
at HttpFoundationRequestHandler ->handleRequest (object(Form), object(Request)) 
in vendor\symfony\symfony\src\Symfony\Component\Form\Form.php at line 489   + 
at Form ->handleRequest (object(Request)) 
in src\MyBundle\Controller\CalendrierController.php at line 34   + 
at CalendrierController ->addAction (object(Request)) 
at call_user_func_array (array(object(CalendrierController), 'addAction'), array(object(Request))) 
in vendor\symfony\symfony\src\Symfony\Component\HttpKernel\HttpKernel.php at line 144   + 
at HttpKernel ->handleRaw (object(Request), '1') 
in vendor\symfony\symfony\src\Symfony\Component\HttpKernel\HttpKernel.php at line 64   + 
at HttpKernel ->handle (object(Request), '1', true) 
in vendor\symfony\symfony\src\Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel.php at line 69   + 
at ContainerAwareHttpKernel ->handle (object(Request), '1', true) 
in vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php at line 185   + 
at Kernel ->handle (object(Request)) 
in web\app_dev.php at line 30

The controller (only the addAction method):
public function addAction(Request $request)
{
    $calendrier = new Calendrier();
    $form = $this->createForm(CalendrierType::class, $calendrier);
    $hasError = false ;

    if ($request->isMethod('POST')) {
        // Here the error occurs
        $form->handleRequest($request);
    }

    return $this->render('MyBundle:Calendrier:add.html.twig', array(
        'form' => $form->createView()
    ));
}

The form (CalendrierType.php)
    

namespace MyBundle\Form ;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class CalendrierType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('commentaire', TextareaType::class, array('required' => false))
            ->add('save', SubmitType::class);
    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'MyBundle\Entity\Calendrier'
        ));
    }

    public function getBlockPrefix()
    {
        return 'mybundle_calendrier' ;
    }
}

And my Calendrier entity (Calendrier.php) :
<?php

namespace MyBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use MyBundle\Entity\AbstractEntity ;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Calendrier
 *
 * @ORM\Table(name="calendrier")
 * @ORM\Entity(repositoryClass="MyBundle\Repository\CalendrierRepository")
 */
class Calendrier extends AbstractEntity
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="commentaire", type="string", nullable=true)
     */
    private $commentaire;

    /************ Getters and setters ******/

     /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    public function getCommentaire() {
        return $this->commentaire;
    }

    public function setCommentaire($commentaire) {
        $this->commentaire = $commentaire;
        return $this;
    }
}

All of this is very simple. I have another bigger entity/Form/Controller with the same error, but two days ago, it was working fine, and I didn't changed anything in this other form nor in the config files...
The stack trace and Symfony error message are too strange for me, anyone can help me please ?

A:

I just restart the Apache server, then the error has gone, without changing a single space in the code.

