Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-27850

CDI validation fails for MicroProfile Rest Client bean injection

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Explained
    • 4.19.0.Final
    • 4.19.1.Final
    • cdi
    • None
    • Hide

      1. Register a rest client interface with `@RegisterRestClient`:

      import org.eclipse.microprofile.rest.client.annotation.RegisterProvider;
      @RegisterRestClient(baseUri = "https://rest.server.com")
      public interface RestServiceClient {
          // methods...
      }
      

      2. Inject it in any CDI bean:

      @Inject
      @RestClient
      private RestServiceClient restClient;
      
      Show
      1. Register a rest client interface with `@RegisterRestClient`: import org.eclipse.microprofile. rest .client.annotation.RegisterProvider; @RegisterRestClient(baseUri = "https: // rest .server.com" ) public interface RestServiceClient { // methods... } 2. Inject it in any CDI bean: @Inject @RestClient private RestServiceClient restClient;

    Description

      CDI validation shows warning "No bean is eligible for injection to the injection point [JSR-365 ยง5.2.2]" for MicroProfile Rest Client.

      Attachments

        Activity

          People

            jmaury@redhat.com Jeff MAURY
            ceweiler Claudio Weiler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: