Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6369

org.apache.cxf.jaxrs.impl.ConfigurationImpl does not comply with SPEC

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.3, 3.0.4, 2.7.15
    • Fix Version/s: 3.1, 3.0.5
    • Component/s: JAX-RS
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      According to http://docs.oracle.com/javaee/7/api/javax/ws/rs/core/Configurable.html

      As a general rule, for each JAX-RS component class there can be at most one registration — class-based or instance-based — configured at any given moment. Implementations MUST reject any attempts to configure a new registration for a provider class that has been already registered in the given configurable context earlier. Implementations SHOULD also raise a warning to inform the user about the rejected component registration.

      For example:

      config.register(GzipInterceptor.class, WriterInterceptor.class);
      config.register(GzipInterceptor.class); // Rejected by runtime.
      config.register(new GzipInterceptor()); // Rejected by runtime.
      config.register(GzipInterceptor.class, 6500); // Rejected by runtime.

      So we need to check whether the same class's instances have already been put into config before hand.

      Also to check whether the class/instance has been registered via public boolean isRegistered(Class<?> cls) , we need to check whether the two class is the same other than just isAssignableFrom.

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              irisding Iris Ding
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: