Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the console, run the following commands:

Code Block
features:install spring-dm
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.56.SEC01
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

...

To stop this demo, run the following command:

Code Block
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:

Code Block
osgi/:stop [id]

If you wish, you can start again the sample by using the following command:

Code Block
osgi/:start [id]

To uninstall the demo, run the following command:

Code Block
osgi/:uninstall [id]

Common Problems

  1. Launching SMX4 Karaf can result in a deadlock in Felix during module dependency resolution. This is often a result of sending a SIGINT (control-C) to the process when it will not cleanly exit. This can corrupt the caches and cause startup problems in the very next launch. It is fixed by emptying the component cache:
    Code Block
    rm -rf data/cache/*
    

Stopping Karaf

To stop Karaf from the console, enter ^D in the console:

Code Block

^D

Alternatively, you can also run the following command:

Code Block
exitosgi:shutdown

Summary

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

...