解决ValidationException: HV000183: Unable to initialize ‘javax.el.ExpressionFactory’错误

未分类 一条评论

错误如下:

Caused by: javax.validation.ValidationException: HV000183: Unable to initialize 'javax.el.ExpressionFactory'. Check that you have the EL dependencies on the classpath, or use ParameterMessageInterpolator instead
	at org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.buildExpressionFactory(ResourceBundleMessageInterpolator.java:123)
	at org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.<init>(ResourceBundleMessageInterpolator.java:47)
	at org.hibernate.validator.internal.engine.ConfigurationImpl.getDefaultMessageInterpolator(ConfigurationImpl.java:474)
	at org.hibernate.validator.internal.engine.ConfigurationImpl.getDefaultMessageInterpolatorConfiguredWithClassLoader(ConfigurationImpl.java:650)
	at org.hibernate.validator.internal.engine.ConfigurationImpl.getMessageInterpolator(ConfigurationImpl.java:397)
	at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.<init>(ValidatorFactoryImpl.java:183)
	at org.hibernate.validator.HibernateValidator.buildValidatorFactory(HibernateValidator.java:38)
	at org.hibernate.validator.internal.engine.ConfigurationImpl.buildValidatorFactory(ConfigurationImpl.java:364)
	at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:103)
	at io.renren.common.validator.ValidatorUtils.<clinit>(ValidatorUtils.java:40)
	... 31 more

添加依赖即可:

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

 

1条评论

r
reefe says: 回复

我跟你的错误一样 添加这个依赖也可以解决 可我的项目用的是mybatis 不晓得具体是什么影响的

发表评论

邮箱地址不会被公开。 必填项已用*标注

昵称 *