Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6887983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:57:08+00:00 2026-05-27T05:57:08+00:00

I’ve been doing my research about exposing Eclipse plugins as web services, but I’m

  • 0

I’ve been doing my research about exposing Eclipse plugins as web services, but I’m getting confused.

My requirement is basically to build an Equinox back end for a set of web services.
I’ll be using EMF and related projects heavily, so with this goal in mind I’ve been reading about Equinox/OSGI and options to build what I need.

However, there are some mysterious points and in general an abundance of projects around. Given the findings below, I’d like hear your suggestions. Maybe there is an option I’m missing, or maybe you’ve done this before. Here are the nominees (drumroll)

Hosting Equinox in a web container. Using bridge.war, the plugins can expose a servlet. The problem is, to use nice REST frameworks such as RestEasy (my favourite), the REST framework needs to be a osgi bundle that’d live in the Equionox runtime. I’ve spend 3 days, and due to classloader issues, this is not working. I am now convinced that I won’t be able to have RestEasy in Equinox. I can have RestEasy in web container, and use XML serialization/deserialization to make code in web container talk to code in Equionox, but this feels like such a waste of resources. Still, this may work.

The other option seems to be ECF, which is an implementation of distributed OSGI, which seems to support SOAP/Rest. However, I could not find a clear tutorial that just exposes Equinox hosted functionality as a web service. So this still forces me no not to use RestEasy, but at least it seems to give me a proper framework to talk to Equinox. I’d probably still have to keep this in a web contaner for scalability.

Then there is Eclipse Virgo, which seems to support hosting web applications alongside OSGI runtime, and apparently web container hosted code can talk to OSGI runtime code. Still, I am not sure if I can pass around classes since a Jaxb annotated type A created under web container is likely to use a differnet classloader than the OSGI runtime plugin. Also, this setup locks me into Virgo, and I would rather go with JBoss etc for production use.

So given these options, and possibly more I do not know about at the moment, how would you expose EMF and other Eclipse framework based projects as web services?

Edit:
based on the great response I’d like to add more. Partially details of the question, partially comments which did not fit into comment section.

My research after the question let me to the exact same point with the accepted answer: Apache CXF is now an implementation of Distributed OSGI, which is good. I have given up on RestEasy. My current concern is, I already have a XSD that has created my classes. RestEasy made it very easy to expose these, and I’d have to do the same here. My plugins would have to use these JAXB based classes. In the worst case, I may attempt to use Eclipse Link project which offers JAXB support, in order to create XML content, and pass it through either basic servlet use or as string values based on CXF. So solutions discussed here don’t feel perfect, but I guess this is the best one can do at the moment.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:57:09+00:00Added an answer on May 27, 2026 at 5:57 am

    I work on a product that has done this. We have Equinox inside the web container. We expose SOAP and REST web services using Apache CXF. It took some black magic to get everything wired up correctly. I found the CXF documentation to be not so great, especailly for OSGI.

    As I am sure you know, hosting Equinox in the web container is not a recommended practice, although it is a hard one to avoid if you want to use OSGI. We too experienced a number of classloading issues. In fact we never really enjoyed the advertised benefits from OSGI (modularity, etc). It’s too late for us to turn back now. OSGI should not be entered into lightly.

    So here is a quick overview of how we have enabled SOAP/REST using CXF. Hopefully this will at least point you in the right direction.

    1) Install CXF OSGI bundles, both core and DOSGI – We are using the following:
    cxf-bundle-minimal-2.2.12.jar
    cxf-dosgi-ri-discovery-local-1.1.jar
    cxf-dosgi-ri-dsw-cxf-1.1.jar
    Links:
    http://cxf.apache.org/download.html

    2) Install JAX-RS (REST) and JAX-WS (SOAP) APIs
    -The API definition are in org.apache.servicemix.specs.jsr311-api-1.0-1.3.0.jar and org.apache.servicemix.specs.jaxws-api-2.1-1.1.1.jar (these are the versions we have)
    -These may or may not be bundled with CXF. IN our case, only the JAX-WS jar was included. We had to hunt down the JAX-RS bundle.
    -In addition to installing the bundles in the webapp (WEB-INF/eclipse/plugins), we also had to add them to the ECLIPSE/plugins directory for compilation.

    3) Tell Equinox to load CXF plugins. There are probably other ways to do this. We accomplished this with entries in WEB-INF/eclipse/configuration/config.ini.
    -If this file exists, add your new jars to the osgi.bundles property:
    osgi.bundles=… org.apache.servicemix.specs.jaxb-api-2.1-1.1.1.jar@start, org.apache.servicemix.specs.jaxws-api-2.1-1.1.1.jar@start, org.apache.servicemix.specs.jsr311-api-1.0-1.3.0.jar@start, \
    cxf-dosgi-ri-discovery-local-1.1.jar@5:start, \
    cxf-bundle-minimal-2.2.12.jar@5:start, \
    cxf-dosgi-ri-dsw-cxf-1.1.jar@5:start

    4) That’s it. You should now be able to start writing SOAP and REST services. This is a Java-first approach (as opposed to XML-schema first). What this means is that you:
    -Define a Java interface
    -Configure CXF to publish you interface as either REST or SOAP endpoint.

    Here’s a very simple example for REST. It comes with the standard disclaimer that it is specific to our environment. YMMV.

    a) We use declarative services, so first we define the DS file in our bundle’s manifest
    Service-Component: META-INF/ds/helloworld.xml
    b) Here is the DS file: META-INF/ds/helloworld.xml. The DS file defines the services in your OSGI bundle and their dependencies. Those entries have been omitted for brevity.

    <?xml version="1.0"?>
    <components xmlns="http://www.osgi.org/xmlns/scr/v1.0.0">
    
    <component name="hello_world_service" xmlns="http://www.osgi.org/xmlns/scr/v1.0.0">
    
       <!-- Defines this as a REST service --->
       <property name="service.exported.configs" value="org.apache.cxf.rs"/>
       <!-- This is the URI of your REST resource.  
        It is realtive to the Equinox bridge servlet in your webapp -->
       <property name="org.apache.cxf.rs.httpservice.context" value="/helloworld" /> 
       <!-- This is the java interace that will be exposed .  You
       will use JAX-RS annotations to map these java methods to HTTP verbs. -->  
       <property name="service.exported.interfaces" value="com.foo.IHelloWorldService"/>        
    ... 
    
    </components>
    

    c) Here is the interface class:

    package com.foo;
    
    @Path("/greeting")
    public Interface IHelloWorldService {
    
       @GET
       @Produces("application/xml")
       public Greeting getGreeting();
    
    }
    
    public class HelloWorldService implements IHelloWorldService {
       @override
       public Greeting getGreeting() {
          Greeting g = new Greeting();
          g.message = "Hello World";
          return g;
       }
    }
    

    d) So, once this is all in place, you should be able to GET the following URL:

       /<web-app-name>/bridge/helloworld/greeting
    

    and receive the following response:

       <Greeting>
          <message>Hello World</message>
       </Greeting>
    

    Good luck. Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I need to clean up various Word 'smart' characters in user input, including but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.