Installation on Apache Karaf

Red Hat JBoss Fuse

Installing Red Hat JBoss Fuse on the Apache Karaf container

Red Hat

Version 6.2.1
21 Sep 2017

Abstract

It is easy to install Red Hat JBoss Fuse and tailor the installation to a particular environment.

Chapter 1. Installation Prerequisites

Abstract

Before attempting to install and use Red Hat JBoss Fuse, make sure your system meets the minimum requirements.

Supported platforms

Red Hat tests and supports Fuse products in the configurations listed at Red Hat JBoss Fuse Supported Configurations.

Java Runtime

For details of the Java runtimes supported by Red Hat JBoss Fuse, see Red Hat JBoss Fuse Supported Configurations.
Warning
Do not install the Java runtime under a directory path that includes whitespace. For example, C:\Program Files\Java\jde7 is not an acceptable install path and will lead to unpredictable errors in Red Hat JBoss Fuse at run time.

Supported Standards

Red Hat JBoss Fuse supports the standards and protocols listed at Red Hat JBoss Fuse Supported Standards.

Hardware requirements

The minimum hardware requirements for installing Red Hat JBoss Fuse are:
  • Full Installation
    • 700 MB of free disk space
    • 2 GB of RAM
In addition to the disk space required for the base installation, a running system will require space for caching, persistent message stores, and other functions.

Chapter 2. Installation Types

2.1. Overview of Installation Packages

Red Hat JBoss Fuse 6.2.1 is delivered in packages.
The Full install package is available for download from the Red Hat Customer Portal. It installs Apache Karaf, Apache Camel, Apache ActiveMQ, Apache CXF, SwitchYard, and the Fuse Management Console (Hawtio).
It is possible to create your own custom assembly of JBoss Fuse 6.2.1, containing a customized subset of the JBoss Fuse features and bundles. You can use this approach to replace the Minimal and the Medium install types, which were available for versions of JBoss Fuse prior to 6.2.
To create a custom assembly of JBoss Fuse, see Appendix C, Generating a Custom Assembly or an Offline Repository.

Chapter 3. Installing

Abstract

Red Hat JBoss Fuse is installed by unpacking an archive system on a system. This provides an easy way for a developer to get up and running.

Getting the archive

You can download the Red Hat JBoss Fuse archive from the Red Hat Customer Portal>Downloads>Red Hat JBoss Middleware>Downloads page, after you register and login to your customer account.
Once logged in:
  1. Select Fuse, listed under Integrated Platforms, in the sidebar menu.
  2. Select 6.2.1 from the Version drop-down list on the Software Downloads page.
  3. Click the Download button next to the Red Hat JBoss Fuse 6.2.1 on Karaf Installer file.

Unpacking the archive

Red Hat JBoss Fuse is packaged as a .zip file. Using a suitable archive tool, such as Zip, unpack Red Hat JBoss Fuse into a directory to which you have full access.
Warning
Do not unpack the archive file into a folder that has spaces in its path name. For example, do not unpack into C:\Documents and Settings\Greco Roman\Desktop\fusesrc.
Warning
Do not unpack the archive file into a folder that has any of the following special characters in its path name: #, %, ^, ".

Using the IBM JDK

If you are using the IBM JDK, remove the saaj-api jar from the installDir/lib/endorsed library using the following command:
  1. rm lib/endorsed/org.apache.servicemix.specs.saaj-api-1.3-2.5.0.jar
  2. Before invoking the ./bin/fuse script:, set the JAVA_OPTS environment variable as follows:
    JAVA_OPTS=-Xshareclasses:none

Chapter 4. Adding a Remote Console User

Abstract

The server's remote command console is not configured with a default user. Before you can connect to the server's console remotely, you must add a user to the configuration.

4.1. Add a User

