Search code examples
restmavencxfapache-karafdosgi

How to create a simple rest service with cxf and dosgi?


I try to create a rest-service from cxf-dosgi-project into my own maven-project. I don't understood the complex maven-pom-structure of the dosgi-rest-example at https://github.com/apache/cxf-dosgi/tree/master/samples/rest and are not able to transfer it. I tried many different dependencies and bundle-options.

I tried for hours to "copy" the example of https://github.com/apache/cxf-dosgi/tree/master/samples/rest in my own maven project with my own parent-pom. Always trying to copy the needed parts from dependencies, bundle-otions, ... But everytime i get a compiled bundle i get never a running rsa-endpoint.

The last test i tried i put at https://www.file-upload.net/download-13781406/circlead-rest-test.zip.html

When i run the example at https://github.com/apache/cxf-dosgi/tree/master/samples/rest in karaf it works like charm. So my skill is the problem to create my own karaf-rest-example on basis of the cxf-dosgi-rest-example. Have you a working example or can you explain to my how to use this example as base of a new rest-service as karaf-bundle?


Solution

  • Since a few days there is a new rest-example available with SCR. This works fine. See https://github.com/apache/karaf/tree/master/examples/karaf-rest-example/karaf-rest-example-scr