3. Installation has been edited by Bruce Snyder (Jan 21, 2008).

(View changes)

Content:

3. Installation

This document describes how to install and configure ServiceMix 3.x for both Unix and Windows' platforms.
Here you will find information about what are pre requisite software, where to download Geronimo from and how to customize the installation to use custom ports other than the defaults.

Installing the ServiceMix Binary Distribution

Once you've followed the tutorials to create some SUs and SAs, you'll need to deploy them to ServiceMix. This requires that you install the binary distribution of ServiceMix so that you can deploy your SAs to it. Below are the steps to achieve this.

Pre-Installation Requirements

Hardware:

  • 100 MB of disk space for the ServiceMix 3.x binary distribution.

Operating Systems:

  • Windows: Windows XP SP2, Windows 2000
  • Unix: Any Linux/Unix platform that supports Java

Environment:

  • Java Developer Kit (JDK) 1.4.x or greater for deployment and 1.5.x (Java 5) for compiling.

Binary Distribution Installation Procedure

This procedure explains how to download and install the binary distribution.

  1. Download the binary distribution for your platform (either a tarball for a zip file). The latest release is always linked from the downloads page.
  2. Extract the download into a directory of your choice.
  3. Proceed to the Starting ServiceMix section of this document.
  4. Following start-up, go to Testing the Installation section of this document.

Starting ServiceMix

This section provides instructions on starting ServiceMix from both Windows and Unix platforms. Below are the steps to follow:

> cd $SERVICEMIX_HOME

The $SERVICEMIX_HOME above is just simply a placeholder for the ServiceMix binary distribution directory, i.e., the directory you expanded from the downloaded tarball or zip file.


Windows:

> .\bin\servicemix

Linux/Unix:

$ ./bin/servicemix
Warning

Don't close the window containing the command prompt in which ServiceMix is running as doing so will terminate ServiceMix. On Linux/Unix, this can be worked around by starting ServiceMix with the nohup utlity.

Stopping ServiceMix

For both Windows and Unix installations, terminate ServiceMix by typing "CTRL-C" on the command line where ServiceMix is running. ServiceMix uses the Java shutdown hook to cleanly shut down the container.

Additional Resources

After the installation, ServiceMix is running with a basic configuration. For details on configuring additional options, please see Configuration.

Before trying to use ServiceMix, make sure to read the What is JBI document, take a look at the available Components list for a list of JBI compliant components and get an idea for the ServiceMix Architecture along with the supported NMR Flows.

A good next step is to deploy and run the Examples that are part of the ServiceMix binary distribution. The examples are located in the examples directory under the directory in which ServiceMix was installed.

Handy Hint

Add $SERVICEMIX_HOME/bin directory to $PATH variable to simplify execution of the examples.

To view the statistics and operation of ServiceMix in a JMX Console and see how the Management works please read the page about the JMX Console and the page about Management.

Working With the ServiceMix Source Code

If you're interested to dig in and work with the ServiceMix source code, take a look at the Source and the Building documents. These documents will help you check out the ServiceMix source code using Subversion and build it using Maven.

Troubleshooting

Path name

In case you get a

Exception in thread "main" java.lang.IllegalArgumentException

you may have some illegal characters in the path, e.g. !, % etc.

Missing libraries

Starting ServiceMix with old examples, CIMERO-generated xml configuration files or custom code may cause errors due to missing libraries. Usually, the missing class is displayed at the very end of the output. Here, some examples are shown and explained.

Caused by: java.lang.NoClassDefFoundError: org/quartz/JobExecutionException
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:242)
    at org.springframework.util.ClassUtils.forName(ClassUtils.java:160)
    at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.createBeanDefinition(BeanDefinitionReaderUtils.java:95)
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:452)
    ... 53 more

Obviously (bold typed text), a class inside the quartz package cannot be found. A quick search for "quartz" in the Maven repository reveals [user_home]\.m2\repository\quartz\quartz\1.5.2\quartz-1.5.2.jar (or newer version) which has to be copied to [ServiceMix_home]\lib\quartz-1.5.2.jar - the error shall be resolved now. Of course, adding the directory containing the jar to the classpath is another possibility.

Very similar is

...
Caused by: java.lang.ClassNotFoundException: org.apache.servicemix.components.file.FileWriter
...

indicating that the whole servicemix-common package cannot be found. In the Maven repository, servicemix-components-3.0-incubating.jar (or newer version) can be found and copied to ServiceMix' lib directory. Note: As this is a ServiceMix' sub-project, the jar is available at [ServiceMix_home]\components as well.

Slightly trickier is 

...
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unrecognized xbean namespace mapping: http://servicemix.apache.org/eip/1.0
...

A short www search leads to Unrecognized xbean namespace mapping. With this information, one can infer that [user_home]\.m2\repository\org\apache\servicemix\servicemix-eip\3.0-incubating\servicemix-eip-3.0-incubating.jar (or newer version) has to be copied to [ServiceMix_home]\lib\servicemix-eip-3.0-incubating.jar so ServiceMix can find the classes.

Testing the Installation

If ServiceMix is up and running without problems, the Window's console window or the Unix command shell will display something similar to the following log line:

INFO - JBIContainer.init(421) | ServiceMix JBI Container ([http://servicemix.org/]) name: defaultJBI running version: 3.0-incubating

ServiceMix's default port is 1099. From another window run netstat and search for port 1099.

From a Windows console, type:

netstat -an | find "1099"

OR

From a Unix command shell, type:

netstat -an | grep 1099

top

Reply via email to