jersey
  1. jersey
  2. JERSEY-1124

ServiceFinder not returning services in META-INF/services

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.9.1, 2.0
    • Fix Version/s: 2.0-m11, 2.0
    • Component/s: core
    • Labels:
      None

      Description

      Shouldn't the servicesUrls return when we have services defined in META-INF/services even if we have BUNDLE_VERSION defined?

      http://java.net/projects/jersey/sources/svn/content/trunk/jersey/jersey-core/src/main/java/com/sun/jersey/spi/service/ServiceFinder.java?rev=5697

      private static Enumeration<URL> filterServiceURLsWithVersion(String serviceName, Enumeration<URL> serviceUrls) {
      0217. if (BUNDLE_VERSION == null || !serviceUrls.hasMoreElements())
      0218. return serviceUrls;

        Activity

        Hide
        Pavel Bucek added a comment - - edited

        aha! This might be already fixed. I've just tried to recreate your case and noticed one (significant) difference:

        if(moduleVersion != null &&
                (!moduleVersion.equals(MODULE_VERSION_VALUE) ||
                    (symbolicName != null &&
                    (BUNDLE_SYMBOLIC_NAME.startsWith("com.sun.jersey") ^ symbolicName.startsWith("com.sun.jersey"))))) {
            return false;
        }

        (misplaced parenthesis)

        Can you please try Jersey 1.13 and verify if your issue is still valid?

        Show
        Pavel Bucek added a comment - - edited aha! This might be already fixed. I've just tried to recreate your case and noticed one (significant) difference: if (moduleVersion != null && (!moduleVersion.equals(MODULE_VERSION_VALUE) || (symbolicName != null && (BUNDLE_SYMBOLIC_NAME.startsWith( "com.sun.jersey" ) ^ symbolicName.startsWith( "com.sun.jersey" ))))) { return false ; } (misplaced parenthesis) Can you please try Jersey 1.13 and verify if your issue is still valid?
        Hide
        Pavel Bucek added a comment -

        any update?

        Show
        Pavel Bucek added a comment - any update?
        Hide
        sameerShah added a comment -

        I tried with 1.13 build but still no change.

        moduleVersion : 1.13-b01
        MODULE_VERSION_VALUE: 1.13-b01
        BUNDLE_SYMBOLIC_NAME = com.sun.jersey.jersey-core
        SymbolicName = com.abc.testBundle

        The change in the parenthesis does not help. since the if condition still resolves to true and hence the compatibleManifest function returns false.

        Show
        sameerShah added a comment - I tried with 1.13 build but still no change. moduleVersion : 1.13-b01 MODULE_VERSION_VALUE: 1.13-b01 BUNDLE_SYMBOLIC_NAME = com.sun.jersey.jersey-core SymbolicName = com.abc.testBundle The change in the parenthesis does not help. since the if condition still resolves to true and hence the compatibleManifest function returns false.
        Hide
        Michal Gajdos added a comment -

        Fixed for 1.13.

        Show
        Michal Gajdos added a comment - Fixed for 1.13.
        Hide
        Jakub Podlesak added a comment -

        This should be fixed also in 2.0 Jersey version. Mira just bumped into an issue related to the check when integrating Jersey 2.0-m10 into GF.

        Show
        Jakub Podlesak added a comment - This should be fixed also in 2.0 Jersey version. Mira just bumped into an issue related to the check when integrating Jersey 2.0-m10 into GF.

          People

          • Assignee:
            Michal Gajdos
            Reporter:
            charlesk40
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 6 hours
              6h