...
|
This chapter will demonstrate how to add additional features from a remote maven repository to a default installation of Karaf.
|
{info}Last updated January 13, 2009 using smx4knl 1.1.0-SNAPSHOT{info}
|
{info}Last updated September 3, 2010 using Karaf 2.0.0{info}
|
h2. Adding additional maven repositories
|
The following steps will add in the missing OPS4J and Apache Snapshot maven repositories. *Note* - \- this has been fixed in the 1.1.0 of ServiceMix Kernel release and can be skipped.
|
# Edit the following file - {noformat}
|
...
|
h2. Adding additional feature repositories
|
The following steps will add in the URLs for the ServiceMix NMR Camel & ActiveMQ and Features locations.
|
# Start Karaf {noformat} cd bin
|
./servicemix or servicemix.bat
|
./karaf or karaf.bat
|
{noformat} # Add the following feature install locations {noformat}
|
servicemix> features/addUrl mvn:org.apache.servicemix.nmr/apache-servicemix-nmr/1.0.0-m4/xml/features servicemix> features/addUrl mvn:org.apache.servicemix.features/apache-servicemix/4.0-m2-SNAPSHOT/xml/features
|
ka...@root> features:addUrl mvn:org.apache.activemq/activemq-karaf/5.4.0/xml/features ka...@root> features:addUrl mvn:org.apache.camel.karaf/features/2.0.0/xml/features
|
{noformat} # Verify the feature URLs were added - {noformat}
|
servicemix> features/listUrl mvn:org.apache.servicemix.nmr/apache-servicemix-nmr/1.0.0-m4-SNAPSHOT/xml/features mvn:org.apache.servicemix.kernel/apache-servicemix-kernel/1.1.0-SNAPSHOT/xml/features mvn:org.apache.servicemix.features/apache-servicemix/4.0-m2-SNAPSHOT/xml/features
|
ka...@root> features:listUrl mvn:org.apache.camel.karaf/features/2.0.0/xml/features valid mvn:org.apache.activemq/activemq-karaf/5.4.0/xml/features valid mvn:org.apache.karaf/apache-karaf/2.0.1-SNAPSHOT/xml/features valid
|
{noformat}
|
h2. Installing a new feature (web) (war)
|
|
The following steps will install the "web" "war" feature (support for deploying WAR files with Servlet and JSPs into a Jetty server) into your Karaf instance.
|
# List the available features - {noformat}
|
servicemix> features/list
|
ka...@root> features:list
|
State Name . . .
|
[SMX4KNL:uninstalled] web
|
[uninstalled] [2.0.0] obr karaf-2.0.0 [uninstalled] [2.0.0] config karaf-2.0.0 [uninstalled] [2.0.0] http karaf-2.0.0 [uninstalled] [2.0.0] war karaf-2.0.0 [uninstalled] [2.0.0] webconsole karaf-2.0.0 [installed ] [2.0.0] ssh karaf-2.0.0
|
. . . {noformat}
|
# Install the web war feature (and the sub-features it requires) -
|
{noformat}
|
servicemix> features/install web
|
ka...@root> features:install war
|
{noformat} # Verify the features were installed {noformat}
|
servicemix> features/list
|
ka...@root> features:list
|
State Name . . .
|
[SMX4KNL:installed ] web-core [SMX4KNL:installed ] web
|
[installed ] [2.0.0] http karaf-2.0.0 [installed ] [2.0.0] war karaf-2.0.0
|
. . . {noformat} # Verify the installed bundles were started {noformat}
|
servicemix> osgi/list
|
ka...@root> osgi:list
|
START LEVEL 100
|
ID State Blueprint Level Name
|
. . .
|
[SMX4KNL: 29] [SMX4KNL:Active ] [SMX4KNL: 50] Apache ServiceMix Bundles: jetty-6.1.14 (6.1.14.SNAPSHOT) [SMX4KNL: 30] [SMX4KNL:Active ] [SMX4KNL: 50] OPS4J Pax Web - Web Container (0.4.1) [SMX4KNL: 31] [SMX4KNL:Active ] [SMX4KNL: 50] OPS4J Pax Web - Jsp Support (0.4.1) [SMX4KNL: 32] [SMX4KNL:Active ] [SMX4KNL: 50] OPS4J Pax Web Extender - WAR (0.3.0) [SMX4KNL: 33] [SMX4KNL:Active ] [SMX4KNL: 50] OPS4J Pax Web Extender - Whiteboard (0.3.0) [SMX4KNL: 34] [SMX4KNL:Active ] [SMX4KNL: 50] OPS4J Pax Url - war:, war-i: (0.3.2) [SMX4KNL: 35] [SMX4KNL:Active ] [SMX4KNL: 50] Apache ServiceMix WAR Deployer (4.0.0.m2-SNAPSHOT)
|
[ 32] [Active ] [ ] [ 60] geronimo-servlet_2.5_spec (1.1.2) [ 33] [Active ] [ ] [ 60] Apache ServiceMix :: Bundles :: jetty (6.1.22.2) [ 34] [Active ] [ ] [ 60] OPS4J Pax Web - API (0.7.2) [ 35] [Active ] [ ] [ 60] OPS4J Pax Web - Service SPI (0.7.2) [ 36] [Active ] [ ] [ 60] OPS4J Pax Web - Runtime (0.7.2) [ 37] [Active ] [ ] [ 60] OPS4J Pax Web - Jetty (0.7.2) [ 38] [Active ] [ ] [ 60] OPS4J Pax Web - Jsp Support (0.7.2) [ 39] [Active ] [ ] [ 60] OPS4J Pax Web - Extender - WAR (0.7.2) [ 40] [Active ] [ ] [ 60] OPS4J Pax Web - Extender - Whiteboard (0.7.2) [ 41] [Active ] [ ] [ 60] OPS4J Pax Url - war:, war-i: (1.1.3) [ 42] [Active ] [Created ] [ 60] Apache Karaf :: WAR Deployer (2.0.0)
|
. . . {noformat}
|
# The Jetty server should now be listening on http://localhost:8080/, [http://localhost:8181/], but with no published applications available.
|
{noformat} HTTP ERROR: 404
|
...
|
The following steps will describe how to install a simple WAR file (with JSPs or Servlets) to the just installed web feature. # To deploy a WAR (JSP or Servlet) to Jetty, update its MANIFEST.MF to include the required OSGi headers as described here -
|
http://wiki.ops4j.org/confluence/display/ops4j/Pax+Web+Extender+-+War+-+OSGi-fy
|
[http://wiki.ops4j.org/confluence/display/ops4j/Pax+Web+Extender+-+War+-+OSGi-fy]
|
# Copy the updated WAR (archive or extracted files) to the _deploy_ directory.
|
...
|