...
title | Outdated documentation |
---|
...
This chapter will demonstrate how to add additional features from a remote maven repository to a default installation of Karaf.
Info |
---|
Last updated January 13September 3, 2009 2010 using smx4knl 1Karaf 2.10.0-SNAPSHOT |
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.
...
The following steps will add in the URLs for the ServiceMix NMR Camel & ActiveMQ and Features locations.
- Start Karaf
No Format cd bin ./servicemixkaraf or servicemixkaraf.bat
- Add the following feature install locations
No Format servicemix>karaf@root> features/:addUrl mvn:org.apache.servicemix.nmractivemq/apacheactivemq-servicemix-nmrkaraf/15.04.0-m4/xml/features servicemix>karaf@root> features/:addUrl mvn:org.apache.servicemixcamel.karaf/features/apache-servicemix/42.0.0-m2-SNAPSHOT/xml/features
- Verify the feature URLs were added -
No Format servicemix>karaf@root> features/:listUrl mvn:org.apache.servicemixcamel.nmr/apache-servicemix-nmr/1karaf/features/2.0.0-m4-SNAPSHOT/xml/features valid mvn:org.apache.servicemix.kernelactivemq/apacheactivemq-servicemix-kernelkaraf/15.14.0-SNAPSHOT/xml/features valid mvn:org.apache.servicemix.featureskaraf/apache-servicemixkaraf/42.0.1-m2-SNAPSHOT/xml/features valid
Installing a new feature (
...
war)
The following steps will install the "webwar" feature (support for deploying WAR files with Servlet and JSPs into a Jetty server) into your Karaf instance.
- List the available features -
No Format servicemix>karaf@root> features/:list State Name . . . [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 [SMX4KNL:uninstalled] web[2.0.0] webconsole karaf-2.0.0 [installed ] [2.0.0] ssh karaf-2.0.0 . . .
- Install the web war feature (and the sub-features it requires) -
No Format servicemix>karaf@root> features/:install webwar
- Verify the features were installed
No Format servicemix>karaf@root> features/:list State Name . . . [SMX4KNL:installed ] web-core [SMX4KNL:installed ] web[2.0.0] http karaf-2.0.0 [installed ] [2.0.0] war karaf-2.0.0 . . .
- Verify the installed bundles were started
No Format servicemix>karaf@root> osgi/:list START LEVEL 100 ID State Blueprint Level Name . . . [ 32] [Active ] [ ] [ 60] geronimo-servlet_2.5_spec (1.1.2) [SMX4KNL: 2933] [SMX4KNL:Active ] [SMX4KNL: ] [ 5060] Apache ServiceMix :: Bundles :: jetty- (6.1.14 (6.1.14.SNAPSHOT) [SMX4KNL: 30] [SMX4KNL:Active22.2) [ 34] [Active ] [ ] [ 60] OPS4J Pax Web - API (0.7.2) [ 35] [Active ] [ ] [ 60] OPS4J Pax Web - Service SPI (0.7.2) [ 36] [Active ] [ ] [SMX4KNL: 5060] OPS4J Pax Web - Runtime (0.7.2) [ 37] [Active ] [ ] [ 60] OPS4J Pax Web Container- Jetty (0.47.12) [SMX4KNL: 3138] [SMX4KNL:Active ] [SMX4KNL: ] [ 5060] OPS4J Pax Web - Jsp Support (0.47.12) [SMX4KNL: 3239] [SMX4KNL:Active ] [SMX4KNL: ] [ 5060] OPS4J Pax Web - Extender - WAR (0.37.02) [SMX4KNL: 3340] [SMX4KNL:Active ] [SMX4KNL: ] [ 5060] OPS4J Pax Web - Extender - Whiteboard (0.37.02) [SMX4KNL: 3441] [SMX4KNL:Active ] [SMX4KNL: ] [ 5060] OPS4J Pax Url - war:, war-i: (01.1.3.2) [SMX4KNL: 3542] [SMX4KNL:Active ] [SMX4KNL:Created ] [ 5060] Apache ServiceMixKaraf :: WAR Deployer (42.0.0.m2-SNAPSHOT) . . .
- The Jetty server should now be listening on http://localhost:80808181/, but with no published applications available.
No Format HTTP ERROR: 404 NOT_FOUND RequestURI=/ Powered by jetty://
...
- 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 - Copy the updated WAR (archive or extracted files) to the deploy directory.
...