During the validation of entity (before insertion) on my Spring MVC app I get the following error :
...
at io.undertow.server.Connectors.executeRoot
The error mentioned is occurring due to a possible clash of dependency versions.
WildFly already provides both hibernate-core and hibernate-validator dependencies in
In the case of WildFly10, the dependencies' versions are the following:
Therefore, on your pom.xml, you could place your Hibernate dependencies as provided and let the container use its own:
org.hibernate
hibernate-core
5.1.0.Final
provided
org.hibernate
hibernate-validator
5.2.4.Final
provided
But if you want to provide your own dependencies, as mentioned on WildFly 10 documentation, you should provide a jboss-deployment-structure.xml, where you basically tell WildFly to disregard it's own dependencies:
This way, the container will load the dependencies that were packaged with your application and that are present on your WAR's WEB-INF/lib folder.
EDIT
After going to the source code of PersistenceUtilHelper.isLoadedWithoutReference, one notices that, in Hibernate 5.1, it no longer references the class FieldInterceptionHelper, on line 119, where the error occurs. Whereas in the version 5.0 it still does.
I also suggest you to add the most recent version of the hibernate-entitymanager dependency, in order to be in accordance with the other Hibernate dependencies:
org.hibernate
hibernate-entitymanager
5.1.0.Final