maven构建时测试过程出现javax.validation.ValidationException: Unable to instantiate Configuration异常

maven构建时测试过程出现javax.validation.ValidationException: Unable to instantiate Configuration异常

旧伤慢歌 发布于 2021-11-30 字数 1026 浏览 834 回复 1

@江南白衣 你好,想跟你请教个问题:maven构建时测试过程出现javax.validation.ValidationException: Unable to instantiate Configuration异常 不知道是哪里的问题,具体的异常如下

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springside.modules.beanvalidator.BeanValidatorsTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.validation.Validator org.springside.modules.beanvalidator.BeanValidatorsTest.validator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'validator' defined in class path resource [applicationContext-core-test.xml]: Invocation of init method failed; nested exception is javax.validation.ValidationException: Unable to instantiate Configuration.

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

扫码加入群聊

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无人问我粥可暖 2021-11-30 1 楼

加上hibernate-validator依赖jar,

<dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>4.2.0.Final</version>
        </dependency>

或者在在sessionFactory的hibernateProperties属性中加上这样一个键值对!

javax.persistence.validation.mode=none