Book Image

Apache Karaf Cookbook

By : Jamie Goodyear, Johan Edstorm, Achim Nierbeck, Heath J Kesler
Book Image

Apache Karaf Cookbook

By: Jamie Goodyear, Johan Edstorm, Achim Nierbeck, Heath J Kesler

Overview of this book

Table of Contents (17 chapters)
Apache Karaf Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Building and deploying a RESTful service in Karaf


Now, let's look at how the code is assembled in order to publish a CXF endpoint in Karaf using just CXF.

Getting ready

In this recipe, we will work with the chapter5-recipe3 example from the code bundle. Uninstall the recipe2 code before going ahead with this recipe

First, install CXF as shown in the Installing Apache CXF modules in Apache Karaf recipe, and then build and deploy a sample CXF application as recipe3 in Karaf.

Go to the chapter5-recipe3 example from the code bundle and run the Maven build using the following command:

mvn clean install

This will build and install the sample applications for the chapter5-recipe3 example into the Maven repository, so we can easily install them in the Karaf instance.

How to do it…

Once the bundle is deployed, we can look at deploying and starting the CXF endpoint.

From the command line in the Karaf instance, install the chapter5-recipe3 example's CXF module, start the bundle, and publish the endpoint with...