Red Hat JBoss Fuse is not installed with a default user for the remote console. Before you can remotely manage a server, you must add a user by editing InstallDir/etc/users.properties.
Important
The information in this file is unencrypted so it is not suitable for environments that require strict security.
To add a user:
  1. Open InstallDir/etc/users.properties in your favorite text editor.
  2. Locate the line #admin=admin,admin,manager,viewer,Operator, Maintainer, Deployer, Auditor, Administrator, SuperUser.
    This line specifies a user admin with the password admin and comma-separated list of roles.
  3. Uncomment the line by removing the leading #.
  4. Change the first admin to the desired user name.
  5. Change the second admin to the desired password.
  6. Leave the role list, admin,manager,viewer,Operator, Maintainer, Deployer, Auditor, Administrator, SuperUser, as is.
  7. Save the changes.

Chapter 5. Offline Mode

Abstract

You can run the JBoss Fuse container in offline mode (that is, without an Internet connection). But if you are planning to deploy custom applications to the container, it might be necessary to download additional dependencies (to a local Maven repository) before you can run the container in offline mode with these applications.

5.1. Supported Functionality

If you want to run the JBoss Fuse container in offline mode, it is necessary to distinguish between the following kinds of dependency:
  • Runtime dependencies—the dependencies required to run the JBoss Fuse container, in its default configuration.
  • Build-time dependencies—the dependencies required to build a custom application (which might include third-party libraries).
Here is a summary of what can be done in offline mode and what needs to be done in online mode (with an Internet connection):
  • Running the JBoss Fuse container in its default configuration—is supported in offline mode. The default configuration of the JBoss Fuse container is specified by the featuresBoot property in the etc/org.apache.karaf.features.cfg file. The requisite dependencies are all provided in the system/ sub-directory of the installation.
  • Installing additional features—is, in general, not supported in offline mode. In principle, you can use the features:install command to install any of the features from the standard feature repositories (as specified by the featuresRepositories property in the etc/org.apache.karaf.features.cfg file), but the majority of these features must be downloaded from the Internet and are thus not supported in offline mode.
  • Deploying custom applications—is, in general, not supported in offline mode. There may be some cases where an application with a minimal set of build-time dependencies is deployable offline, but in general, custom applications would have third-party dependencies that require an Internet connection (so that JAR files can be downloaded by Apache Maven).
If you do need to deploy an application with dependencies that are not available offline, you can use the Maven dependency plug-in to download the application's dependencies into a Maven offline repository. This customized Maven offline repository can then be distributed internally to any machines that do not have an Internet connection. For more details of this approach, see section "Offline Repository for a Maven Project" in "Fabric Guide".

Chapter 6. Monitor Fuse Resources

Abstract

Using Red Hat JBoss Operations Network (JON), you can discover, import, and monitor Red Hat JBoss Fuse.

6.1. Installation Procedure

The Fuse Plugin Pack for JBoss ON 3.3 is not installed with the JON base distribution. You must download and install it separately after you have installed JON.
To install the Fuse Plugin Pack for JBoss ON 3.3:
  1. Navigate to the Red Hat Software Downloads page on the Red Hat Customer Portal.
  2. Select JBoss ON for Fuse under Management in the sidebar menu (or using the drop-down menu for the Products field).
  3. Make sure 3.3 appears in the Version drop-down list on the Software Downloads page.
  4. Click Download next to Fuse Plugin Pack for Red Hat JBoss Operations Network 3.3 .
  5. Unzip the plugin package (jon-plugin-pack-fuse-3.3.0.GA.zip) into a temporary directory (for example, /installDir/server/).
  6. Install the jar files in one of two ways:

Chapter 7. Getting Started with SwitchYard on Apache Karaf

7.1. SwitchYard

SwitchYard is a lightweight service delivery framework providing full lifecycle support for developing, deploying, and managing service-oriented applications.
It works with Apache Camel to provide a fast, simple, flexible integration runtime with comprehensive connectivity and transports.
A uniform application model augments Apache Camel, joining Java EE, BPM, rules, orchestration, and routing into a cohesive development model and runtime.
Common functionality and cross-cutting concerns (for example, validation, transformation and policy) are isolated from business logic and handled declaratively. This ensures consistency and eliminates duplication, offering developers a clear view of the structure and relationships of services in an integration application.

