JBoss EAP XP 4.0 升级和迁移指南


Red Hat JBoss Enterprise Application Platform 7.4

从 JBoss EAP XP 3.0.x 升级和迁移到 JBoss EAP XP 4.0.0 的指南

Red Hat Customer Content Services

摘要

本文档提供有关将 JBoss EAP XP 3.0.x 升级到 JBoss EAP XP 4.0.0 以及任何必要的应用程序迁移的信息。

使开源包含更多

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。我们从这四个术语开始:master、slave、黑名单和白名单。由于此项工作十分艰巨,这些更改将在即将推出的几个发行版本中逐步实施。详情请查看 CTO Chris Wright 的信息

对红帽文档提供反馈

我们感谢您对我们文档的反馈。要提供反馈,您可以突出显示文档中的文本并添加注释。按照以下步骤了解提交对红帽文档的反馈。

先决条件

  • 登录到红帽客户门户。
  • 在红帽客户门户中,以多页 HTML 格式查看文档。

流程

  1. Feedback 查看现有的用户反馈信息。

    注意

    反馈功能仅在多页 HTML 格式中启用。

  2. 高亮标记您要提供反馈的文档中的部分。
  3. 在您选择的文本旁的提示菜单中,点 Add Feedback

    文本框将在页面右侧的"反馈"部分中打开。

  4. 在文本框中输入您的反馈,然后点 Submit

    您已创建了文档问题。

  5. 要查看问题,请单击反馈视图中的问题跟踪器链接。

第 1 章 JBoss EAP XP 升级

1.1. 升级和迁移

使用 JBoss EAP XP 4.0 升级和迁移指南中所述的步骤准备、升级和将您的 JBoss EAP XP 3.0.x 产品迁移到 JBoss EAP XP 4.0.0 产品。JBoss EAP XP 4.0.0 仅与 JBoss EAP 7.4 兼容。如果您在 JBoss EAP 7.3 上运行服务器,并且希望在其上应用 JBoss EAP XP 4.0.0 补丁,您必须首先将 JBoss EAP 7.3 实例升级到 JBoss EAP 7.4。

本指南参考可用于升级和迁移过程的工具。这些工具如下:

  • Migration Toolkit for Applications (MTA)
  • JBoss 服务器迁移工具

成功将 JBoss EAP XP 3.0.x 版本升级到 JBoss EAP XP 4.0.0 后,您可以开始为 JBoss EAP 7.4 实例实施任何应用程序迁移。

1.2. 准备升级和迁移

升级 JBoss EAP 扩展包后,您可能必须更新应用程序代码。

对于 JBoss EAP XP 4.0.0,JBoss EAP XP 3.0.x 应用程序可能存在一些向后兼容性。但是,如果您的应用程序使用从 JBoss EAP XP 4.0.0 中删除的功能,您可能需要更改应用程序代码。

在开始迁移过程前,请查看以下新项目:

  • JBoss EAP XP 功能添加到 JBoss EAP XP 4.0.0 版本中。
  • JBoss EAP XP 4.0.0 中添加了 MicroProfile 功能。
  • 对现有 MicroProfile 功能的增强。
  • JBoss EAP XP 4.0.0 中已弃用的功能和功能。
  • 从 JBoss EAP XP 4.0.0 中删除的功能和功能。
  • 您可以使用的工具从一个 EAP XP 版本迁移到另一个发行版本。

查看列出的项目后,分析您的环境并计划升级过程和迁移过程。确保您备份您计划迁移到 JBoss EAP XP 4.0.0 的任何应用程序。

现在,您可以将当前的 JBoss EAP XP 3.0.x 版本升级到 JBoss EAP XP 4.0.0。您可以在升级过程后实施任何应用程序迁移

1.3. 新的 JBoss EAP XP 功能

JBoss EAP XP 4.0.0 包含新功能,增强了用于 JBoss EAP 应用的 MicroProfile 规范的红帽实施。

注意

MicroProfile Reactive Messaging 子系统支持 Red Hat AMQ Streams。此功能实施 MicroProfile Reactive Messaging 2.0.1 API,红帽提供该功能作为 JBoss EAP XP 4.0.0 的技术预览。

