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

Multiple Providers from different web applications not picked up by CDI

    Details

    • Steps to Reproduce:
      Hide

      Reproducer project is available from:
      https://github.com/mattiasholmqvist/jboss-jaxrs-provider-test

      To reproduce:
      1. Run: mvn clean install jboss-as:deploy
      2. Go to http://localhost:<port>/first
      3. Go to http://localhost:<port>/second/USD

      In step 3, instead of picking up the StringConverter in the second resource module, it fails.

      Show
      Reproducer project is available from: https://github.com/mattiasholmqvist/jboss-jaxrs-provider-test To reproduce: 1. Run: mvn clean install jboss-as:deploy 2. Go to http://localhost: <port>/first 3. Go to http://localhost: <port>/second/USD In step 3, instead of picking up the StringConverter in the second resource module, it fails.
    • Workaround Description:
      Hide

      It looks like it's possible to put all the @Provider-classes in the same module so that they all get picked up by the initialization. This is however not a viable option for us.

      Show
      It looks like it's possible to put all the @Provider-classes in the same module so that they all get picked up by the initialization. This is however not a viable option for us.

      Description

      When using two applications (WARs) in the same JBoss, RestEASY only picks up the @Provider-classes for the application that gets initialized first.

      I have a suggested fix for the issue at:
      https://github.com/mattiasholmqvist/Resteasy/tree/2.3.3-cdi-provider-patch

      Where the CdiInjectorFactory uses the newly created InjectorFactory from the ResteasyProviderFactory (which is in turn created in ResteasyDeployment) instead of using getInstance() in the constructor. This fixes the issue in our setup.

      If this looks reasonable to you I can create a pull request from the branch.

      PS. I tried to create a discussion thread first but I couldn't get access to RestEasy discussion forums for some reason. DS.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            mattiasholmqvist Mattias Holmqvist added a comment -

            Ron,
            Yes. Since we wanted it to be fixed without waiting for the next major release. The guess was that branch 2_3 was the place to fix it. Bill WDYT?

            Bill,
            Np. Thanks for the information. Do you have a timeline for 2.3.5 and when it is possible to get a patched EAP version of JBoss?

            Thanks guys

            Show
            mattiasholmqvist Mattias Holmqvist added a comment - Ron, Yes. Since we wanted it to be fixed without waiting for the next major release. The guess was that branch 2_3 was the place to fix it. Bill WDYT? Bill, Np. Thanks for the information. Do you have a timeline for 2.3.5 and when it is possible to get a patched EAP version of JBoss? Thanks guys
            Hide
            bill.burke Bill Burke added a comment -

            reassigned to me.

            Show
            bill.burke Bill Burke added a comment - reassigned to me.
            Hide
            bill.burke Bill Burke added a comment -

            comitted.

            Show
            bill.burke Bill Burke added a comment - comitted.
            Hide
            mattiasholmqvist Mattias Holmqvist added a comment -

            Thanks. Although it would have been nice to have seen my pull request merged in instead. :/

            Show
            mattiasholmqvist Mattias Holmqvist added a comment - Thanks. Although it would have been nice to have seen my pull request merged in instead. :/
            Hide
            bill.burke Bill Burke added a comment -

            Sorry about your pull request, but I think its better if the whole ResteasyProviderFactory is passed as a parameter to the constructor as other InjectorFactory impls might need additional metadata.

            Show
            bill.burke Bill Burke added a comment - Sorry about your pull request, but I think its better if the whole ResteasyProviderFactory is passed as a parameter to the constructor as other InjectorFactory impls might need additional metadata.

              People

              • Assignee:
                bill.burke Bill Burke
                Reporter:
                mattiasholmqvist Mattias Holmqvist
              • Votes:
                4 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Development