Figure 7.1. SwitchYard Visual Editor

SwitchYard Visual Editor.
Note
SwitchYard tooling is provided with installation of the Red Hat JBoss Developer Studio Integration Stack. For instructions on how to install the SwitchYard tooling, see Chapter 8, Install Red Hat JBoss Development Tools.

7.2. Installing SwitchYard on Apache Karaf

SwitchYard does not necessarily need to be installed on Apache Karaf explicitly. When a SwitchYard application is installed, as long as its accompanying features file is defined correctly, its dependencies will be installed automatically if they are not already installed. This includes the core SwitchYard components.
You can confirm this by installing a quickstart application on a fresh installation of the JBoss Fuse Apache Karaf container.
However, you can also install SwitchYard and its related components manually.
Note
Each SwitchYard component and application is provided as a feature. Packaged features (including quickstart applications) are defined in the SwitchYard features file located at installDir/system/org/switchyard/karaf/switchyard/2.0.1.redhat-620117/switchyard-2.0.1.redhat-620117-core-features.xml.

Procedure 7.1. Install SwitchYard Manually

  1. Start the Apache Karaf container:
    ./installDir/bin/fuse
  2. List the available SwitchYard features by entering the following console command. If this is a fresh instance, they will all be uninstalled at this point.
    JBossFuse:karaf@root> features:list | grep switchyard
  3. Install the core SwitchYard components by entering the following console command:
    JBossFuse:karaf@root> features:install switchyard
  4. List the SwitchYard features again. You will now see that SwitchYard (the switchyard feature) has been installed, along with its dependencies as defined by the SwitchYard features file.

7.3. SwitchYard Quickstart Applications

You can find a variety of SwitchYard applications in installDir/quickstarts/switchyard.
Quickstart applications are typically installed from the Karaf command line console as follows:
  1. Start the Apache Karaf container:
    ./installDir/bin/fuse
  2. Install the application by entering the following console command:
    JBossFuse:karaf@root> features:install switchyard-quickstart-APP_NAME
You can find out more about running each quickstart application by reading the accompanying Readme.md file for each.
Note
There is no need to add the features URL as described by the Readme.md file. SwitchYard features are already defined in installDir/system/org/switchyard/karaf/switchyard/2.0.1.redhat-620117/switchyard-2.0.1.redhat-620117-core-features.xml.

7.4. Installing Your First Quickstart Application

The following procedure demonstrates how to install and run the camel-quartz-binding quickstart application. This application makes use of the camel-quartz component which schedules a logging service to run every second.
  1. Start the Apache Karaf container:
    ./installDir/bin/fuse
  2. List the available SwitchYard features by entering the following console command. If this is a fresh instance, they will all be uninstalled at this point.
    JBossFuse:karaf@root> features:list | grep switchyard
    Install the camel-quartz-binding application by entering the following console command:
    JBossFuse:karaf@root> features:install switchyard-quickstart-camel-quartz-binding
  3. List the SwitchYard features again. You will now see that the camel-quartz-binding application (the switchyard-quickstart-camel-quartz-binding feature) has been installed, along with its dependencies as defined by the SwitchYard features file.
  4. View the output from the installed (and running) application by entering the following console command:
    JBossFuse:karaf@root> log:tail
Note
Find out more about this quickstart application in installDir/quickstarts/switchyard/camel-quartz-binding/Readme.md.

7.5. What's Next?

Find out more about SwitchYard.

Chapter 8. Install Red Hat JBoss Development Tools

8.1. Install Red Hat JBoss Developer Studio

Red Hat JBoss Developer Studio (JBDS) is a tool that can be used with JBoss Fuse to develop applications in a structured way. JBDS is a separate product from JBoss Fuse and therefore needs a separate licence.
JBDS 8.1 must be used with JBoss Fuse 6.2.1. Full installation instructions for JBDS 8.1 are available at Install Red Hat JBoss Developer Studio

