A.2. Patching Tasks
Installing a patch
Patches for JBoss Fuse on JBoss EAP are distributed as archive files (
.zip
) . To install a given patch file, Module-Version.zip
, perform the following steps:
- Make sure that you read the instructions accompanying the patch file, in case there are extra steps that must be performed to install the patch.
- Add the patch file,
Module-Version.zip
, to your patch repository, as follows:$ fusepatch.sh --add file:///path/to/Module-Version.zip
- Use the
--query-repository
option to check that the patch has been added to the repository:$ fusepatch.sh --query-repository Module-Version
- Install the patch to the JBoss EAP server, as follows:
$ fusepatch.sh --install Module-Version Installed Module-Version
- Perform any post-install steps documented in the patch instructions.NoteFor some patches, it might be necessary to restart the JBoss EAP container for the changes to take effect.
Installing a one-off patch
A one-off patch is a patch that must be installed on top of an existing patch (base patch) and does not contain the full set of paths that an ordinary patch contains. To install a one-off patch,
Module-Version.OneOffID.zip
, on top of the base patch, Module-Version
, perform the following steps:
- Make sure that you read the instructions accompanying the one-off patch file, in case there are extra steps that must be performed to install it.
- Make sure that the base patch has already been added to your patch repository and installed on the JBoss EAP server. For example, if the base patch is
Module-Version
, check that it is installed in the repository:$ fusepatch.sh --query-repository Module-Version
And check that it is installed on the JBoss EAP server:$ fusepatch.sh --query-server Module-Version
If the base patch is not already installed, install it now, as described in the section called “Installing a patch”. - Given the one-off patch file,
Module-Version.OneOffID.zip
, add the patch file to your repository and associate it with the base patch, by entering the following command:$ fusepatch.sh --add file:///path/to/Module-Version.OneOffID.zip --one-off Module-Version Added Module-Version.OneOffID patching Module-Version
- Update the patch module,
Module
, on the JBoss EAP server to the latest version:$ fusepatch.sh --update Module Upgraded from Module-Version to Module-Version.OneOffID
- Perform any post-install steps documented in the patch instructions.NoteFor some patches, it might be necessary to restart the JBoss EAP container for the changes to take effect.
Uninstalling a patch
To uninstall a specific patch,
Module-Version
, from the JBoss EAP server, enter the following command:
$ fusepatch.sh --uninstall Module-Version Uninstalled Module-Version
Upgrading to a later patch version
You can use the
--update
option of the fusepatch
utility to upgrade the JBoss EAP server to the latest patch version available in the patch repository.
For example, given that the server currently has version
1.0.0
of the Module
module installed, while the patch repository includes version 1.1.0
, you could upgrade the server to version 1.1.0
by entering the following command:
$ fusepatch.sh --update Module Upgraded from Module-1.0.0 to Module-1.1.0
Downgrading to an earlier patch version
You can downgrade a patch to an earlier version using the
--install
option of the fusepatch
utility.
For example, given that the server currently has version
1.1.0
of the Module
module installed (and assuming that the patch repository includes version 1.0.0
), you could downgrade the server to version 1.0.0
by entering the following command:
$ fusepatch.sh --install Module-1.0.0 Downgraded from Module-1.1.0 to Module-1.0.0
Dealing with conflicts
When a patch is applied to a JBoss EAP server (either through the install or update actions), it can happen that the changes about to be made are in conflict with customization previously made by the user. The following cases can arise:
- Adding a file that already exists
- If the patch attempts to add a file that already exists (and the patch expected there would be no pre-existing file at that location), the patch install (or update) action fails:
$ mkdir config; touch config/propsA.properties $ fusepatch.sh --update Module Error: Attempt to add an already existing file config/propsA.properties
If this happens, you have the option of re-issuing thefusepatch
command with the--force
option, which over-writes the conflicting file—for example:$ fusepatch.sh --update Module --force Warning: Overriding an already existing file config/propsA.properties Installed Module-1.0.0
- Upgrading a file that has been customized
- In the case of existing files with the
.xml
or.properties
extensions, the patch mechanism checks whether the files have been customized by the user before applying any modifications. If there are any customized files that would be affected by the patch, the install (or update) action fails by default:$ fusepatch.sh --update Module Error: Attempt to override an already modified file config/propsA.properties
If this happens, you have the option of re-issuing thefusepatch
command with the--force
option, which over-writes the conflicting file—for example:$ fusepatch.sh --update Module --force Warning: Overriding an already modified file config/propsA.properties Upgraded from Module-1.0.0 to Module-1.1.0
- Removing a file that has already been removed
- If the patch attempts to remove a file that has already been removed, a warning is displayed, but the patch install (or update) action succeeds by default:
$ rm config/remove-me.properties $ fusepatch.sh --update Module Warning: Attempt to delete a non existing file config/remove-me.properties Upgraded from Module-1.0.0 to Module-1.1.0
Checking the audit log
The JBoss EAP server maintains an audit log of all the changes made by the
fusepatch
utility. You can access the audit log by invoking the fusepatch
command with the --audit-log
option. For example, if you install module foo
version 1.0.0
, and subsequently update module foo
to version 1.1.0
, as follows:
$ fusepatch.sh --install foo-1.0.0 Installed foo-1.0.0 $ fusepatch.sh --update foo Upgraded from foo-1.0.0 to foo-1.1.0
To display the server's audit log enter the following command:
$ fusepatch.sh --audit-log # 19-Jun-2015 12:22:04 # Installed foo-1.0.0 [content] ADD config/propsA.properties 1684822571 ADD config/remove-me.properties 1684822571 ADD lib/foo-1.0.0.jar 2509787836 # 19-Jun-2015 12:22:13 # Upgrading from foo-1.0.0 to foo-1.1.0 [content] UPD config/propsA.properties 1329662440 DEL config/remove-me.properties 1684822571 DEL lib/foo-1.0.0.jar 2509787836 ADD lib/foo-1.1.0.jar 2509787836
The audit log shows the files that were added,
ADD
, deleted, DEL
, or updated, UPD
, for each of the install and update actions.