Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2995

Bus configuration ignored if Spring context has default-lazy-init=true

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2.9, 2.2.10
    • 2.2.11
    • Configuration, Core
    • None
    • Novice

    Description

      Bus configuration using the Spring namespace handler is ignored if the containing context defaults to lazy-init (default-lazy-init=true). The configuration bean definition (BusDefinitionParser$BusConfig) created by BusDefinitionParser inherits this setting. Since the bean is never explicitly referenced it does not get instantiated which would trigger the setApplicationContext method, registering the configured bus under the 'cxf' bean name. Instead, you get a bus with the default configuration.
      As a workaround, you can set the containing context to eager-init, but this is not feasible in many cases.
      I've attached a patch which includes a test case and fix in BusDefinitionParser to force the config bean to be eager-init.

      I've read a few places that Daniel Kulp mentions most CXF beans will be lazy-init in 2.3, perhaps this will be addressed then. In the meantime, this patch is working for me.

      Attachments

        1. force-eager-init.patch
          3 kB
          Adam Lewandowski

        Activity

          People

            dkulp Daniel Kulp
            alewando Adam Lewandowski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: