/hello-karaf-demo

An OSGi Declarative Services (DS) component that starts and registers a servlet as a service. The servlet returns a simple "Hello world" style HTML page.

Primary LanguageJavaApache License 2.0Apache-2.0

A simple Pax Web Whiteboard Extender Application

This is a minimal “Hello world” application that will plug into the Pax Web Whiteboard Extender with the local path “/hello” where it returns an HTML page.

Status

https://github.com/steinarb/hello-karaf-demo/actions/workflows/hello-karaf-demo-maven-ci-build.yml/badge.svg https://coveralls.io/repos/github/steinarb/hello-karaf-demo/badge.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_hello-karaf-demo&metric=alert_status#.svg https://maven-badges.herokuapp.com/maven-central/no.priv.bang.demos/hello-karaf-demo/badge.svg

https://sonarcloud.io/images/project_badges/sonarcloud-white.svg

https://sonarcloud.io/api/project_badges/measure?project=steinarb_hello-karaf-demo&metric=sqale_index#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_hello-karaf-demo&metric=coverage#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_hello-karaf-demo&metric=ncloc#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_hello-karaf-demo&metric=code_smells#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_hello-karaf-demo&metric=sqale_rating#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_hello-karaf-demo&metric=security_rating#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_hello-karaf-demo&metric=bugs#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_hello-karaf-demo&metric=vulnerabilities#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_hello-karaf-demo&metric=duplicated_lines_density#.svg https://sonarcloud.io/api/project_badges/measure?project=steinarb_hello-karaf-demo&metric=reliability_rating#.svg

How to install

This is how to build and install the servlet:

  1. First download and install apache karaf
  2. In the apache karaf command line, install the feature that pulls in the servlet with dependencies
    feature:repo-add mvn:no.priv.bang.demos/hello-karaf-demo/LATEST/xml/features
    feature:install hello-karaf
        
  3. After this, the servlet will be listening for GET requests, at the local path “/hello” on the karaf web server, e.g. http://localhost:8181/hello for a karaf server started locally, with default settings

To uninstall the servlet from karaf

This is how to uninstall the servlet from karaf:

  1. At the karaf console prompt, give the following command:
    feature:uninstall hello-karaf-demo
        

This will disconnect the servlet from the Pax Web Whiteboard Extender and uninstall the servlet, and all dependencies (e.g. Pax Web) that has been pulled in by this feature.

However, if a different feature has pulled in the same dependencies, the dependencies won’t be uninstalled until everything that has required them is uninstalled.

License

This software project is licensed under Apache License v. 2.

See the LICENSE file for details.