Overview

There are situations when you may need to apply a custom patch in ColdFusion to fix an issue or to check a new feature that is provided via a jar.

In this document, we shall demonstrate how you'd apply a custom patch to a package in ColdFusion (2021 release).

Pre-requisites

We shall provide a JSON along with one or more jars, whenever you receive a custom patch.

JSON

For example, if you were to apply a patch for the package ftp, the JSON looks like:

{ 
    "bundle": "ftp", 
    "minimumcoreserverupdaterequired": 0, 
    "version": "2021.0.0.324000", 
    "description": "The ftp package", 
    "dependencies": [ 
        { "name" : "jsch" , "version" : "0.1.55", "embedded" : false}, 
        { "name" : "commons-net" , "version" : "3.6", "embedded" : false} 
    ], 
    "awsserverless": true 
} 

Let's deconstruct the JSON:

  1. The name of the package, ftp.
  2. The key, minimumcoreserverupdaterequired. This key contains the update number of the ColdFusion server update that is required to be installed for this patch to work properly.
  3. The key, dependencies, which lists out the various dependencies of the package. These dependencies are the jars that the package requires. A patch may provide a new version of jar, or new dependency itself might be added.
  4. The key, version. This value is used internally to map the patch to the respective jar files.

Apply the patch

  1. Copy the JSON content to the file bundlesdependency_custom.json, which is located in the directory  [CF Home]\bundles.

    If there is another JSON patch already present, append the bundle, as shown below:

    bundlesdependency_custom.json
    bundlesdependency_custom.json

    Notă:

    You'd have been provided one or more jars, based on the changes. In this example, if a new version of jsch jar was also provided, then the jars are:

    1. ftp-2021.0.0.324000.jar
    2. jsch-0.1.55.jar

    The commons-net jar remained unchanged, so it was not provided.

  2. Copy the following jars:

    1. ftp-2021.0.0.324000.jar to [CF Home]\bundles.
    2. jsch-0.1.55.jar to [CF Home]\bundles\repo.
  3. Launch the cfpm tool:

    1. Navigate to the directory [CF Home]\[CF Instance]\bin.
    2. Launch the file cfpm.bat/cfpm.sh via command line or terminal.
  4. Run the command listall.  Both the old and new build numbers of the ftp package will get listed (the old build should be in green if it is installed).

    cfpm>listall

    adminapi, versions : [2021.0.0.323925]

    administrator, versions : [2021.0.0.323925]

    ftp, versions : [2021.0.0.324000, 2021.0.0.323925]

  5. Install the ftp package.

    cfpm>install ftp

  6. Rerun the command listall

    cfpm>listall

    The new build number of the ftp package would be in green color.

You've successfully applied a new patch to your ColdFusion server without restarting the server.

The procedure above enables you to easily apply a patch to a package in ColdFusion (2021 release).

Notă:

The traditional way of applying patches to the ColdFusion server still holds true.

But that will not work for patches specific to the packages. 

Contact us

For any issues, reach out to us: