Uploaded image for project: 'Aries'
  1. Aries
  2. ARIES-1938

Can't register service as java.lang.Object

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: blueprint-core-1.10.2
    • Fix Version/s: None
    • Component/s: Blueprint
    • Labels:
      None

      Description

      Trying to register a service in the blueprint xml under the interface name "java.lang.Object" results in an error, but according to the spec this should work.

      Specifically, from my understanding of the osgi core spec (section 5.2.3) is should be calling Class.isInstance  on each specified class to check if the service class is indeed an instance of it (and also mentions explicitly this can be a class, not just an interface).

      However, the blueprint code in ServiceRecipe doesn't do this, but instead tries to collect all superclasses and interfaces of the service object. To do this, it uses ReflectionUtils.getSuperClasses(), which does not return Object as a superclass.

      This may be a bug in getSuperClasses, but might as well be changed to do what the spec says directly instead, which looks more performant as well.

      btw, the real-world use case I came across is pax web whiteboard requiring a service to be registered under java.lang.Object, which doesn't work with blueprint.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              amichai Amichai Rothman
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: