Chapter 1. Install Fuse for Development on Apache Karaf

To develop Fuse applications that run on Karaf, install Fuse locally as described in the following topics:

1.1. Prepare to install Fuse on Apache Karaf

To prepare to install Fuse on Apache Karaf, check your system to ensure that it meets hardware requirements, is a supported platform, and has a supported Java runtime. Also, confirm that you plan to use supported standard software for web services, APIs, and transport protocols.

Procedure

  1. On the system on which you plan to install Fuse, confirm that it has:

    • 250 MB of free disk space
    • 2 GB of RAM

    This hardware requirement is for a full installation of Fuse on Apache Karaf. In addition, a system that is running Fuse requires space for caching, persistent message stores, and other functions. The actual requirement is dependent on what your Fuse applications do.

  2. Confirm that the system on which you plan to install Fuse is running a supported platform. Red Hat tests and supports Fuse products on the platforms that are listed in Red Hat Fuse Supported Configurations.
  3. Confirm that your system is running a Java runtime that is supported by Fuse on Apache Karaf. See Supported Java Versions in Red Hat Fuse Supported Configurations.
  4. Ensure that your Java runtime is not installed under a directory path that includes whitespace. For example, C:\Program Files\Java\jdk8 is not an acceptable path. Whitespace in paths causes unpredictable errors in Fuse on Apache Karaf at run time.
  5. Check the list of Red Hat Fuse Supported Standards to confirm that you are using supported standard software.

1.2. Install Fuse on Apache Karaf

The standard installation package for Fuse 7.7 on Karaf is available for download from the Red Hat Customer Portal. It installs the standard assembly of the Apache Karaf container, and provides the full Fuse technology stack.

It is possible to create your own custom assembly of Fuse 7.7, which contains a customized subset of the Fuse features and bundles. The custom quickstart demonstrates how to use Maven to create a custom assembly of Red Hat Fuse. You can install all of the quickstarts from a downloadable file available on the Fuse Software Downloads page.

Prerequisite

The system on which you plan to install Fuse meets the hardware and software requirements described in Section 1.1, “Prepare to install Fuse on Apache Karaf”.

Procedure

  1. In a browser, go to the Fuse Software Downloads page.

    If you are not already logged in to the Red Hat customer portal, there is a prompt to log in and then the download page appears (your account must be associated with a Red Hat Fuse subscription).

  2. In the Fuse Software Downloads page, to the right of Red Hat Fuse 7.7 on Karaf Installer, click Download to obtain a local zip file.
  3. Extract the contents of the zip file into a directory for which you have all permissions.

    Do not unpack the zip file into a directory that has spaces or any of the following special characters in its path name: #, %, ^, ". For example, do not unpack into C:\Documents and Settings\Greco#Roman\Desktop\fuse.

  4. If you are using the IBM JDK, perform the following additional steps:

    1. In your Fuse installation directory, in the /lib/endorsed directory, remove the saaj-api .jar file, for example:

      rm lib/endorsed/org.apache.servicemix.specs.saaj-api-1.3-2.9.0.jar
    2. Set the JAVA_OPTS environment variable as follows:

      JAVA_OPTS=-Xshareclasses:none

      You must set the JAVA_OPTS environment variable before you start the Karaf container.

  5. Add an administrator user to enable remote access to the Fuse on Karaf container and to access the Fuse Console.

    By default, no users are defined for the container. You can run the container in the foreground in this case, but you cannot access the container remotely and you cannot run it in the background. It is recommended that you create at least one user with the admin role by following these steps:

    1. In a text editor, open the etc/users.properties file, which is in your Fuse installation directory.
    2. Locate the following lines:

      #admin = admin,_g_:admingroup
      #_g_\:admingroup = group,admin,manager,viewer,systembundles,ssh
    3. For each line, remove the leading # character to uncomment the line.
    4. In the first line, change the first instance of admin to a username that you choose, for example user1.
    5. In the same line, change the second instance of admin to a password for that user, for example passw0rd.

      For example:

      user1 = passw0rd,_g_:admingroup
      _g_\:admingroup = group,admin,manager,viewer,systembundles,ssh
    6. Save and close the file.
  6. To start Fuse, run bin/fuse on Linux/Unix or bin\fuse.bat on Windows.
  7. Optionally, to access the Fuse Console, open the provided URL in a web browser and login with the username and password that you set in the etc/users.properties file. For more information about using the Fuse Console see Managing Fuse.

1.3. About running Fuse on Karaf offline

You can run the Apache Karaf container in offline mode, that is, without an Internet connection. However, 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.

To run the Apache Karaf container in offline mode, it is necessary to distinguish between the following kinds of dependencies:

  • Runtime dependencies are dependencies that are required to run the Apache Karaf container in its default configuration.
  • Build-time dependencies are dependencies that are 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 Apache Karaf container in its default configuration is supported in offline mode. The default configuration of the Apache Karaf container is specified by the featuresBoot property in the etc/org.apache.karaf.features.cfg file. The required dependencies are 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. However, custom applications typically have third-party dependencies that require an Internet connection so that JAR files can be downloaded by Apache Maven.

1.4. Optionally use standalone Apache distributions

Red Hat Fuse provides an additional package to download, which contains the standard distributions of Apache Camel and Apache CXF. If you want to use a standard, upstream distribution of Apache Camel or Apache CXF (without the OSGi container) use the archived versions in the downloaded extras package.

Procedure

  1. Log in to the Red Hat customer portal.
  2. Go to the Red Hat Customer Portal→Downloads→Red Hat Fuse→Downloads page.
  3. Select 7.7.0 from the Version drop-down list on the Software Downloads page.
  4. Download the Red Hat Fuse 7.7.0 Extras archive.

    The extras archive file contains the following archive files nested inside it:

    • apache-camel-2.21.0.fuse-770013-redhat-00001.zip
    • apache-cxf-3.2.7.fuse-770017-redhat-00001.zip
  5. 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\fuse.