Details

  • User impact:
    Medium
  • Configuration:
    Hide

    <?xml version="1.0" encoding="UTF-8"?>
    <mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:task="http://www.springframework.org/schema/task"
    xmlns:spring="http://www.springframework.org/schema/beans"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd
    http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd">

    <description>Demonstration of double-registration of a scheduled task in Mule.</description>

    <spring:beans>
    <task:scheduler id="notificationScheduler"/>

    <task:scheduled-tasks scheduler="notificationScheduler">
    <task:scheduled ref="myBean" method="printSomething" fixed-rate="5000"/>
    </task:scheduled-tasks>

    <spring:bean id="myBean" class="org.mule.example.MyBean"/>

    </spring:beans>

    </mule>

    Show
    <?xml version="1.0" encoding="UTF-8"?> <mule xmlns="http://www.mulesource.org/schema/mule/core/2.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:task="http://www.springframework.org/schema/task" xmlns:spring="http://www.springframework.org/schema/beans" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd"> <description>Demonstration of double-registration of a scheduled task in Mule.</description> <spring:beans> <task:scheduler id="notificationScheduler"/> <task:scheduled-tasks scheduler="notificationScheduler"> <task:scheduled ref="myBean" method="printSomething" fixed-rate="5000"/> </task:scheduled-tasks> <spring:bean id="myBean" class="org.mule.example.MyBean"/> </spring:beans> </mule>
  • Log Output:
    Hide
    23:42:45,686 WARN org.mule.MuleServer - A configuration file was not set, using default: mule-config.xml
    23:42:45,702 INFO org.mule.MuleServer - Mule Server initializing...
    23:42:45,920 INFO org.mule.config.spring.MuleApplicationContext - Refreshing org.mule.config.spring.MuleApplicationContext@d70d7a: startup date [Mon Feb 22 23:42:45 PST 2010]; root of context hierarchy
    23:42:45,967 INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml]
    23:42:46,249 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Overriding bean definition for bean '_muleConfiguration': replacing [Generic bean: class [org.mule.config.spring.MuleConfigurationConfigurator]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=null; defined in URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml]] with [Generic bean: class [org.mule.config.spring.MuleConfigurationConfigurator]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=null; defined in URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml]]
    23:42:46,249 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Overriding bean definition for bean '_muleConfiguration': replacing [Generic bean: class [org.mule.config.spring.MuleConfigurationConfigurator]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=null; defined in URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml]] with [Generic bean: class [org.mule.config.spring.MuleConfigurationConfigurator]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=null; defined in URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml]]
    23:42:46,249 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Overriding bean definition for bean '_muleNotificationManager': replacing [Generic bean: class [org.mule.config.spring.ServerNotificationManagerConfigurator]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=null; defined in URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml]] with [Generic bean: class [org.mule.config.spring.ServerNotificationManagerConfigurator]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=null; defined in URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml]]
    23:42:46,249 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Overriding bean definition for bean '_muleNotificationManager': replacing [Generic bean: class [org.mule.config.spring.ServerNotificationManagerConfigurator]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=null; defined in URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml]] with [Generic bean: class [org.mule.config.spring.ServerNotificationManagerConfigurator]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=null; defined in URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml]]
    23:42:46,264 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Overriding bean definition for bean '_muleSystemModel': replacing [Root bean: class [org.mule.model.seda.SedaModel]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=dispose] with [Root bean: class [org.mule.model.seda.SedaModel]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=dispose]
    23:42:46,264 INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [file:/C:/dev/mule/mule-lifecycle-test/target/classes/mule-config.xml]
    23:42:46,342 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Overriding bean definition for bean 'notificationScheduler': replacing [Generic bean: class [org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Generic bean: class [org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
    23:42:46,436 WARN org.springframework.beans.factory.config.CustomEditorConfigurer - Passing PropertyEditor instances into CustomEditorConfigurer is deprecated: use PropertyEditorRegistrars or PropertyEditor class names instead. Offending key [org.mule.api.transport.Connector; offending editor instance: org.mule.config.spring.editors.ConnectorPropertyEditor@90d8ea
    23:42:46,436 WARN org.springframework.beans.factory.config.CustomEditorConfigurer - Passing PropertyEditor instances into CustomEditorConfigurer is deprecated: use PropertyEditorRegistrars or PropertyEditor class names instead. Offending key [org.mule.endpoint.URIBuilder; offending editor instance: org.mule.config.spring.editors.URIBuilderPropertyEditor@542529
    23:42:46,452 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1878144: defining beans [customEditorConfigurer,_muleObjectNameProcessor,_mulePropertyPlaceholderProcessor,_muleSimpleRegistryBootstrap,_muleNotificationManager,_muleConfiguration,._muleNotificationManager:notification.1,._muleNotificationManager:notification.2,._muleNotificationManager:notification.3,._muleNotificationManager:notification.4,._muleNotificationManager:notification.5,._muleNotificationManager:notification.6,._muleNotificationManager:notification.7,._muleNotificationManager:notification.8,._muleNotificationManager:notification.9,._muleNotificationManager:notification.10,_muleSystemModel,_muleQueueManager,_muleSecurityManager,_muleProperties,_muleEndpointFactory,_muleStreamCloserService,_defaultThreadingProfile,_defaultMessageDispatcherThreadingProfile,_defaultMessageRequesterThreadingProfile,_defaultMessageReceiverThreadingProfile,_defaultServiceThreadingProfile,_defaultRetryPolicyTemplate,notificationScheduler,org.springframework.scheduling.support.MethodInvokingRunnable#0,org.springframework.scheduling.config.ScheduledTaskRegistrar#0,.:scheduled-tasks,myBean]; root of factory hierarchy
    23:42:46,514 INFO org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler - Initializing ExecutorService 'notificationScheduler'
    23:42:46,530 INFO org.mule.example.MyBean - something
    23:42:46,530 INFO org.mule.example.MyBean - something
    23:42:46,530 INFO org.mule.config.builders.AutoConfigurationBuilder - Configured Mule using "org.mule.config.spring.SpringXmlConfigurationBuilder" with configuration resource(s): "[ConfigResource{resourceName='file:/C:/dev/mule/mule-lifecycle-test/target/classes/mule-config.xml'}]"
    23:42:46,530 INFO org.mule.config.builders.AutoConfigurationBuilder - Configured Mule using "org.mule.config.builders.AutoConfigurationBuilder" with configuration resource(s): "[ConfigResource{resourceName='file:/C:/dev/mule/mule-lifecycle-test/target/classes/mule-config.xml'}]"
    23:42:46,530 INFO org.mule.MuleServer - Mule Server starting...
    23:42:46,545 INFO org.mule.util.queue.TransactionalQueueManager - Starting ResourceManager
    23:42:46,545 INFO org.mule.util.queue.TransactionalQueueManager - Started ResourceManager
    23:42:46,561 INFO org.mule.DefaultMuleContext -
    **********************************************************************
    * Mule ESB and Integration Platform *
    * Version: 2.2.1 Build: 14422 *
    * MuleSource, Inc. *
    * For more information go to http://mule.mulesource.org *
    * *
    * Server started: 2/22/10 11:42 PM *
    * Server ID: 08499799-204f-11df-884a-85fbf2388958 *
    * JDK: 1.6.0_14 (mixed mode, sharing) *
    * OS encoding: Cp1252, Mule encoding: UTF-8 *
    * OS: Windows XP - Service Pack 3 (5.1, x86) *
    * Host: XXXXXXXXX (xxx.xxx.xx.xx) *
    * *
    * Agents Running: None *
    **********************************************************************
    23:42:51,530 INFO org.mule.example.MyBean - something
    23:42:51,530 INFO org.mule.example.MyBean - something
    23:42:56,530 INFO org.mule.example.MyBean - something
    23:42:56,530 INFO org.mule.example.MyBean - something
    23:43:01,530 INFO org.mule.example.MyBean - something
    23:43:01,530 INFO org.mule.example.MyBean - something
    23:43:06,530 INFO org.mule.example.MyBean - something
    23:43:06,530 INFO org.mule.example.MyBean - something
    23:43:11,530 INFO org.mule.example.MyBean - something
    23:43:11,530 INFO org.mule.example.MyBean - something
    Show
    23:42:45,686 WARN org.mule.MuleServer - A configuration file was not set, using default: mule-config.xml 23:42:45,702 INFO org.mule.MuleServer - Mule Server initializing... 23:42:45,920 INFO org.mule.config.spring.MuleApplicationContext - Refreshing org.mule.config.spring.MuleApplicationContext@d70d7a: startup date [Mon Feb 22 23:42:45 PST 2010]; root of context hierarchy 23:42:45,967 INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml] 23:42:46,249 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Overriding bean definition for bean '_muleConfiguration': replacing [Generic bean: class [org.mule.config.spring.MuleConfigurationConfigurator]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=null; defined in URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml]] with [Generic bean: class [org.mule.config.spring.MuleConfigurationConfigurator]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=null; defined in URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml]] 23:42:46,249 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Overriding bean definition for bean '_muleConfiguration': replacing [Generic bean: class [org.mule.config.spring.MuleConfigurationConfigurator]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=null; defined in URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml]] with [Generic bean: class [org.mule.config.spring.MuleConfigurationConfigurator]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=null; defined in URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml]] 23:42:46,249 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Overriding bean definition for bean '_muleNotificationManager': replacing [Generic bean: class [org.mule.config.spring.ServerNotificationManagerConfigurator]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=null; defined in URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml]] with [Generic bean: class [org.mule.config.spring.ServerNotificationManagerConfigurator]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=null; defined in URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml]] 23:42:46,249 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Overriding bean definition for bean '_muleNotificationManager': replacing [Generic bean: class [org.mule.config.spring.ServerNotificationManagerConfigurator]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=null; defined in URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml]] with [Generic bean: class [org.mule.config.spring.ServerNotificationManagerConfigurator]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=null; defined in URL [jar:file:/C:/m2-repo/org/mule/modules/mule-module-spring-config/2.2.1/mule-module-spring-config-2.2.1.jar!/default-mule-config.xml]] 23:42:46,264 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Overriding bean definition for bean '_muleSystemModel': replacing [Root bean: class [org.mule.model.seda.SedaModel]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=dispose] with [Root bean: class [org.mule.model.seda.SedaModel]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=initialise; destroyMethodName=dispose] 23:42:46,264 INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [file:/C:/dev/mule/mule-lifecycle-test/target/classes/mule-config.xml] 23:42:46,342 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Overriding bean definition for bean 'notificationScheduler': replacing [Generic bean: class [org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Generic bean: class [org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] 23:42:46,436 WARN org.springframework.beans.factory.config.CustomEditorConfigurer - Passing PropertyEditor instances into CustomEditorConfigurer is deprecated: use PropertyEditorRegistrars or PropertyEditor class names instead. Offending key [org.mule.api.transport.Connector; offending editor instance: org.mule.config.spring.editors.ConnectorPropertyEditor@90d8ea 23:42:46,436 WARN org.springframework.beans.factory.config.CustomEditorConfigurer - Passing PropertyEditor instances into CustomEditorConfigurer is deprecated: use PropertyEditorRegistrars or PropertyEditor class names instead. Offending key [org.mule.endpoint.URIBuilder; offending editor instance: org.mule.config.spring.editors.URIBuilderPropertyEditor@542529 23:42:46,452 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1878144: defining beans [customEditorConfigurer,_muleObjectNameProcessor,_mulePropertyPlaceholderProcessor,_muleSimpleRegistryBootstrap,_muleNotificationManager,_muleConfiguration,._muleNotificationManager:notification.1,._muleNotificationManager:notification.2,._muleNotificationManager:notification.3,._muleNotificationManager:notification.4,._muleNotificationManager:notification.5,._muleNotificationManager:notification.6,._muleNotificationManager:notification.7,._muleNotificationManager:notification.8,._muleNotificationManager:notification.9,._muleNotificationManager:notification.10,_muleSystemModel,_muleQueueManager,_muleSecurityManager,_muleProperties,_muleEndpointFactory,_muleStreamCloserService,_defaultThreadingProfile,_defaultMessageDispatcherThreadingProfile,_defaultMessageRequesterThreadingProfile,_defaultMessageReceiverThreadingProfile,_defaultServiceThreadingProfile,_defaultRetryPolicyTemplate,notificationScheduler,org.springframework.scheduling.support.MethodInvokingRunnable#0,org.springframework.scheduling.config.ScheduledTaskRegistrar#0,.:scheduled-tasks,myBean]; root of factory hierarchy 23:42:46,514 INFO org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler - Initializing ExecutorService 'notificationScheduler' 23:42:46,530 INFO org.mule.example.MyBean - something 23:42:46,530 INFO org.mule.example.MyBean - something 23:42:46,530 INFO org.mule.config.builders.AutoConfigurationBuilder - Configured Mule using "org.mule.config.spring.SpringXmlConfigurationBuilder" with configuration resource(s): "[ConfigResource{resourceName='file:/C:/dev/mule/mule-lifecycle-test/target/classes/mule-config.xml'}]" 23:42:46,530 INFO org.mule.config.builders.AutoConfigurationBuilder - Configured Mule using "org.mule.config.builders.AutoConfigurationBuilder" with configuration resource(s): "[ConfigResource{resourceName='file:/C:/dev/mule/mule-lifecycle-test/target/classes/mule-config.xml'}]" 23:42:46,530 INFO org.mule.MuleServer - Mule Server starting... 23:42:46,545 INFO org.mule.util.queue.TransactionalQueueManager - Starting ResourceManager 23:42:46,545 INFO org.mule.util.queue.TransactionalQueueManager - Started ResourceManager 23:42:46,561 INFO org.mule.DefaultMuleContext - ********************************************************************** * Mule ESB and Integration Platform * * Version: 2.2.1 Build: 14422 * * MuleSource, Inc. * * For more information go to http://mule.mulesource.org * * * * Server started: 2/22/10 11:42 PM * * Server ID: 08499799-204f-11df-884a-85fbf2388958 * * JDK: 1.6.0_14 (mixed mode, sharing) * * OS encoding: Cp1252, Mule encoding: UTF-8 * * OS: Windows XP - Service Pack 3 (5.1, x86) * * Host: XXXXXXXXX (xxx.xxx.xx.xx) * * * * Agents Running: None * ********************************************************************** 23:42:51,530 INFO org.mule.example.MyBean - something 23:42:51,530 INFO org.mule.example.MyBean - something 23:42:56,530 INFO org.mule.example.MyBean - something 23:42:56,530 INFO org.mule.example.MyBean - something 23:43:01,530 INFO org.mule.example.MyBean - something 23:43:01,530 INFO org.mule.example.MyBean - something 23:43:06,530 INFO org.mule.example.MyBean - something 23:43:06,530 INFO org.mule.example.MyBean - something 23:43:11,530 INFO org.mule.example.MyBean - something 23:43:11,530 INFO org.mule.example.MyBean - something
  • Similar Issues:
    None

Description

Mule registers each bean from a custom namespace in MuleHierarchicalBeanDefinitionParserDelegate.parseCustomElement(), even though this is redundant with the registered Spring NamespaceHandler. Normally this does not cause a problem because Mule's registration simply replaces the original registration from Spring. However, when Spring derives the bean's name from something other than a "name" or "id" attribute, Mule ends up creating a second bean definition entry.

I've encountered several examples in the past two months.
1. With Spring's <context:load-time-weaver/>, resulting in attempted double-weaving of various aspects.
2. Spring's builtin <task:scheduled-tasks/>, resulting in double-execution of my scheduled task.
3. With ActiveMQ <amq:broker/>, resulting in the creation of two brokers and TCP port conflicts. (Fortunately this one allows an "id", so adding it worked around the bug.)

My gut response to the issue is to question why Mule needs to re-register the custom bean definitions in the first place. But I'm not a Mule developer, and I'm sure there's a very good reason.

My second thought was to have Mule use the same name generation algorithm as Spring so its registration replaces Spring's instead of duplicating it. Discovery of Spring's BeanNameGenerator interface, which is a property of the XmlReaderContext, made this look encouraging. Even this isn't fool-proof, however, as evident in AbstractBeanDefinitionParser; each custom definition parser has total control over what definitions and alias are added to the context's registry. Consider <task:scheduled-tasks/> which has shouldGenerateId of true and hence always defers to the BeanNameGenerator, compared to other AbstractBeanDefinitionParsers which first look to the "id" attribute before maybe deferring to BeanNameGenerator based on shouldGenerateIdAsFallback.

I lack the expertise to know what the right solution is, but there's definitely a whole class of custom Spring elements that are incompatible with Mule in whole or in part.

I tested extensively in 2.2.1, and verified that nothing significant has changed in 3.0.0-M1.

Activity

Hide
Daniel Retzlaff added a comment -
Show
Daniel Retzlaff added a comment - A related issue: http://www.mulesoft.org/jira/browse/MULE-2795

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: