Packaging applications in J2EE archive files



When running ColdFusion in the multiserver and J2EE configurations, you deploy the ColdFusion application, in enterprise application archive (EAR) or web application archive (WAR) format, on a J2EE application server. You then create your ColdFusion application, configuring resources (such as data sources), and storing CFM, CFC, and CFR files in the web application root or in the web server root. In earlier ColdFusion versions, your J2EE administrator had to redo each of these steps when deploying your ColdFusion application onto a production J2EE server.

The ColdFusion Administrator lets you create an EAR or WAR file that contains the entire application. This archive file contains the ColdFusion web application, settings for ColdFusion (such as data source definitions), and the CFM, CFC, and CFR files that your application uses.

If you are using the multiserver configuration, you can combine J2EE archiving with the instance creation functionality of the ColdFusion Administrator Enterprise Manager. First, create an EAR file that contains your application and all of its settings. Use that EAR file in the Create From EAR/WAR option of the Instance Manager. For more information on the Enterprise Manager, see Defining additional server instances.

Application packaging

The J2EE Archive feature lets you quickly create an archive file that a J2EE administrator can use to deploy your ColdFusion application.

Add a new archive definition and create an archive file

  1. Open the ColdFusion Administrator.

  2. Specify a unique name for the archive file (no extension) in the Archive Name field.

  3. Click Add. The Add New Archive screen appears.

  4. Specify archive settings on the Add New Archive screen.

  5. Click Create. ColdFusion creates an EAR or WAR file in the specified application distribution directory.

The following table describes the settings you make when creating or modifying an archive:

Setting

Description

Archive Type

Select EAR or WAR.

Context Root (EAR only)

Each J2EE web application running in a server is rooted at a unique base URL, called a context root (or context path). The J2EE application server uses the initial portion of the URL (that is, the portion immediately following http://hostname) to determine which web application services an incoming request.

For example, if you are running ColdFusion with a context root of cfmx, you display the Administrator using the URL http://hostname/cfmx/CFIDE/administrator/index.cfm. Most J2EE application servers allow one application in each server instance to use a forward slash (/) for the context root. The Remote Development Services (RDS) web application is not required if you use a context root of /.

Serial Number

Specifies a ColdFusion Enterprise Edition serial number. If you do not specify a valid ColdFusion Enterprise Edition serial number when creating the archive file, it is deployed as an Enterprise Edition evaluation version, which reverts to the Developer Edition after 30 days.

COM Support

If your application doesn’t use COM support, you can reduce the size of the archive file by omitting the supporting files.

Debugging

If the current ColdFusion server is running with debugging enabled, you can disable debugging in the application contained in the archive file.

Include CFML Source

You can optionally deploy Java bytecode instead of CFML source code. For more information, see Sourceless distribution.

ColdFusion Administrator

If your application does not require modification by using the ColdFusion Administrator, you can reduce archive size and reduce security issues by omitting the Administrator files.

Data sources

Specifies the data source definitions to include in the archive file.

Deployment considerations

After the archive file is created, you deploy by using standard ColdFusion J2EE configuration deployment techniques. For more information, see Installing an EAR file or WAR files in Installing the J2EE Configuration of Installing ColdFusion.

Post-deployment considerations

Depending on your application, the resources that it uses, and the environment in which it is deployed, you may need to perform post-deployment configuration, as follows:

Mappings
The ColdFusion mappings in the archived application refer to directories on the original computer. If those directories do not exist on the deployment computer, modify the ColdFusion mappings by using the ColdFusion Administrator or the Administrator API.

Verity
Ensure that the Verity server settings on the original computer are appropriate for the deployment computer. If they are not, use the ColdFusion Administrator or the appropriate tags to modify the Verity server settings.

Serial number
J2EE deployment is a ColdFusion Enterprise feature. To upgrade to the Enterprise Edition, use the ColdFusion Administrator or the Administrator API to enter a serial number.

For more information on the Administrator API, see Administrator API.