红帽在 JBoss EAP 中测试了 Red Hat AMQ Streams 2021.Q4。但是,检查 Red Hat JBoss Enterprise Application Platform 支持的配置页面,以了解有关在 JBoss EAP XP 4.0.0 中测试的最新 Red Hat AMQ Streams 版本的信息。

技术预览功能不受红帽产品服务等级协议(SLA)支持,且功能可能并不完整。红帽不推荐在生产环境中使用它们。这些技术预览功能可以使用户提早试用新的功能,并有机会在开发阶段提供反馈意见。有关红帽技术预览功能支持范围的更多信息,请参阅 https://access.redhat.com/support/offerings/techpreview

JBoss EAP XP 4.0.0 在其发行版本中包括以下新功能:

  • 启动应用程序后运行 CLI 脚本。
  • 使用 --cli-script=<path to CLI script > 参数在运行时更新可引导 JAR 文件的服务器配置。
  • 使用 MicroProfile Reactive Messaging 1.0 API 在微服务之间发送和接收消息。
  • 使用 MicroProfile Reactive Messaging 1.0 API 编写和配置用户应用,以便应用能够高效和异步发送、接收和处理事件流。
  • 在您的服务器配置中启用 MicroProfile 被动消息传递功能,因为 MicroProfile 被动消息传递仅在您的服务器上预安装。
  • 使用 Kafka 快速启动查看 MicroProfile Reactive 消息传递,了解如何在服务器上完成以下任务:

    • 启用 MicroProfile Reactive Messaging 子系统。
    • 使用 MicroProfile 主动消息发送数据并从 Red Hat AMQ Streams 接收数据来运行和测试应用。

1.4. MicroProfile 功能的增强

JBoss EAP XP 4.0.0 发行版本包括以下 MicroProfile 4.1 组件的支持:

  • MicroProfile Config
  • MicroProfile Fault Tolerance
  • MicroProfile Health
  • MicroProfile JWT
  • MicroProfile Metrics
  • MicroProfile OpenAPI
  • MicroProfile OpenTracing
  • MicroProfile REST 客户端

1.5. 弃用和不支持的 MicroProfile 功能

在将应用程序迁移到 JBoss EAP XP 4.0.0 之前,请注意 JBoss EAP XP 3.0.x 中提供的一些功能可能已被弃用或不再被支持。

由于维护成本高、社区兴趣低和更好的替代解决方案,红帽消除了对某些技术的支持。

确保您参阅 Red Hat JBoss EAP XP 4.0.0 发行注记指南 以及任何不支持和已弃用的功能的 7.4.0 发行注记指南

您可以选择以下工具之一来升级 JBoss EAP XP 3.0.x 产品,并将其迁移到 JBoss EAP XP 4.0.0 产品:

  • JBoss EAP XP Manager
  • Migration Toolkit for Applications (MTA)
  • JBoss 服务器迁移工具

2.1. 使用 JBoss EAP XP 管理器升级 JBoss EAP XP

JBoss EAP XP 管理器是一个可执行的 jar 文件,您可以从 产品下载页面下载。使用 JBoss EAP XP 管理器从 JBoss EAP XP 3.0.x 升级到 JBoss EAP XP 4.0.0。

注意

您不能使用 JBoss EAP XP Manager 从 JBoss EAP XP 2.0.0 升级到 JBoss EAP XP 4.0.0。这是因为 JBoss EAP XP 2.0.0 只能在 JBoss EAP 7.3 上安装,而 JBoss EAP XP 3.0.0 和 JBoss EAP XP 4.0.0 需要 JBoss EAP 7.4。使用 JBoss 服务器迁移工具 从 JBoss EAP XP 2.0.0 升级到 JBoss EAP XP 4.0.0。

先决条件

