Skip to content

Restlet 2.2.0 M3 - OSGI Equinox 3.8.2 - Jetty 8.1.5 Issues #756

@alhaddad-nasry

Description

@alhaddad-nasry

The below issues (with fixes) prevent Restlet 2.2 M3 from running in OSGI environment when using Service Components through org.restlet.ext.osgi library.

  1. org.restlet.ext.servlet:
    The last commit for this library added OSGI-INF folder which contains restlet.xml, due to Issue org.restlet.ext.servlet is missing OSGI-INF in OSGi edition #749. However, two more fixes are required:
    • The manifest of org.restlet.ext.servlet should contain the following line:
      Service-Component: OSGI-INF/restlet.xml
    • restlet.xml contains some wrong data:
      <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.restlet.ext.osgi.servlet">

      <implementation class="org.restlet.ext.osgi.servlet.RestletServletService"/>

      These should be replaced with the following:
      <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.restlet.ext.servlet">

      <implementation class="org.restlet.ext.servlet.RestletServletService"/>
  2. It didn't work with the org.eclipse.jetty v_8.1.5 jar files provided with the Restlet distribution. Neither with the org.eclipse.jetty v_8.1.3 jar files provided by Equinox distribution.
    The following error was logged on OSGI console:
!ENTRY org.eclipse.equinox.ds 4 0 2013-05-27 02:31:21.037
!MESSAGE Could not bind a reference of component org.restlet.ext.servlet.
The reference is: Reference[name = HttpService, interface = org.osgi.service.http.HttpService, policy = dynamic, cardinality = 0..1, target = null, bind = bindHttpService, unbind = unbindHttpService]

Had to download Jetty 8.1.5 from http://archive.eclipse.org/jetty/8.1.5.v20120716/dist/
and use the jar files provided by that distribution. (Added more jar files from this distribution than those provided with the Restlet distribution)

The resulting OSGI bundles:

id  State       Bundle
0   ACTIVE      org.eclipse.osgi_3.8.2.v20130124-134944
1   ACTIVE      LogBackend_1.0.0
2   ACTIVE      org.eclipse.equinox.util_1.0.400.v20120917-192807
3   ACTIVE      org.eclipse.equinox.ds_1.4.1.v20120926-201320
5   ACTIVE      org.eclipse.equinox.log_1.2.300.v20120912-130548
6   ACTIVE      org.restlet.ext.slf4j_2.2.0.m3-v20130307-1155
7   ACTIVE      org.apache.felix.gogo.command_0.8.0.v201108120515
10  ACTIVE      org.eclipse.equinox.io_1.0.400.v20120917-192807
11  ACTIVE      org.eclipse.osgi.services_3.3.100.v20120522-1822
12  ACTIVE      org.eclipse.equinox.cm_1.0.400.v20120522-1841
16  ACTIVE      org.restlet.ext.json_2.2.0.m3-v20130307-1155
17  ACTIVE      org.restlet_2.2.0.m3-v20130307-1155
24  ACTIVE      org.json_1.0.0.qualifier
25  ACTIVE      org.restlet.ext.jetty_2.2.0.m3-v20130307-1155
26  ACTIVE      org.restlet.example_1.0.0.qualifier
27  ACTIVE      org.apache.felix.gogo.shell_0.8.0.v201110170705
28  ACTIVE      org.eclipse.equinox.console_1.0.0.v20120522-1841
30  ACTIVE      org.apache.felix.gogo.runtime_0.8.0.v201108120515
32  ACTIVE      javax.servlet_3.0.0.v201112011016
33  ACTIVE      org.apache.felix.fileinstall_3.2.4
34  ACTIVE      ch.qos.logback.core_1.0.10
35  ACTIVE      org.slf4j.impl_1.0.0.201303291631
36  ACTIVE      slf4j.api_1.5.6
52  ACTIVE      org.eclipse.equinox.http.servlet_1.1.300.v20120912-130548
64  ACTIVE      org.restlet.ext.osgi_2.2.0.m3-v20130307-1155
65  ACTIVE      org.eclipse.equinox.http.registry_1.1.200.v20120912-130548
66  ACTIVE      org.eclipse.equinox.common_3.6.100.v20120522-1841
67  ACTIVE      org.eclipse.equinox.http.servletbridge_1.0.300.v20120912-130548
68  ACTIVE      org.eclipse.equinox.servletbridge_1.2.200.v20120912-130548
69  ACTIVE      org.eclipse.equinox.registry_3.5.200.v20120522-1841
71  ACTIVE      org.restlet.ext.servlet_2.2.0.m3-v20130307-1155
78  ACTIVE      org.eclipse.jetty.continuation_8.1.5.v20120716
79  ACTIVE      org.eclipse.jetty.servlets_8.1.5.v20120716
82  ACTIVE      org.eclipse.jetty.server_8.1.5.v20120716
83  ACTIVE      org.eclipse.jetty.servlet_8.1.5.v20120716
84  ACTIVE      org.eclipse.jetty.http_8.1.5.v20120716
85  ACTIVE      org.eclipse.jetty.security_8.1.5.v20120716
86  ACTIVE      org.eclipse.jetty.io_8.1.5.v20120716
87  ACTIVE      org.eclipse.jetty.xml_8.1.5.v20120716
89  ACTIVE      org.eclipse.jetty.client_8.1.5.v20120716
90  ACTIVE      org.eclipse.jetty.ajp_8.1.5.v20120716
91  ACTIVE      org.eclipse.jetty.util_8.1.5.v20120716
92  ACTIVE      org.eclipse.equinox.http.jetty_3.0.1.v20121109-203239

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions