如何在 GlassFish 中更新 Mojarra 版本 [英] How to update Mojarra version in GlassFish

查看:27
本文介绍了如何在 GlassFish 中更新 Mojarra 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更新我的 JSF 应用程序以使用 Mojarra 2.1.8 版.我将这些行添加到 WAR 包的 POM 文件中:

I want to update my JSF application to use Mojarra version 2.1.8. I added these lines into the POM file of the WAR package:

<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>javax.faces</artifactId>
    <version>2.1.8</version>
</dependency> 

我还添加了 JSF 存储库.我的包使用 Mojarra 2.1.8 版成功构建.但是当我打开 GlassFish 日志时,我看到部署了一个 Mojarra 版本 2.1.6.我错过了什么?我是否需要对 GlassFish 服务器进行一些配置?

I also added the JSF repository. I package is build successfully with the Mojarra version 2.1.8. But when I open the GlassFish log I see that there is a Mojarra version 2.1.6 deployed. What am I missing? Do I need to make some configuration into the GlassFish server?

推荐答案

GlassFish 本身已经与 JSF 捆绑在一起,默认情况下,它的类加载优先于 web 应用程序中捆绑的那个.您基本上需要告诉 GlassFish 改用 webapp 捆绑的 JSF.

GlassFish itself already ships with JSF bundled which get by default classloading precedence over the one bundled in the webapp. You basically need to tell GlassFish to use the webapp bundled JSF instead.

编辑 web 应用程序的 /WEB-INF/glassfish-web.xml(或 /WEB-INF/sun-web.xml 如果您使用的是第一个 GF3 版本)添加以下两个条目:

Edit the webapp's /WEB-INF/glassfish-web.xml (or /WEB-INF/sun-web.xml if you're using one of the first GF3 versions) to add the following two entries:

<class-loader delegate="false" />
<property name="useBundledJsf" value="true" />

GlassFish 然后将使用 webapp 捆绑的 JSF.

GlassFish will then use the webapp bundled JSF instead.

或者,如果您对 GlassFish 拥有完全的管理员控制权,那么您也可以将其复制到 /glassfish/modules 目录中,替换旧版本,以便将其应用于所有网络应用程序.

Alternatively, if you have full admin control over GlassFish, then you can also copy it in the /glassfish/modules directory, replacing the older version, so that it get applied on all webapps.

这篇关于如何在 GlassFish 中更新 Mojarra 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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