Spring + App Engine + JSR303

两盒软妹~` 提交于 2019-12-11 12:50:37

问题


I am new to Spring and having issues with JSR303 Validation. The problem appears to be with the <mvc:annotation-driven/> tag in spring-servlet.xml.

When I include this tag I get the following error on startup of the development server.

    SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0': Invocation of init method failed; nested exception is javax.validation.ValidationException: Unable to find a default provider

I have no idea how to interpret this message. I am using validation-api-1.0.0.GA.jar which is in the WEB-INF/lib directory and on my eclipse build path.

Any ideas?


回答1:


It looks like you don't have any JSR-303 provider in your classpath. validation-api-1.0.0.GA.jar defines only the JSR-303 contract, and you will need either hibernate validator or apache bean validation to be present to perform the validations.

You can check a question regarding the 2 JSR-303 providers here: Is there an implementation of JSR-303 (bean validation) available?



来源:https://stackoverflow.com/questions/3196285/spring-app-engine-jsr303

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!