如何将休眠验证器4.3.0.Final升级到Glassfish 3.1.2? [英] How to upgrade the hibernate-validator 4.3.0.Final to the Glassfish 3.1.2?

查看:35
本文介绍了如何将休眠验证器4.3.0.Final升级到Glassfish 3.1.2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,Hibernate Validator已发布最新版本4.3.0.Final(在此处).我已尝试按照以下步骤将其升级到我的Glassfish 3.1.2:-

At the moment, the Hibernate Validator has released the latest version as 4.3.0.Final here. I have tried to upgrade it to my Glassfish 3.1.2 as the following step: -

1. Remove the GLASSFISH/glassfish/modules/bean-validator.jar
2. Copying the hibernate-validator-4.3.0.Final.jar to GLASSFISH/glassfish/modules
3. Restart the Glassfish
4. The Glassfish cannot start. It seems hang.

通过Google搜索之后,我发现名为"bean-validator.jar"的文件是Glassfish团队作为OSGi版本创建的.可悲的是,我找不到如何创建它.您能帮忙提供进一步的建议吗?非常感谢您的提前帮助.我期待着您的回音.

After searching via the Google, I've found that the file named "bean-validator.jar" was created by the Glassfish team as an OSGi version. Sadly, I cannot find how to create it. Could you please help to advise further? Thank you very much for your help in advance. I'm looking forward to hearing from you soon.

推荐答案

有关如何构建Glassfish的bean-validator.jar的描述(略过时),请参见

A (slightly outdated) description of how to build Glassfish's bean-validator.jar can be found here.

通常需要一个OSGi捆绑软件,其中包括Hibernate Validator本身和Bean Validation API.使用此捆绑包,您应该能够替换原始的bean-validator.jar.此外,您还需要JBoss Logging捆绑包,该捆绑包自Hibernate Validator从4.3版本开始就用作日志记录API,并且已经以OSGi捆绑包的形式出现.

What's needed in general is an OSGi bundle which includes Hibernate Validator itself and the Bean Validation API. With this bundle you should be able to replace the original bean-validator.jar. Additionally you need the JBoss Logging bundle, which is used since release 4.3 by Hibernate Validator as logging API and already comes in form of an OSGi bundle.

如果您正在构建Web应用程序,则还可以将HV 4.3打包在WAR和

If you're building a web application, you could also package HV 4.3 within your WAR and turn off class loader delegation by providing the file WEB-INF/glassfish-web.xml with the following contents:

<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app>
    <class-loader delegate="false" />
</glassfish-web-app>

这样,将从您的应用程序而不是从Glassfish提供的模块中加载HV类.

That way the HV classes will be loaded from your application instead of from the module provided by Glassfish.

您可能还对问题 GLASSFISH-15648 感兴趣,该问题旨在提供HV专用的Glassfish更新程序包.

You might also be interested in the issue GLASSFISH-15648 which aims to provide a dedicated Glassfish update package for HV.

这篇关于如何将休眠验证器4.3.0.Final升级到Glassfish 3.1.2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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