JBoss不会以Hibernate Validator开头 [英] JBoss will not start with Hibernate Validator

查看:111
本文介绍了JBoss不会以Hibernate Validator开头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Hibernate Validator.尝试启动JBoss时,我得到以下信息:

I am trying to use Hibernate Validator. When attempting to start my JBoss I get the following:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name   'org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.validator.internal.engine.ConfigurationImpl

我的环境是:

  • JBoss 5.2
  • Java 1.8
  • 春季3.2.11

这些是我必须使用的.

我首先尝试了以下pom条目.

I tried the following pom entries first.

<dependency>
    <groupId>javax.validation</groupId>
    <artifactId>validation-api</artifactId>
    <version>1.1.0.Final</version>
</dependency>

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

那没有用,给出了上面的错误.因此,我读到我可以转到最新的Hibernate Validator 5.1.3,并且不需要单独的javax依赖项,因此我删除了javax依赖项并将pom设置为休眠验证器的5.1.3版本.同样的问题.

That did not work, gave the above error. So I read that I could just go to the latest Hibernate Validator, 5.1.3 and would not need the separate javax dependency, so I removed the javax dependency and set the pom to version 5.1.3 of hibernate validator. Same issue.

我想念什么?我阅读的所有内容都准确显示了我所拥有的.我还有其他依赖吗?我已经看到过一些关于slfj的提及,我是否需要具有这种依赖关系?如果是,是什么版本?

What am I missing? Everything I read shows exactly what I have. Is there another dependency I am missing? I have seen some mention of slfj, do I need to have that dependency? If so, what version?

有人有一个适用于4.3.1或5.1.3的pom示例吗?

Anyone have an example of a pom for the 4.3.1 or 5.1.3 that works?

令人沮丧的是,这看起来应该很简单,所以我可能确实缺少一些明显的东西.

Frustrating, seems like this should be very simple, so probably something really obvious I am missing.

推荐答案

现在可以使用了.使用此配置:

Got it working for now. Went with this config:

<dependency>
    <groupId>javax.validation</groupId>
    <artifactId>validation-api</artifactId>
    <version>1.0.0.GA</version>
</dependency>

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>            
    <version>4.0.2.GA</version>
</dependency>

我知道这不是最新的,但我唯一能上班的人.无法使4.3.1或5.1.3正常工作.但这让我暂时走了.

I know this is not the latest, but the only one I could get working. Could not get 4.3.1 or 5.1.3 to work. But this gets me going for now.

这篇关于JBoss不会以Hibernate Validator开头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