8.2. Install Red Hat JBoss Developer Studio Integration Stack

Red Hat JBoss Developer Studio Integration Stack (JBDS IS) is a set of Eclipse-based development tools. It further enhances the IDE functionality provided by JBoss Developer Studio, with plug-ins specifically for use when developing for other Red Hat JBoss products.
JBDS IS 8.0.4 must be used with JBoss Fuse 6.2.1 and JBDS 8.1. Full installation instructions for JBDS IS 8.0.4 are available at Install Red Hat JBoss Developer Studio Integration Stack

Appendix A. Installing the Apache Components

Abstract

Red Hat JBoss Fuse includes standard distributions of Apache Camel and Apache CXF in the installation's extras directory.

A.1. Zip Archives for the Apache Components

If you want to use a standard distribution of Apache Camel or Apache CXF, without the OSGi container or Fuse Fabric, use the archived versions in the installation's extras directory.
The following archives are provided for all supported platforms:
  • apache-camel-2.15.1.redhat-621084.zip
  • apache-cxf-3.0.4.redhat-621084.zip
You can copy these files to the desired location and decompress them using the appropriate utility for your platform.
Warning
Do not unpack an archive file into a folder that has spaces in its path name. For example, do not unpack into C:\Documents and Settings\Greco Roman\Desktop\fusesrc.

Appendix B. Red Hat JBoss Fuse Maven Repositories

Abstract

Red Hat JBoss Fuse strongly supports Maven, an open source build system available from Apache Maven. To use Maven to build your projects, you need to specify, in a Maven settings.xml file, where required artifacts are located.
For details on setting up Maven to work with Red Hat JBoss Fuse, see chapter "Building with Maven" in "Deploying into Apache Karaf". Building with Maven in Red Hat JBoss Fuse Deploying into the Container on the Red Hat Customer Portal.

B.1. Maven Repositories

The following repositories contain artifacts your projects may need:
  • JBoss Fuse repository
    Provides access to the artifacts in the Red Hat JBoss Fuse Maven repository. This repository is required.
    https://repo.fusesource.com/nexus/content/groups/public/
  • JBoss Fuse Snapshots repository
    Provides access to the artifacts in the Red Hat JBoss Fuse snapshot kit. This repository is not required, but it is useful if you want to experiment with building your project using different versions of the supplied archetypes.
    https://repo.fusesource.com/nexus/content/groups/public-snapshots/
  • Apache Public repository
    Provides access to the artifacts in the Apache Maven repository. This repository is not required, but it is useful to include as Red Hat JBoss Fuse depends on various Apache artifacts.
    https://repository.apache.org/content/groups/public/

Appendix C. Generating a Custom Assembly or an Offline Repository

Overview

The Karaf container in JBoss Fuse comes with a large collection of features installed by default. While this offers the advantage of a highly functional container, it suffers from the drawback of requiring a large amount of memory and resources. For some deployment scenarios, it can be an advantage to strip down the Karaf container to use the minimal set of features required for your application. A custom assembly is the most effective way to create a stripped down Karaf container that deploys only the features needed for your application.
The same procedure that is used to generate a custom assembly also, incidentally, generates an offline repository.

Custom assembly

A custom assembly is a custom distribution of the Karaf container based on JBoss Fuse, which is generated using a specific toolchain of Maven plug-ins. The quickstart examples include a template, quickstart/custom, which demonstrates how this toolchain works and provides you with the starting point for creating your own custom assemblies.
Note
A custom assembly is generated using essentially the same toolchain as the official JBoss Fuse Karaf container distribution.

Patched custom assembly

If your starting point is a JBoss Fuse rollup patch (which is, in fact, equivalent to a complete distribution of the JBoss Fuse product with patches already applied), and you then follow the steps for generating a custom assembly, what you end up with is a patched custom assembly. No actual patching step needs to be performed in this case, however, because the patch is already built-in to the custom assembly.

Offline repository

