在JBoss AS/EAP/WildFly中升级JSF/Mojarra [英] Upgrade JSF / Mojarra in JBoss AS / EAP / WildFly

查看:221
本文介绍了在JBoss AS/EAP/WildFly中升级JSF/Mojarra的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在JBoss服务器中升级Mojarra,并告诉它使用给定的Mojarra 2.x JAR代替启动日志中指示的JBoss自己的jboss-jsf-api_2.1_spec-2.0.1.Final.jar?

How do I upgrade Mojarra in JBoss server and tell it use the given Mojarra 2.x JARs instead of JBoss own jboss-jsf-api_2.1_spec-2.0.1.Final.jar as indicated in startup log?

如果相关,那么我目前正在使用JBoss AS 7.1.

If that's relevant, I am currently using JBoss AS 7.1.

推荐答案

以下过程适用于 JBoss AS 7.2 + JBoss EAP 6.1 + JBoss WildFly 8 + ,并假定您完全控制服务器的安装和配置.这将升级服务器范围的默认 JSF版本:

The below procedure applies to JBoss AS 7.2+, JBoss EAP 6.1+, and JBoss WildFly 8+ and assumes that you've full control over the server installation and configuration. This upgrades the server-wide default JSF version:

  • 下载单个Mojarra API impl 文件(因此不是单个javax.faces.jar文件).当前最新的2.1.x版本是2.1.29,当前最新的2.2.x版本是2.2.14.假设您要升级到2.2.x.您可以从其Maven存储库分别下载它们:
    • Download the individual Mojarra API and impl files (and thus not the single javax.faces.jar file). Current latest 2.1.x version is 2.1.29 and current latest 2.2.x version is 2.2.14. Let's assume that you want to upgrade to 2.2.x. You can download them individually from their Maven repository:
      • jsf-api-2.2.14.jar
      • jsf-impl-2.2.14.jar
      • 删除或备份旧的JAR文件(请勿将其保存在同一文件夹中,甚至不要重命名!).
      • 在其中放入jsf-api-2.2.14.jar文件.
      • 打开module.xml文件并编辑<resource-root>以指定新文件名,如<resource-root path="jsf-api-2.2.14.jar"/>
      • Delete or backup the old JAR file (do NOT keep it in the same folder, even not renamed!).
      • Put jsf-api-2.2.14.jar file in there.
      • Open module.xml file and edit <resource-root> to specify the new file name as in <resource-root path="jsf-api-2.2.14.jar"/>
      • 删除或备份旧的JAR文件(请勿将其保存在同一文件夹中,甚至不要重命名!).
      • 在其中放入jsf-impl-2.2.14.jar文件.
      • 打开module.xml文件并编辑<resource-root>以指定新文件名,如<resource-root path="jsf-impl-2.2.14.jar"/>
      • Delete or backup the old JAR file (do NOT keep it in the same folder, even not renamed!).
      • Put jsf-impl-2.2.14.jar file in there.
      • Open module.xml file and edit <resource-root> to specify the new file name as in <resource-root path="jsf-impl-2.2.14.jar"/>
      • 删除/standalone/data的所有内容(当然,自定义数据文件夹(例如包含上载文件的文件夹)除外)
      • 删除/standalone/deployments
      • 的所有内容
      • 删除/standalone/tmp的所有内容
      • Trash all contents of /standalone/data (except of custom data folders like folder containing uploaded files, of course)
      • Trash all contents of /standalone/deployments
      • Trash all contents of /standalone/tmp

      相同的过程适用于 JBoss AS 7.0/7.1 JBoss EAP 6.0 ,您只需要在/modules/*中浏览而不是在/modules/system/layers/base/*中浏览,并且您需要以明确删除旧的.index文件(如果有的话)(JBoss将自动创建一个文件).另外,如果API文件夹中的module.xml缺少<dependencies>内的<module name="com.sun.jsf-impl"/>,那么您需要手动添加它.

      The same procedure applies to JBoss AS 7.0/7.1 and JBoss EAP 6.0, you only need to browse in /modules/* instead of /modules/system/layers/base/*, and you need to explicitly delete the old .index file there, if any (JBoss will autocreate one). Also, if the module.xml in API folder misses <module name="com.sun.jsf-impl"/> inside <dependencies>, then you need to manually add it.

      重要说明是,在部署期间,低于2.2.7的Mojarra 2.2.x版本将在AS/EAP中失败,但以下情况除外:org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.faces.flow.builder.FlowDefinition.然后,您基本上有2个选择:降级到Mojarra 2.1.x,或升级到至少2.2.7或更高版本.

      Important note is that Mojarra 2.2.x versions older than 2.2.7 will fail in AS/EAP during deployment with the following exception: org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.faces.flow.builder.FlowDefinition. You've then basically 2 options: downgrade to Mojarra 2.1.x, or upgrade to at least 2.2.7 or newer.

      如果您想升级到 Mojarra 2.3 ,该版本在Maven上不再提供2-JAR变体,则需要根据以下内容手动创建2-JAR变体按照以下过程的javax.faces.jar文件:

      In case you'd like to upgrade to Mojarra 2.3, which doesn't offer a 2-JAR variant anymore on Maven, you'd need to manually create the 2-JAR variant based on javax.faces.jar file as per this procedure: How to install one jar variant of JSF (javax.faces.jar) on WildFly.

      这篇关于在JBoss AS/EAP/WildFly中升级JSF/Mojarra的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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