Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-829

CDI doesn't work in client framework

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • 3.0-beta-5
    • 3.0-beta-1
    • None
    • None

    Description

      In resteasy-cdi-ejb-test, I've got a test that looks at the interaction of
      decorators, interceptors, interceptor decorators, etc. Each of these
      leaves a record of its execution, and the test does three things:

      1) uploads an entity,
      2) retrieves the entity, and
      3) calls a resource test method that compares the actual sequence of
      provider executions with the expected sequence.

      The entity I'm sending back and forth is a JAXB Book class which is read by

      @Provider
      @Consumes(Constants.MEDIA_TYPE_TEST_XML)
      public class BookReader implements MessageBodyReader<Book>
      {
      ...
      @Inject private Logger log;
      ...

      The test is failing because, in the old Resteasy client framework, the
      second step leads to some decorator, etc., executions on the client side
      when BookReader.readFrom() is called, while, in the new framework, that
      isn't happening. The reason for the different behavior is that CDI is not acting
      on the client side. In particular, the ResteasyProviderFactory in the
      client framework is using the default ConstructorInjector and the server
      side is using CdiConstructorInjector.

      Attachments

        Activity

          People

            patriot1burke@gmail.com Bill Burke (Inactive)
            rsigal@redhat.com Ronald Sigal
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: