Search code examples
springtomcattomcat6hibernate-validatorspring-4

Spring 4.0 with Tomcat 6: EL version conflict


As per the migration guide, Spring 4.0 requires Hibernate Validator in version 4.3 or later and Tomcat in version 6.0.33 or later.

Hibernate Validator 4.3 depends upon EL 2.2 won't work with Tomcat 6.0.33 comes with EL 2.1. It will give below error:

NoSuchMethodError: javax.el.ExpressionFactory.newInstance()Ljavax/el/ExpressionFactory)

My app is deployed in Tomcat 6 and I do not have the rights to update the EL libs.

In this scenario, how to migrate to Spring 4.0 with Tomcat 6?


Solution

  • Hibernate Validator 4.3 depends upon EL 2.2 won't work with Tomcat 6.0.33 comes with EL 2.1

    That's not correct. Hibernate Validator 5.x depends on EL. You can find more information on how to get Validator 5 working on Tomcat here - http://hibernate.org/validator/faq/#does-hibernate-validator-5-x-work-with-tomcat-6. However, it will require that you update the libraries.

    In the case of Hibernate Validator 4.3, no EL libraries are needed.