流程

  1. 验证您的服务器是否位于正确的补丁中,并且安装了 JBoss EAP XP 3.0.x。

    $ java -jar jboss-eap-xp-manager.jar status --jboss-home=<path_to_eap>
    Starting JBoss EAP XP manager (4.0.0.Final-SNAPSHOT).
    
    You are currently on JBoss EAP XP 3.
    
    Enabled patch streams and their cumulative patch ids:
    - Patch stream: 'JBoss EAP'; Cumulative patch id: 'jboss-eap-7.4.3.CP'`
    - Patch stream: 'jboss-eap-xp-3.0'; Cumulative patch id: 'jboss-eap-xp-3.0.0.CP'
    
    Available commands in this state are: [remove, patch-apply]
    Copy to Clipboard Toggle word wrap
    重要

    确保您在输出中看到 jboss-eap-xp-3.0 补丁流。

  2. 使用 upgrade 命令将 JBoss EAP XP 3.0.x 升级到 JBoss EAP XP 4.0.0。

    $ java -jar jboss-eap-xp-manager.jar upgrade --jboss-home=<path_to_eap>
    Copy to Clipboard Toggle word wrap
  3. 输入 yes以接受支持策略提示

在更新服务器配置时使用 JBoss 服务器迁移工具,使其包含 JBoss EAP XP 4.0.0 的新功能和设置。您可以保留现有的 JBoss EAP XP 3.0.x 服务器配置,只要 JBoss EAP XP 4.0.0 支持配置。

JBoss 服务器迁移工具读取您现有的 JBoss EAP XP 3.0.x 服务器配置文件,并将任何新的必要的子系统添加到这些文件。该工具还使用新功能更新现有的子系统配置,并删除任何过时的子系统配置。

您可以使用 JBoss 服务器迁移工具为 JBoss EAP XP 4.0.0 配置迁移受管域中的单机服务器和服务器。

JBoss EAP XP 4.0.0 包含 JBoss 服务器迁移工具,因此您不需要下载文件并安装工具。发出 jboss-server-migration 脚本(位于 EAP_HOME/bin 目录中),以启动该工具。

Migration Toolkit for Applications (MTA)包括可扩展且可自定义的基于规则的工具,简化了 Jakarta 应用程序的迁移。您可以使用工具包来分析应用程序的 API、技术和架构。工具包提供您计划从 JBoss EAP XP 3.0.x 迁移到 JBoss EAP XP 4.0.0 的应用的报告。

您可以使用 MTA 分析标准 JBoss EAP 应用程序并可引导 JAR 应用程序。

MTA 报告输出以下信息:

  • 所有必需的迁移更改的详细解释。
  • 更改是强制的还是可选。
  • 改变是复杂还是简单。
  • 到需要迁移更新的代码链接。
  • 用于帮助您完成所需迁移更改的信息提示和链接。
  • 估算发现每个迁移问题的工作量程度,以及迁移应用程序的总预计工作量。

在将 JBoss EAP XP 3.0.x 应用程序代码和架构迁移到 JBoss EAP XP 4.0.0 之前,您还可以使用 MTA 来分析它们。将应用程序从 JBoss EAP XP 3.0.x 迁移到 JBoss EAP XP 4.0.0 的 MTA 规则集,报告了 XML 描述符、特定应用程序代码和参数,您需要在迁移到 JBoss EAP XP 4.0.0 时替换替代配置。

2.4. 从 JBoss EAP 7.3 及更早版本升级

JBoss EAP XP 4.0.0 仅在 JBoss EAP 7.4 上被支持。

如果您在 JBoss EAP 7.3 或更早版本上运行服务器,并希望使用 JBoss EAP XP,请将服务器升级到 JBoss EAP 7.4。在尝试安装 JBoss EAP XP 之前,先完成任何必要的迁移。

第 3 章 应用程序迁移

您可以将为较旧版本的 JBoss EAP XP 创建的应用程序迁移到 JBoss EAP XP 4.0.0。此外,您可以将为 Thorntail 编写的应用程序迁移到 JBoss EAP XP 4.0.0。

3.1. MicroProfile 应用程序迁移

MicroProfile 4.1 基于 Jakarta EE 8 平台。虽然 Jakarta EE 8 与 Java EE 8 向后兼容,但 Jakarta EE 8 依赖项替换所有 MicroProfile 规范的 Java EE 8 依赖项。

MicroProfile 4.1 包含所有主要 MicroProfile 规范的更新。

以下规格包括 MicroProfile 4.1 的 API 不兼容的更改:

  • MicroProfile Config
  • MicroProfile Fault Tolerance
  • MicroProfile Health
  • MicroProfile Metrics
  • MicroProfile OpenAPI

您必须将使用这些规格的应用程序更新至最新的 Jakarta EE 8 规范。

您可以通过选择以下方法之一将应用程序更新至 MicroProfile 4.1:

  • 将 MicroProfile 4.1 依赖项添加到项目的 pom.xml 文件中。
  • 使用 JBoss EAP XP BOM 将支持的工件导入到项目的 pom.xml 文件的 JBoss EAP XP 依赖项管理。

3.2. 可引导 JAR 应用程序迁移

在将 JBoss EAP XP 3.0.0 bootable JAR 应用迁移到 JBoss EAP XP 4.0.0 之前,您可能需要更新 JBoss EAP XP bootable JAR Maven 插件配置。

对于 JBoss EAP XP 4.0.0,extraServerContentDirs 配置元素替换了 extraServerContent 配置元素。此元素命名替换与预先存在的 extra-server-content-dirs 元素一致。

如果您在 JBoss EAP Maven 插件配置中使用了 extraServerContent 元素,您必须将此元素替换为 extraServerContentDirs 元素。如果您使用了 extra-server-content-dirs 元素,则不需要进行任何配置更改。

3.3. Thorntail 应用程序 Maven 项目迁移

Red Hat build of Thorntail 正在接近其生命期。如果您有 Thorntail 应用,您可以将应用程序的 Maven 项目迁移到 JBoss EAP XP。Thorntail 应用程序以两种方式打包:

  • 与 Thorntail 运行时一起打包为 Uberjar,一个可执行 JAR,
  • 打包在标准 WAR 存档中,可在 Thorntail hollow JAR 中部署和运行,它是一个仅限运行时的可执行文件 JAR。

迁移到 JBoss EAP XP 时,T Thorntail 应用可以打包为可引导 JAR,并修剪 JBoss EAP XP 运行时,使其包含应用所依赖的 MicroProfile 平台和其他技术。

将应用程序迁移到 JBoss EAP XP 时,您必须删除任何 Thorntail 部分依赖项,并将任何所需 MicroProfile 和 Jakarta EE 8 规范的工件添加到 Maven 项目依赖项。

注意

您可以在运行时使用 JBoss CLI 工具或 JBoss EAP Web 控制台来更改服务器配置。但是,与打包过程中所做的配置更改不同,在运行时对配置所做的任何更改都不会保留,并在重启可引导 JAR 时丢失。

如果您的 Thorntail 应用依赖于 Jakarta Enterprise Beans、Jakarta Server Faces、Jakarta Connector API、SOAP Web 服务或 CORBA,您可以将应用的 Maven 项目迁移到 JBoss EAP XP。

Galleon 层用于配置打包在可引导 JAR 中的 JBoss EAP XP 运行时的功能。当您迁移使用 Jakarta EE 8 规范的 Thorntail 应用程序时,您必须将相关的 Galleon 层添加到可引导 JAR Maven 插件配置中。

使用 Galleon 层时,JBoss EAP XP 会生成一个服务器配置,并将其打包在可引导 JAR 中。如果没有使用 Galleon 层,则会在可引导 JAR 中打包与默认 standalone-microprofile.xml 相同的配置。

如果您要使用 <cloud> 配置元素为云 构建可引导 JAR,则与默认的 standalone-microprofile-ha.xml 类似的 OpenShift 配置将应用到您的可引导 JAR。

bootable JAR Maven 插件执行 JBoss CLI 脚本,同时打包可引导 JAR。

流程

  1. 删除任何 Thorntail BOM 导入。

    pom.xml 文件中删除 io.thorntail Thorntail BOM 导入的示例。

    <dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>io.thorntail</groupId>
          <artifactId>bom</artifactId>
          <version>${version.thorntail}</version>
          <type>pom</type>
          <scope>import</scope>
        </dependency>
      </dependencies>
    </dependencyManagement>
    Copy to Clipboard Toggle word wrap

  2. 使用 JBoss EAP XP BOMs 将支持的工件导入到 JBoss EAP XP 依赖项管理。

    使用 jboss-eap-jakartaee8-with-tools BOM 将支持的工件导入到项目的示例。

    <dependencyManagement>
            <dependencies>
                <!-- importing the jakartaee8-with-tools BOM adds specs and other useful artifacts as managed dependencies -->
                <dependency>
                    <groupId>org.jboss.bom</groupId>
                    <artifactId>jboss-eap-jakartaee8-with-tools</artifactId>
                    <version>${version.server.bom}</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
                <!-- importing the microprofile BOM adds MicroProfile specs -->
                <dependency>
                    <groupId>org.jboss.bom</groupId>
                    <artifactId>jboss-eap-xp-microprofile</artifactId>
                    <version>${version.microprofile.bom}</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
            </dependencies>
        </dependencyManagement>
    Copy to Clipboard Toggle word wrap

    注意

    只有在应用程序依赖于 MicroProfile 平台中没有包含的 Jakarta EE 8 规格时,才导入 jakartaee8-with-tools BOM。

  3. 将 Thorntail Maven 插件替换为 JBoss EAP XP bootable JAR Maven 插件。

    使用 JBoss EAP XP bootable JAR Maven 插件替换 Thorntail Maven 插件的示例。

    <plugin>
       <groupId>org.wildfly.plugins</groupId>
       <artifactId>wildfly-jar-maven-plugin</artifactId>
       <version>${bootable.jar.maven.plugin.version}</version>
       <configuration>
          <feature-pack-location>${org.jboss.eap:wildfly-galleon-pack:${jboss.xp.galleon.feature.pack.version}</feature-pack-location>
          <layers>
             <layer>microprofile-platform</layer>
          </layers>
       </configuration>
       <executions>
          <execution>
             <goals>
                <goal>package</goal>
             </goals>
          </execution>
       </executions>
    </plugin>
    Copy to Clipboard Toggle word wrap

    注意

    前面的示例为 Maven 插件版本指定以下属性:

    ${bootable.jar.maven.plugin.version}
    Copy to Clipboard Toggle word wrap

    您必须设置 Maven 插件版本,以代替项目中的此属性。例如:

    <properties>
        <bootable.jar.maven.plugin.version>6.1.2.Final-redhat-00001</bootable.jar.maven.plugin.version>
    </properties>
    Copy to Clipboard Toggle word wrap
    • 默认情况下,可引导 JAR 插件会构建 UberJAR,这意味着它将 JBoss EAP XP 运行时与部署的应用程序打包。要构建 hollow JAR,请在插件配置中添加 <hollow-jar>true</hollow-jar >。
  4. 在 Maven 项目中对 Thorntail 部分进行以下更改。

    1. 删除 Thorntail 部分依赖项。

      显示从 Maven 项目中删除 io.thorntail Thorntail 部分的示例。

      <dependencies>
        <dependency>
          <groupId>io.thorntail</groupId>
          <artifactId>jaxrs</artifactId>
        </dependency>
      </dependencies>
      Copy to Clipboard Toggle word wrap

    2. 配置 Maven 依赖项。

      使用 XML 片断向 Jakarta EE 8 JAX-RS 和 MicroProfile Config API 的工件中添加依赖项的示例。

      <dependencies>
          <!-- Import the MicroProfile Config API, we use provided scope as the API is included in the server -->
          <dependency>
            <groupId>org.eclipse.microprofile.config</groupId>
            <artifactId>microprofile-config-api</artifactId>
            <scope>provided</scope>
          </dependency>
          <!-- Import the Jakarta REST API, we use provided scope as the API is included in the server -->
          <dependency>
            <groupId>org.jboss.spec.javax.ws.rs</groupId>
            <artifactId>jboss-jaxrs-api_2.1_spec</artifactId>
            <scope>provided</scope>
          </dependency>
        </dependencies>
      Copy to Clipboard Toggle word wrap

    3. 删除 Thorntail YAML 文件、系统属性和环境属性。
    4. 配置 Galleon 层。

      为需要 JAX-RS 的应用在可引导 JAR Maven 插件中配置 Galleon 层的示例。

      <plugin>
        <groupId>org.wildfly.plugins</groupId>               <artifactId>wildfly-jar-maven-plugin</artifactId>                  <configuration>
         ...
            <layers>
              <layer>jaxrs-server</layer>
              <layer>microprofile-platform</layer>
            </layers>
        </configuration>
         ...
      </plugin>
      Copy to Clipboard Toggle word wrap

法律通告

Copyright © 2024 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部