Red Hat Training

A Red Hat training course is available for Red Hat Fuse

Chapter 8. Deploying Projects to a Container

Revision History
8/11/11EMJ
made a chapter with sections to include container config
7/13/12EMJ
rewrote for clarity and accuracy
7/13/12EMJ
merged configuration of hot deploy folder and hot deploy procedure into a single section
The developer tools' Deploy to... tool( ) makes deploying applications into containers a one step process.
The developer tools support direct deployment into the following containers:
  • Red Hat JBoss Fuse
  • Apache ServiceMix
  • Apache Karaf
There are three ways to deploy Fuse projects into a container:
  • into a container's deploy folder
    You copy the package generated by the developer tools into the container's deploy folder. This method has two drawbacks:
    • The developer tools do not verify that the project builds a package that is compatible with the target container.
    • The developer tools do not provide feedback as to whether the deployment succeeds or fails.
  • to a JMX connected container
    The developer tools build the project, and, regardless of the packaging specified in the project's POM, installs the generated artifacts as a bundle. You can use the Fuse JMX Navigator to determine if the project deploys successfully.
  • to a fabric profile
    The developer tools build the project, packages the generated artifacts into a bundle, adds the bundle to the profile, and copies the bundle into the fabric's internal repository.
    Important
    If the profile is not assigned to a running container the project will not be deployed into the fabric. You must assign the profile to a running container before you can see the project running.
Note
You can deploy a project by dropping it onto a connected container in Fuse JMX Navigator, or onto a fabric profile in Fabric Navigator.

8.1. Using a Container's Deploy Folder

When the developer tools deploy a project into a container's deploy folder, they build the project as specified in the project's POM and copies the resulting package to a predetermined location. The developer tools assume two things:
  • the specified location is a container's deploy folder
  • the package generated by the project is compatible with the container
Before you can deploy a project to a container's deploy folder you must add the container's deployment information to the developer tools. Once the developer tools know the container's information, the container will appear as an option in the Deploy To... menu.

8.1.1. Configuring a Container's Deploy Folder

Revision History
7/22/11EMJ
Added info about opening the container preferences
7/13/12EMJ
changed deployment folder to deploy folder so it is consistent with the UI
7/13/12EMJ
edited for clarity

Overview

Before you can deploy applications into a container's deploy folder, you must provide the developer tools with the location of the container's deploy folder. The Deploy Folders preference panel enables you to configure one or more containers. You provide a name for the container and the full path to the container's deployment folder.

Accessing the Deploy Folder preference panel

You can access the deployment folders preference panel two ways:
  • selecting JBoss Developer StudioPreferencesFuse Plugins for Eclipse from the main menu
    This method opens the general Eclipse preference window. You need to select Deploy Folders from the list of preferences in the panel on the left side of the widow.
  • selecting Deploy to...Deploy Folder Configurations... from the project's context menu
    This method opens the preferences window and ensures that the Deploy Folders panel is selected.

Add a container's deploy folder

To add a container's deploy folder:
  1. Open the Deploy Folder preference panel.
  2. In the Name field, enter a name for the target container.
    The name can be any unique string.
  3. In the Deploy Folder field, enter the full path to the container's deployment folder.
    The button opens a file explorer.
    Important
    The developer tools do not validate whether the selected folder is a valid deployment folder for a container.
  4. In the Description field, enter a description for the container.
  5. Click Add to add the new container to the table of configured containers.
  6. Click OK to close the preferences window.
When add a container to the list, it appears in the context menus' Deploy to... submenu.

Edit a container's deploy folder

To edit a container's deploy folder:
  1. Open the Deploy Folder preference panel.
  2. Select the container whose configuration you want to edit.
  3. Edit the information that needs updating.
    Important
    Changing the value of the Name field creates a new container configuration.
  4. Click .
  5. Click OK to close the preferences window.

Delete a container's deploy folder

To delete a container's deploy folder:
  1. Open the Deploy Folder preference panel.
  2. Select the container to be deleted.
  3. Click .
  4. Click OK to close the preferences window.

Related topics

Chapter 8, Deploying Projects to a Container
Deploy Folders

8.1.2. Deploying a Project to a Container's Deploy Folder

Revision History
8/11/11EMJ
Split into a section

Overview

When the developer tools deploy a project to a container's deploy folder it builds the project and copies the results to the deploy folder configured for the container.

Procedure

To deploy a project to a container's deploy folder:
  1. Select the routing context file that you want to deploy.
    Important
    The project must be configured to package the results in a format that the target container can deploy.
  2. Select Deploy to...containerName from the project's context menu.
    Red Hat JBoss Fuse Plugins for Eclipse builds the project and copies the results to the selected container's deploy folder.
    Note
    If you have not already configured a container, you can do so by selecting Deploy to...Deploy Folder Configurations... from the context menu.
  3. Check the Console view to see if your project was successfully built and copied to the target container.
  4. Check the container's log files to see if the project was successfully deployed.

Related topics

Section 8.1.1, “Configuring a Container's Deploy Folder”