Wiki Markup |
---|
{scrollbar} |
Anchor | ||||
---|---|---|---|---|
|
6.6. Installing additional features
This chapter will demonstrate how to add additional features from a remote maven repository to a default installation of the ServiceMix Kernel.Karaf.
Info |
---|
Last updated September 3, 2010 using Karaf 2.0.0 |
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 -
No Format etc/org.ops4j.pax.url.mvn.cfg
Update org.ops4j.pax.url.mvn.repositories to include the OPS4J and Apache Snapshot repos -No Format org.ops4j.pax.url.mvn.repositories=file:${user.home}/.m2/repository@snapshots,http://repo1.maven.org/maven2,http://repository.ops4j.org/maven2,http://people.apache.org/repo/m2-snapshot-repository<at:var at:name="snapshots" />noreleases
Adding additional feature repositories
The following steps will add in the URLs for the ServiceMix NMR Camel & ActiveMQ and Features locations.
- Start the ServiceMix Kernel 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-m3/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-m3/xml/features valid mvn:org.apache.servicemix.featuresactivemq/apacheactivemq-servicemixkaraf/5.4.0-m2-SNAPSHOT/xml/features valid mvn:org.apache.servicemix.kernelkaraf/apache-servicemix-kernelkaraf/12.0.01-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 kernel Karaf instance.
- List the available features -
No Format servicemix>karaf@root> features :list State Name . . . [uninstalled] [2.0.0] web 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 . . .
- 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 . . . [installed ] web-core[2.0.0] http karaf-2.0.0 [installed ] [2.0.0] web 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) [ 2933] [Active ] [ 50] [ 60] Apache ServiceMix :: Bundles :: jetty- (6.1.12rc1 (6.1.0.12rc1_122.2) [ 34] [Active ] [ ] [ 60] OPS4J Pax Web - API (0.7.2) [ 35] [Active ] [ ] [ 60] OPS4J Pax Web - Service SPI (0.7.2) [ 3036] [Active ] [ ] [ 5060] OPS4J Pax Web - Runtime (0.7.2) [ 37] [Active ] [ ] [ 60] OPS4J Pax Web - ContainerJetty (0.47.12) [ 3138] [Active ] [ ] [ 5060] OPS4J Pax Web - Jsp Support (0.47.12) [ 3239] [Active ] [ 50 ] [ 60] OPS4J Pax Web - Extender - WAR (0.37.02) [ 3340] [Active ] [ ] [ 5060] OPS4J Pax Web - Extender - Whiteboard (0.37.02) [ 3441] [Active ] [ 50 ] [ 60] OPS4J Pax Url - war:, war-i: (01.1.3.2) [ 3542] [Active ] [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://
Deploying a WAR to the installed web feature
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 - Copy the updated WAR (archive or extracted files) to the deploy directory.
Wiki Markup |
---|
{scrollbar} |