More Related Content
Similar to Has code123 (20)
Has code123
- 7. Installation
Just download the corresponding version for your operating system of choice from the Karaf website and unzip it somewhere.
Now switch to <installation_directory>/bin and run the karaf executable. The shell is quite comfortable – I have listed the most important commands for you here –
for a full list just type TAB and ENTER or use the help command.
Important Commands
Install bundle from file
install file:/path/filename
List Bundles
list
List Services
ls
Start Bundle
start <BUNDLE_ID>
Display latest logs
log:tail
Display exported packages and versions
export
You’re also able to use grep here to filter for specific entries .. e.g.:
karaf@root> exports | grep hascode
95 com.hascode.tutorial.hascode_osgi_service.api; version=0.0.0
104 com.hascode.tutorial.hascode_blueprint_bundle; version=0.0.0
105 com.hascode.tutorial.blueprint_service_export; version=0.0.0
Tutorial Sources
I have put the source from this tutorial on my Bitbucket repository – download it there or check it out using Mercurial:
hg clone https://bitbucket.org/hascode/osgi‐blueprint‐tutorial
Troubleshooting
“org.osgi.framework.BundleException: Unresolved constraint in bundle somepackage.somebundle [10]: Unable to resolve 10.0: missing requirement [10.0]
osgi.wiring.package; (&(osgi.wiring.package=org.osgi.service.blueprint)(version>=1.0.0)(!(version>=2.0.0)))” – Be sure to use an OSGi container that
supports the Blueprint specification .. e.g. Apache Karaf or SpringDM Server.
Resources
Apache Karaf Website
IBM.com: Building OSGi applications with the Blueprint Container specification
OSGi Alliance: OSGi Service Platform Release 4 Version 4.2 Enterprise Specification
Maven Bundle Plugin Website
Springsource.com: Comparing SpringDM and Blueprint
Article Updates
20160125: Project directory structure description added.
Tags: apache karaf, bind, blueprint, bundle, dependency injection, export, felix, listener, maven, osgi, service, springdm, tutorial, wiring
This entry was posted on Monday, April 16th, 2012 at 8:17 pm and is filed under Enterprise, Java. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or
trackback from your own site.