ClassNotFoundException: javax.validation.ValidatorFactory

后端 未结 2 1340
北海茫月
北海茫月 2020-12-12 05:00

I am trying to run a Spring MVC application in my local machine through Tomcat, but I am seeing:

NoClassDefFoundError: javax/validation/ValidatorFactory


        
相关标签:
2条回答
  • 2020-12-12 05:23

    You have the necessary jar file you need in hibernate-validator. This jar includes the javax.validation.ValidatorFactoryvalidation-api. So if you are including validation-api explicitly, you might have dependency conflicts. If not, you might just be having class reloading issues. Try cleaning your tomcat and restarting your IDE.

    0 讨论(0)
  • 2020-12-12 05:30

    I had the same problem. For 2 months i was trying to find solution.

    There was a error i made. I copied hibernate validator jar and pasted it in java installation directory.

    Now i was using maven which also downloaded the validator jar.

    There where two jars present and so the error arise. The problem was solved accidentally when i reinstalled java in my system.

    0 讨论(0)
提交回复
热议问题