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

Multiple Providers from different web applications not picked up by CDI

    XMLWordPrintable

Details

    • 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.
    • 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.

      Attachments

        Activity

          People

            patriot1burke@gmail.com Bill Burke (Inactive)
            mattiasholmqvist Mattias Holmqvist (Inactive)
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: