Wildfly 18 deployment error

I have created a single war file and deployed to wildfly 18.0.1. When I login to the application I get the following error: “NoSuchMethodError: org.hibernate.validator.HibernateValidatorConfiguration.addMapping(Lorg/hibernate/validator/cfg/ConstraintMapping;)Lorg/hibernate/validator/BaseHibernateValidatorConfiguration;”
I suspect this is to do with the wildfly bean validator but am not getting any pointers on how to resolve this. Kindly assist.

Hi,

Developers manual has instructions regarding deployment to WildFly 18. You need to replace hibernate-validator jar file in the application server.
https://doc.cuba-platform.com/manual-7.2/wildfly_war_deployment.html

Also, what CUBA platform version do you use in the project?

Hi Alex,
I had followed the above steps of replacing the hibernate validator file but still got the message. Am using Cuba platform version 7.2. I eventually managed to deploy using an uber jar deployment but it would be nice to know what could be causing the error on wildfly.

Hi,
I have just re-tested deployment of sample application based on CUBA 7.2.1 to the WildFly 18.0.1.Final.

Application starts successfully, and bean validation mechanism in entity editors works fine.

This hassle with WildFly is required because CUBA application has one version of the hibernate-validator inside, and WildFly has another version of the hibernate-validator bundled. These versions are incompatible (problem known as “JAR hell”).

CUBA 7.2.1 - brings hibernate-validator-6.1.1.Final.jar
WildFly 18.0.1 - has hibernate-validator-6.0.18.Final.jar in the modules/system/layers/base/org/hibernate/validator/main subfolder.

So you have to perform this hack described in the documentation:

  • Compare the Hibernate Validator versions in WildFly and CUBA application. If the platform uses a newer version, replace the C:\wildfly\modules\system\layers\base\org\hibernate\validator\main\hibernate-validator-x.y.z-sometext.jar with the newer file from tomcat\shared\lib.
  • Update the JAR file version number in the module.xml file which is located in the same directory.