我正在使用弹簧配置文件,如
<beans:bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"
p:basenames="WEB-INF/i18n/messages,WEB-INF/i18n/application"
p:fallbackToSystemLocale="false" />
<beans:bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
<beans:property name="validationMessageSource" ref="messageSource" />
</beans:bean>
<annotation-driven validator="validator" />
<resources location="/, classpath:/META-INF/web-resources/" mapping="/resources/**" />
<default-servlet-handler/>
...
当我运行代码时,我得到错误
org.springframework.beans.factory.BeanCreationException: Error creating bean with
name 'validator' defined in ServletContext resource
[/WEB-INF/spring/appServlet/servlet-context.xml]: Error setting property
values; nested exception is org.springframework.beans.PropertyBatchUpdateException;
nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException:
Property 'validationMessageSource' threw exception; nested exception is
java.lang.NoClassDefFoundError: org/hibernate/validator/resourceloading
/ResourceBundleLocator
为什么我收到这个错误 o 用 messageSource 定义了 bean?
谢谢