|
Page Edited :
FELIX :
1. Quick Start
1. Quick Start has been edited by Robert Burrell Donkin (May 16, 2009). Change summary: Will detail experiences building from latest source 1. Quick startIf you are in a hurry to have Apache Felix Karaf up and running right away, this section 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 other sections of this guide for further information. All you need is 5 to 10 minutes and to follow these basic steps. BackgroundApache Felix Karaf is a small and lightweight OSGi based runtime. This provides a small lightweight container onto which various bundles can be deployed.
Getting the softwareAt 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 Felix Karaf up and running in the fastest way only the binary download will be covered at this time. PrerequisitesAlthough this installation path is the fastest one, still you will need to install some software before installing Karaf. Karaf requires a Java 5 environment to run. Refer to http://java.sun.com Download binaries
Depending on the platform you plan to install and run Karaf 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/kernel/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 Karaf is as simple as uncompressing the .zip or .tar files. The next step is to start the server. Start the serverWith Karaf 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 You should see the following informations on the command line console: ____ _ __ __ _ / ___| ___ _ ____ _(_) ___ ___| \/ (_)_ __ \___ \ / _ \ '__\ \ / / |/ __/ _ \ |\/| | \ \/ / ___) | __/ | \ V /| | (_| __/ | | | |> < |____/ \___|_| \_/ |_|\___\___|_| |_|_/_/\_\ ServiceMix Kernel (1.1.0) Type 'help' for more information. -------------------------------------------------------------------------------------------------------------------------------- s...@root:/> You can now run your first command. Simply enter help in the console followed by a carriage return. s...@root:/> help Available commands: about Display information about the current GShell application. help Display help for the current context. exit Exit the current shell. echo Print arguments to standard output. clear Clear the terminal screen. source Read and execute commands from a file in the current shell environment. set Set a variable or property. unset Unset a variable or property. alias Define an alias. unalias Undefine an alias. history Display history. info Display JVM informations about the current application. quit Link to: exit ssh Connect to a SSH server. sshd Start a SSH server. exec Execute system processes. java Execute a Java standard application. sleep Sleep for a bit then wake up. date Displays the current time and date. edit Edit a file with an external editor. find Find files in a hierarchy. hostname Displays the name of the current host. printf Print formatted output. cat Displays the contents of a file. grep Displays lines matching a pattern. print Link to: echo cd Changes the current directory. pwd Displays the current directory. ls List the contents of a file or directory. cp Copies a file or directory. rm Remove a file or directory. fileinfo Displays information about a file. touch Sets the last-modified time of a file. dir Link to: ls copy Link to: cp del Link to: rm osgi Command group: osgi log Command group: log admin Command group: admin packages Command group: packages config Command group: config features Command group: features Deploy a sample applicationWhile you will learn in the remainder of this guide how to use and leverage Apache ServiceMix Kernel, we will just use the pre-built packaging for now. In the console, run the following commands: osgi/install -s mvn:org.apache.geronimo.specs/geronimo-activation_1.1_spec/1.0.2 osgi/install -s mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.stax-api-1.0/1.1.0 osgi/install -s mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.1/1.1.0 osgi/install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl/2.1.6_1 osgi/install -s mvn:org.apache.camel/camel-core/1.4.0 osgi/install -s mvn:org.springframework/spring-tx/2.5.5 osgi/install -s mvn:org.apache.camel/camel-spring/1.4.0 osgi/install -s mvn:org.apache.camel/camel-osgi/1.4.0 osgi/install -s mvn:org.apache.camel/camel-example-osgi/1.4.0 This commands will download, install and start the specified jars. The example installed is using Camel >>>> MyTransform set body: Wed Jan 02 23:34:19 CET 2008 >>>> MyTransform set body: Wed Jan 02 23:34:21 CET 2008 Stopping and uninstalling the sample applicationTo stop this demo, run the following command: osgi/list | grep example In the output, locate the line containing camel-example-osgi and note the id of the bundle in the first column. Then launch the following command: osgi/stop [id] If you wish, you can start again the sample by using the following command: osgi/start [id] To uninstall the demo, run the following command: osgi/uninstall [id] Common Problems
Stopping KarafTo stop Karaf from the console, run the following command: exit SummaryThis document showed you how simple it is to have Apache Felix Karaf 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 Apache Camel application in less than five minutes. |
Unsubscribe or edit your notifications preferences