An offline repository is a Maven repository that contains a custom collection of Maven artifacts that would otherwise need to be downloaded from the Internet. For JBoss Fuse deployments that lack Internet access, the offline repository makes it possible to run the container in an isolated network by providing all of the Maven artifacts that your application might need. For details about how to install an offline repository in a standalone Karaf container, see chapter "Locating Artifacts with Maven and HTTP" in "Deploying into Apache Karaf".

quickstart/custom example

The quickstart/custom example provides a template for generating your own custom assembly. The default configuration of the custom example includes a very minimal collection of Karaf features. You can easily customize this configuration to specify example which Karaf features you would like to include in the custom assembly.

Procedure to generate a custom assembly or an offline repository

To generate a custom assembly, or a patched custom assembly, or an offline Maven repository, perform the following steps:
  1. Choose the appropriate starting point for this procedure:
    • To generate a custom assembly—download and install the standard Full Install from the Red Hat Customer Portal, as described in Chapter 3, Installing; or
    • To generate a patched custom assembly—download the latest rollup patch from the Red Hat Customer Portal.
  2. Go to the InstallDir/quickstarts/custom project.
  3. Customize the features that will be included in the custom assembly's system/ directory (or in the generated offline repository) by editing the project's pom.xml file. The patch feature and the fabric feature are both required, and must be added to the configuration.
    Open the quickstarts/custom/pom.xml file in a text editor, search for the features-maven-plugin plug-in configuration, and add the patch feature and the fabric feature as children of the configuration/features XML element—for example:
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        ...
        <build>
            <plugins>
                ...
                <!--
                    Step 3: gather all the bundles for the features your want to install
                -->
                <plugin>
                    <groupId>org.apache.karaf.tooling</groupId>
                    <artifactId>features-maven-plugin</artifactId>
                    <version>2.4.1</version>
                    <executions>
                        <execution>
                            <id>add-features</id>
                            <goals>
                                <goal>add-features-to-repo</goal>
                            </goals>
                            <phase>generate-resources</phase>
                            <configuration>
                                ...
                                <features>
                                    <!-- TODO: add the feature you want to use in your custom assembly to the list below -->
                                    <feature>shell</feature>
                                    <feature>admin</feature>
                                    <feature>management</feature>
                                    <feature>camel-blueprint</feature>
                                    <feature>camel-jaxb</feature>
                                    <feature>patch</feature>
                                    <feature>fabric</feature>
                                </features>
                                <repository>target/repository</repository>
                            </configuration>
                        </execution>
                    </executions>
                    ...
                </plugin>
                ...
            </plugins>
        </build>
        ...
    </project>
  4. (Not required for an offline repository) Customize the list of features that will be installed automatically when the custom assembly's container first starts. The patch feature and the fabric feature are both required, and must be added to this list.
    Open the src/main/filtered-resources/etc/org.apache.karaf.features.cfg file and modify the featuresBoot property setting as required, adding at least the fabric feature and the patch feature to the list:
    ...
    # TODO: list the boot features for your own assembly below
    featuresBoot=shell,admin,management,fabric,patch,camel-blueprint,camel-jaxb
  5. After customizing the configuration of the quickstarts/custom project, build the project as follows:
    mvn clean package
  6. The offline repository is now available in the following directory:
    InstallDir/quickstarts/custom/target/repository
    If the purpose of this build is to create an offline repository, the procedure is now finished and you can skip the remaining steps.
  7. The result of building this project is a custom assembly file, in the following location:
    InstallDir/quickstarts/custom/target/custom-distro-ProductVersion-bin.zip
  8. The custom assembly requires some additional modifications. In preparation for this, unpack the custom assembly file, custom-distro-ProductVersion-bin.zip, into a convenient working location on the file system:
    Working/custom-distro-ProductVersion-bin
  9. To reduce the size of the custom assembly, delete the extras/ subdirectory from custom-distro-ProductVersion-bin (saving about 67 MB).
  10. Create a new baseline archive for the custom assembly, as follows:
    1. Make a copy of the entire Working/custom-distro-ProductVersion-bin directory, to give a copy like the following:
      Working/custom-distro-ProductVersion-bin(copy)
    2. Rename the copied directory, custom-distro-ProductVersion-bin(copy), to the following:
      jboss-fuse-full-ProductVersion-baseline
      For example, if the ProductVersion is 6.2.1.redhat-084, the new directory name must be jboss-fuse-full-6.2.1.redhat-084-baseline.
    3. Delete the system/ subdirectory from the jboss-fuse-full-ProductVersion-baseline directory.
    4. Using an archive tool, compress the jboss-fuse-full-ProductVersion-baseline directory in Zip format to give the following archive file:
      jboss-fuse-full-ProductVersion-baseline.zip
      The preceding file is the baseline archive for the custom assembly.
  11. Copy the baseline archive to the following subdirectory (must be created) of the original custom assembly, Working/custom-distro-ProductVersion-bin:
    system/org/jboss/fuse/jboss-fuse-full/ProductVersion
  12. The custom assembly, Working/custom-distro-ProductVersion-bin, is now complete. If you like, you can compress this directory into a Zip archive and distribute it as is.
  13. Test the new custom assembly to make sure it is working properly. Launch the Karaf container, as follows:
    cd Working/custom-distro-ProductVersion-bin/bin
    ./fuse
    The container should start up without error. To make sure that no errors have occurred, check the log:
    JBossFuse:karaf@root> log:display
    You can also check to see whether all of the expected Karaf features are installed:
    JBossFuse:karaf@root> features:list -i
    When you are finished testing the custom assembly container, shut it down by entering the shutdown console command, and tidy up the custom assembly installation by removing the data/ subdirectory (which holds the data from the current container instance).

