You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

1. Quick start

If you are in a hurry to have Apache ServiceMix up and running right away, this article will provide you with some basic steps for downloading, building (when needed) and running the server in no time. This is clearly not a complete guide so you may want to check the other links in the [] main section for further information.

All you need is 5 to 10 minutes and to follow these basic steps.

Background

Apache ServiceMix Runtime is a small and lightweight OSGi based rutime. This provides a small lightweight container onto which various bundles can be deployed.

#top

Getting the software

At this time you have one option to get the software. The fastest and easiest way is to get the binary directly from the Apache site. Since this article is intended to help you to have Apache ServiceMix up and running in the fastest way only the binary download will be covered at this time.

Prerequisites

Although this installation path is the fastest one, still you will need to install some software before installing ServiceMix.

ServiceMix requires a Java 5 environment to run. Refer to http://java.sun.com for details on how to download and install J2SE 1.5 or greater.

Download binaries

Apache ServiceMix Runtime has not been released yet.
You can download a nightly build from the following location:
http://people.apache.org/repo/m2-snapshot-repository/org/apache/servicemix/runtime/apache-servicemix-runtime/0.1-SNAPSHOT/

Depending on the platform you plan to install and run Apache ServiceMix you will select the appropriate installation image. Open a Web browser and access the following URL, there you will find the available packages for download (binaries and source code).

http://servicemix.apache.org/download.html

Select the file compression format compatible with your system (zip for windows, tar.gz for unixes) by clicking directly on the link, download it and expand the binary to your hard drive in a new directory; for example in z:\servicemix - from now on this directory will be referenced as <SERVICEMIX_HOME>. Please remember the restrictions concerning illegal characters in Java paths, e.g. !, % etc.

The installation of Apache ServiceMix is as simple as uncompressing the .zip or .tar files. The next step is to start the server.

#top

Start the server

With Apache ServiceMix already installed, open a command line console and change directory to <SERVICEMIX_HOME>. To start the server, run the following command in Windows:

bin\servicemix.bat

respectively on Unix:

bin/servicemix.sh

You should see the following informations on the command line console:

Welcome to ServiceMix.
=====================

INFO: Starting to monitor the deploy directory: ./deploy every 500 millis
INFO: Config directory is at: ./etc
INFO: Will generate bundles from expanded source directories to: ./data/generated-bundles
org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling SLF4J API support.
org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Jakarta Commons Logging API support.
org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Log4J API support.
org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Avalon Logger API support.
[FelixDispatchQueue] INFO [undefined] - BundleEvent STARTED
 ____                  _          __  __ _
/ ___|  ___ _ ____   _(_) ___ ___|  \/  (_)_  __
\___ \ / _ \ '__\ \ / / |/ __/ _ \ |\/| | \ \/ /
 ___) |  __/ |   \ V /| | (_|  __/ |  | | |>  <
|____/ \___|_|    \_/ |_|\___\___|_|  |_|_/_/\_\
 ServiceMix (0.1-SNAPSHOT)

Type 'help' for more information.
--------------------------------------------------------------------------------------------------------------------------------
gnodet@Guillaume-Nodets-MacPro.local:/>

#top

Deploy a sample application

While you will learn in the remainder of this guide how to use and leverage Apache ServiceMix Runtime, we will just use the pre-built packaging for now.

In the console, run the following commands:

obr start org.apache.servicemix.bundles.jaxb-impl camel-spring camel-example-osgi

This commands will download, install and start the specified jars and their dependencies.

gnodet@Guillaume-Nodets-MacPro.local:/> obr start org.apache.servicemix.bundles.jaxb-impl camel-spring camel-example-osgi
Target resource(s):
-------------------
   camel-example-osgi (1.3.0.SNAPSHOT)
   ServiceMix OSGI Common Bundles: jaxb-impl (2.0.3.SNAPSHOT)
   camel-spring (1.3.0.SNAPSHOT)

Required resource(s):
---------------------
   ServiceMix OSGI Common Bundles: jaxws-api (2.0.0.SNAPSHOT)
   ServiceMix OSGI Common Bundles: jaxb-api (2.0.0.SNAPSHOT)
   geronimo-jta_1.1_spec (1.1.1.SNAPSHOT)
   camel-core (1.3.0.SNAPSHOT)
   ServiceMix OSGI Common Bundles: aopalliance (1.0.0.SNAPSHOT)
   geronimo-ejb_3.0_spec (1.0.1.SNAPSHOT)
   geronimo-jpa_3.0_spec (1.1.1.SNAPSHOT)
   geronimo-jms_1.1_spec (1.1.1.SNAPSHOT)
   ServiceMix OSGI Common Bundles: cglib (2.1.0.SNAPSHOT)
   geronimo-annotation_1.0_spec (1.1.1.SNAPSHOT)
   geronimo-j2ee-connector_1.5_spec (2.0.0.SNAPSHOT)
   spring-tx (2.5.0)
   geronimo-saaj_1.3_spec (1.0.0.SNAPSHOT)
   ServiceMix OSGI Common Bundles: ant (1.7.0.SNAPSHOT)
   geronimo-activation_1.1_spec (1.0.1.SNAPSHOT)

Deploying...done.

The example installed is using Camel to start a timer every 2 seconds and output a message on the console.

Stopping and uninstalling the sample application

TODO ... using: osgi listBundles, osgi stop xx, osgi uninstall xx

Summary

This document showed you how simple it is to have Apache ServiceMix up and running. The overall time for getting the server running should be less than five minutes if you have the prerequisite (Java 1.5) already installed. Additionally, this article also showed you how to deploy and test a simple Web Service in less than five minutes.

#top

  • No labels