Java Runtime

Do not install the Java runtime under a directory path that includes whitespace. For example, C:\Program Files\Java\jdk8 is not an acceptable install path and will lead to unpredictable errors in Fuse on Apache Karaf at run time.

Recommended software

Chapter 2. Installation Types

The standard install package for Fuse 7.2 on Karaf is available for download from the Red Hat Customer Portal. It installs the standard assembly of the Apache Karaf container, including the full Fuse technology stack.

It is possible to create your own custom assembly of Fuse 7.2, containing a customized subset of the Fuse features and bundles.

Select 7.2.0 from the Version drop-down list on the Software Downloads page.

Click the Download button next to the Red Hat Fuse 7.2.0 on Karaf Installer file.

Unpacking the archive

Fuse on Karaf is packaged as a .zip file. Using a suitable archive tool, such as Zip, unpack Fuse on Karaf 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\fuse.

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:

rm lib/endorsed/org.apache.servicemix.specs.saaj-api-1.3-2.7.0.jar

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

Fuse on Karaf is not installed with a default user for the remote console. You must add a user before you can connect to the server’s remote console. To add a user, edit InstallDir/etc/users.properties.

Important

The information in this file is unencrypted so it is not suitable for environments that require strict security.

Note that the first line has the syntax USER=PASSWORD,_g_:GROUP,ROLE1,ROLE2,.... In this example, the first line specifies a user, admin, with the password, admin, and the role group, admingroup.

Uncomment both lines by removing the leading # character.

Change the first admin to the desired user name.

Change the second admin to the desired password.

Save the changes.

Chapter 5. Offline Mode

You can run the Apache Karaf 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.

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

Runtime dependencies — the dependencies required to run the Apache Karaf container, in its default configuration.

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 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.

5.1. Download repository for Maven project

From the project directory that contains the pom.xml file, run the following Maven command:

All the Maven dependencies and plug-ins required to build the project will be downloaded to the /tmp/foo directory.

5.2. Enable offline mode

To enable offline mode you must edit etc/org.ops4j.pax.url.mvn.cfg. Find the setting org.ops4j.pax.url.mvn.offline and replace the default false with true.

##
# If set to true, no remote repository will be accessed when resolving artifacts
#
org.ops4j.pax.url.mvn.offline = true

Appendix A. Installing the Apache Components

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 distribution of Apache Camel or Apache CXF (without the OSGi container) use the archived versions in the downloaded extras package.

A.2. Contents of the extras archive

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\fuse.

Appendix B. Preparing to use Maven

B.1. Overview

This section gives a brief overview of how to prepare Maven for building Red Hat Fuse projects and introduces the concept of Maven coordinates, which are used to locate Maven artifacts.

B.2. Prerequisites

In order to build a project using Maven, you must have the following prerequisites:

Maven installation — Maven is a free, open source build tool from Apache. You can download the latest version from the Maven download page.

Network connection — whilst performing a build, Maven dynamically searches external repositories and downloads the required artifacts on the fly. By default, Maven looks for repositories that are accessed over the Internet. You can change this behavior so that Maven will prefer searching repositories that are on a local network.

Note

Maven can run in an offline mode. In offline mode Maven only looks for artifacts in its local repository.

B.3. Adding the Red Hat Maven repositories

In order to access artifacts from the Red Hat Maven repositories, you need to add them to Maven’s settings.xml file. Maven looks for your settings.xml file in the .m2 directory of the user’s home directory. If there is not a user specified settings.xml file, Maven will use the system-level settings.xml file at M2_HOME/conf/settings.xml.

To add the Red Hat repositories to Maven’s list of repositories, you can either create a new .m2/settings.xml file or modify the system-level settings. In the settings.xml file, add repository elements for the Red Hat repositories as shown in Adding the Red Hat Fuse Repositories to Maven.

B.4. Artifacts

The basic building block in the Maven build system is an artifact. The output of an artifact, after performing a Maven build, is typically an archive, such as a JAR or a WAR.

B.5. Maven coordinates

A key aspect of Maven functionality is the ability to locate artifacts and manage the dependencies between them. Maven defines the location of an artifact using the system of Maven coordinates, which uniquely define the location of a particular artifact. A basic coordinate tuple has the form, {groupId, artifactId, version}. Sometimes Maven augments the basic set of coordinates with the additional coordinates, packaging and classifier. A tuple can be written with the basic coordinates, or with the additional packaging coordinate, or with the addition of both the packaging and classifier coordinates, as follows:

Defines a scope for the name of the artifact. You would typically use all or part of a package name as a group ID — for example, org.fusesource.example.

artifactId

Defines the artifact name (relative to the group ID).

version

Specifies the artifact’s version. A version number can have up to four parts: n.n.n.n, where the last part of the version number can contain non-numeric characters (for example, the last part of 1.0-SNAPSHOT is the alphanumeric substring, 0-SNAPSHOT).

packaging

Defines the packaged entity that is produced when you build the project. For OSGi projects, the packaging is bundle. The default value is jar.

classifier

Enables you to distinguish between artifacts that were built from the same POM, but have different content.

The group ID, artifact ID, packaging, and version are defined by the corresponding elements in an artifact’s POM file. For example:

It is not necessary to specify the bundle package type in the preceding dependency, because a bundle is just a particular kind of JAR file and jar is the default Maven package type. If you do need to specify the packaging type explicitly in a dependency, however, you can use the type element.

Legal Notice

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, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.

Linux® is the registered trademark of Linus Torvalds in the United States and other countries.

Java® is a registered trademark of Oracle and/or its affiliates.

XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.

MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.

Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.

The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.