Troubleshooting

There are a few common errors you might encounter when attempting to start the custom assembly container. Here is a brief explanation of what these errors mean:
  • The following error indicates that the baseline archive was not correctly installed in the system directory:
    ERROR: Bundle org.apache.felix.framework [0] EventDispatcher: Error during dispatch. (io.fabric8.patch.management.PatchException: Can't find baseline distribution in patches dir or inside system repository.)
    io.fabric8.patch.management.PatchException: Can't find baseline distribution in patches dir or inside system repository.
            at io.fabric8.patch.management.impl.GitPatchManagementServiceImpl.trackBaselineRepository(GitPatchManagementServiceImpl.java:1820)
            at
    ...
  • The following error indicates that the patch feature is not deployed in the container:
    Bundle listed in startup.properties configuration not found: io/fabric8/patch/patch-management/1.2.0.redhat-621092/patch-management-1.2.0.redhat-621092.jar
    Could not create framework: java.lang.Exception: Aborting due to missing startup bundles
    java.lang.Exception: Aborting due to missing startup bundles
    	at org.apache.karaf.main.Main.processConfigurationProperties(Main.java:1281)
    	at org.apache.karaf.main.Main.loadStartupProperties(Main.java:1082)
    	at org.apache.karaf.main.Main.launch(Main.java:346)
    	at org.apache.karaf.main.Main.main(Main.java:561)
  • The following error indicates that the patch feature was successfully deployed, but the required fabric feature is missing:
    ERROR: Bundle io.fabric8.patch.patch-core [49] Error starting mvn:io.fabric8.patch/patch-core/1.2.0.redhat-621092
    (org.osgi.framework.BundleException: Unresolved constraint in bundle io.fabric8.patch.patch-core [49]:
    Unable to resolve 49.0: missing requirement [49.0] osgi.wiring.package; (&(osgi.wiring.package=io.fabric8.api)(version>=1.2.0)(!(version>=2.0.0))))

Legal Notice

Trademark Disclaimer

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, JBoss, MetaMatrix, Fedora, the Infinity Logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Apache, ServiceMix, Camel, CXF, and ActiveMQ are trademarks of Apache Software Foundation. Any other names contained herein may be trademarks of their respective owners.