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

resteasy-spring is too restrictive when dealing with @Configuration factory beans

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Out of Date
    • Affects Version/s: 2.3.4.Final
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Workaround Description:
      Hide

      Use public methods only in @Configuration classes.

      Show
      Use public methods only in @Configuration classes.
    • Estimated Difficulty:
      Low

      Description

      The SpringBeanProcessor was updated in RESTEASY-511 / RESTEASY-679 to better support Spring 3.1 @Configuration classes. However, while Spring makes no requirements on the visibility of methods in these classes, the bean processor is only looking for public methods.

      Please see line 399 of org.jboss.resteasy.plugins.spring.SpringBeanProcessor.java

      The current implementation uses getBeanClass(factoryClassName).getMethods(). This should probably be something more sophisticated, maybe utilizing Spring's own code like org.springframework.util.ReflectionUtils#getAllDeclaredMethods.

      The workaround is obviously to set all declared methods in @Configuration classes to be public.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              patriot1burke@gmail.com Bill Burke (Inactive)
              Reporter:
              bfagin Ben Fagin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: