Mule
  1. Mule
  2. MULE-5200

Mule parser can't handle references to Spring beans in parent context

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.0
    • Fix Version/s: Product Backlog
    • Component/s: Core: Configuration
    • Labels:
      None
    • User impact:
      Medium
    • Similar Issues:
      MULE-5196Ambiguous bean naming causes spurious errors with parent bean context
      MULE-4089Better documentation for Mule Bean Definition Parser framework
      MULE-5375spring mule bean definition parsers should leave alone attributes named "xml..."
      MULE-2060<mule:component> should ideally be able to reference a standard Spring Factory bean
      MULE-2221Check for Mule parent element
      MULE-659Mule With existing Spring
      MULE-955Spring container
      MULE-2062Mule extensions to spring cause the parsing/instantiation of some spring beans to fail
      MULE-5804Expose FtpConnectionFactory implementation as Spring bean
      MULE-647Add Spring ApplicationEvent support to Mule

      Description

      The gist of that question is I couldn't get the custom-security-provider to pick up the Spring Security authentication manager that is defined in the parent context of a "Spring-first" context configuration. I think I've found that it's an impossible configuration.

      Because the BeanDefinitionBuilder doesn't have access to the parent WebApplicationContext, it seems the bean would have to be defined as lazy so it's not resolved until after the BeanDefinitionReader is done.

      But there's no way to set the lazy flag on the custom-security-provider, so it seems like it won't work.

      Maybe it's a bad idea to use this "Spring first" pattern. I initially liked it because there's a clean separation between the Mule and Spring contexts, which would hopefully make it easier to separate later.

      For what it's worth, CXF has no problem picking up parent context beans in a similar configuration.

        Issue Links

          Activity

          Brian Topping created issue -
          Dirk Olmes made changes -
          Field Original Value New Value
          Issue Type Bug [ 1 ] Improvement [ 4 ]
          Dirk Olmes made changes -
          Fix Version/s Product Backlog [ 10440 ]
          Priority To be reviewed [ 6 ] Major [ 3 ]
          Hide
          Brian Topping added a comment -

          I think this can be closed or changed to a documentation issue. I should have been using the mule-module-spring-security and wasn't. After doing so, and in combination with MULE-5225, I was able to use the following configuration:

              <ss:security-manager>
                  <ss:delegate-security-provider name="muleAuthenticationManager" delegate-ref="authenticationManager"/>
              </ss:security-manager>
          
          Show
          Brian Topping added a comment - I think this can be closed or changed to a documentation issue. I should have been using the mule-module-spring-security and wasn't. After doing so, and in combination with MULE-5225 , I was able to use the following configuration: <ss:security-manager> <ss:delegate-security-provider name= "muleAuthenticationManager" delegate-ref= "authenticationManager" /> </ss:security-manager>
          Dirk Olmes made changes -
          Link This issue is blocked by MULE-5225 [ MULE-5225 ]
          Ramiro Rinaudo made changes -
          Workflow Fixed Main Mule Workflow (after JIRA upgrade) [ 78450 ] Main Mule Workflow v1.0 [ 136271 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Brian Topping
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Development