THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
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.6.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.0addurl mvn:org.apache.camel/camel-example-osgi/2.5.0/xml/features features:install camel-example-osgi |
This commands will download, install and start the specified jars.
The example installed is using Camel to start a timer every 2 seconds and output a message on the console.
Code Block |
---|
>>>> MyTransformSpringDSL set body: Fri Jan 07 11:59:51 CET 2011 >>>> SpringDSL set body: WedFri Jan 0207 2311:3459:1953 CET 20102011 >>>> MyTransformSpringDSL set body: WedFri Jan 0207 2311:3459:2155 CET 20102011 |
Stopping and uninstalling the sample application
To stop this demo, run the following command:
Code Block |
---|
osgifeatures:list | grep example |
...
uninstall camel-example- |
...
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
- Launching 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/*
...