hk2
  1. hk2
  2. HK2-67

Handle @ContractProvided annotation

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.*
    • Fix Version/s: 2.1.*
    • Component/s: None
    • Labels:
      None

      Description

      More than 190 connector devtests are failing. Looks like @ContractProvided is not handled by the new hk2 (as analyzed by Jagadish)

      <quote>
      I was looking at the failure. It seems to be due to unavailability of a
      HK2 Service
      "com.sun.enterprise.security.jmac.callback.ContainerCallbackHandler"
      that implements a Java SE API
      javax.security.auth.callback.CallbackHandler

      The class declaration is :
      @Service
      @ContractProvided(CallbackHandler.class)
      public final class ContainerCallbackHandler
      implements CallbackHandler, CallbackHandlerConfig {

      When I try accessing it via
      "habitat.getAllByContract(ContainerCallbackHandler.class)", it returns
      null.
      If I do
      "habitat.getAllByContract(javax.security.auth.callback.CallbackHandler.class), the service is found.
      </quote>

        Activity

        Hide
        jwells added a comment -

        So @ContractProvided is replaced by @ContractsProvided. I am searching now for anyone else who has @ContractProvided

        Show
        jwells added a comment - So @ContractProvided is replaced by @ContractsProvided. I am searching now for anyone else who has @ContractProvided
        Hide
        jwells added a comment -

        Also, the file you are talking about (ContainerCallbackHandler) already has @ContractsProvided. So, I don't exactly understand what you are seeing?

        Show
        jwells added a comment - Also, the file you are talking about (ContainerCallbackHandler) already has @ContractsProvided. So, I don't exactly understand what you are seeing?
        Hide
        jwells added a comment -

        Nevermind, I see the issue. One of the features of ContractsProvided is that it allows for multiple contracts to be provided. AND the only things added as contracts are what is there in the @ContractsProvided. And so all I need to do here is add in the Impl class as well.

        Show
        jwells added a comment - Nevermind, I see the issue. One of the features of ContractsProvided is that it allows for multiple contracts to be provided. AND the only things added as contracts are what is there in the @ContractsProvided. And so all I need to do here is add in the Impl class as well.
        Hide
        jwells added a comment -

        This one is fixed in GlassFish by adding the Impl and the Interface to @ContractsProvided

        Show
        jwells added a comment - This one is fixed in GlassFish by adding the Impl and the Interface to @ContractsProvided

          People

          • Assignee:
            jwells
            Reporter:
            Mahesh Kannan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: