Geronimo
  1. Geronimo
  2. GERONIMO-5090 Upgrade from java ee 5 to java ee 6 support
  3. GERONIMO-5178

Inconsistent handling of META-INF/services files by different Geronmo specs.

    Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0-M1
    • Component/s: osgi
    • Security Level: public (Regular issues)
    • Labels:
      None

      Description

      A number of the Geronimo specs use the provider resolution pattern defined by the ServiceLoader class in Java 6 to resolve different provider classes. In this pattern, a file with a given class name in the META-INF/services directory can define one or more provider classes for a given source interface name. As implemented by the ServiceLoader class, these files can contain multiple lines with pure comment lines and line comments on lines that define classes, as well as multiple providers defined per file. Thus a file like this would be considered valiid:

      1. A set of provider classes for the blah.blah interface
        org.apache.geronimo.foo.BlahImpl # The default first one
        org.apache.geronimo.bar.BlahImpl # The secondary fall back.

      The different spec projects that use these files parse them under different assumptions:

      • Some unilaterally take the first line without any comment processing at all or recognition that there might be multiple providers defined per file.
      • Some projects allow for pure comment lines but don't parse for comments on a definition line.
      • Not all projects are opening these files assuming a utf-8 encoding.

      This could best be solved by refactoring the code to use some common methods. This refactoring will also allow OSGi-awareness to be added to the service file lookups.

        Activity

        Rick McGuire created issue -
        Rick McGuire made changes -
        Field Original Value New Value
        Parent GERONIMO-5090 [ 12455036 ]
        Issue Type Bug [ 1 ] Sub-task [ 7 ]
        David Jencks made changes -
        Component/s osgi [ 12313090 ]
        Rick McGuire made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Rick McGuire made changes -
        Fix Version/s 3.0 [ 12314206 ]
        Fix Version/s 3.0-M1 [ 12315090 ]
        Rick McGuire made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Rick McGuire
            Reporter:
            Rick McGuire
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development