JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-6174

App fails to start when defining a choice exception strategy in configuration element

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 3.3 RC3
  • Fix Version/s: 3.3 RC4
  • Component/s: Core: Exception Handling
  • Labels:
    • exception-strategy
  • Environment:

    Mac OS

  • User impact:
    High
  • Configuration:
    Hide
    <?xml version="1.0" encoding="UTF-8"?>
    
    <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http"
        xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
        xmlns:spring="http://www.springframework.org/schema/beans" xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.2.1"
        xmlns:test="http://www.mulesoft.org/schema/mule/test"
        xsi:schemaLocation="
    http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.3/mule-http.xsd 
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.3/mule.xsd
    http://www.mulesoft.org/schema/mule/test http://www.mulesoft.org/schema/mule/test/3.3/mule-test.xsd 
    http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.3/mule-vm.xsd ">
    
        <choice-exception-strategy name="logging-choice-exception-strategy">
             <catch-exception-strategy when="java.lang.RuntimeException">
                <logger message="RUNTIME EXCEPTION"/>
             </catch-exception-strategy>
             <catch-exception-strategy when="java.lang.IllegalArgumentException">
                <logger message="ILLEGAL ARGUMENT EXCEPTION"/>
             </catch-exception-strategy>
        </choice-exception-strategy>
    
        <configuration defaultExceptionStrategy-ref="logging-choice-exception-strategy"/>
    
        <flow name="runtime-exception-strategy">
            <http:inbound-endpoint exchange-pattern="request-response"
                host="localhost" port="8084" doc:name="HTTP" />
            <logger />
            <test:component  throwException="true"  exceptionToThrow="java.lang.RuntimeException"/>
        </flow>    
            <flow name="illegal-argument-exception-strategy">
            <http:inbound-endpoint exchange-pattern="request-response"
                host="localhost" port="8085" doc:name="HTTP" />
            <logger />
            <test:component  throwException="true"  exceptionToThrow="java.lang.IllegalArgumentException"/>
        </flow>    
    </mule>
    Show
    <?xml version="1.0" encoding="UTF-8"?>
    
    <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http"
        xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
        xmlns:spring="http://www.springframework.org/schema/beans" xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.2.1"
        xmlns:test="http://www.mulesoft.org/schema/mule/test"
        xsi:schemaLocation="
    http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.3/mule-http.xsd 
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.3/mule.xsd
    http://www.mulesoft.org/schema/mule/test http://www.mulesoft.org/schema/mule/test/3.3/mule-test.xsd 
    http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.3/mule-vm.xsd ">
    
        <choice-exception-strategy name="logging-choice-exception-strategy">
             <catch-exception-strategy when="java.lang.RuntimeException">
                <logger message="RUNTIME EXCEPTION"/>
             </catch-exception-strategy>
             <catch-exception-strategy when="java.lang.IllegalArgumentException">
                <logger message="ILLEGAL ARGUMENT EXCEPTION"/>
             </catch-exception-strategy>
        </choice-exception-strategy>
    
        <configuration defaultExceptionStrategy-ref="logging-choice-exception-strategy"/>
    
        <flow name="runtime-exception-strategy">
            <http:inbound-endpoint exchange-pattern="request-response"
                host="localhost" port="8084" doc:name="HTTP" />
            <logger />
            <test:component  throwException="true"  exceptionToThrow="java.lang.RuntimeException"/>
        </flow>    
            <flow name="illegal-argument-exception-strategy">
            <http:inbound-endpoint exchange-pattern="request-response"
                host="localhost" port="8085" doc:name="HTTP" />
            <logger />
            <test:component  throwException="true"  exceptionToThrow="java.lang.IllegalArgumentException"/>
        </flow>    
    </mule>
  • Similar Issues:
    None

Description

When trying to define a default exception strategy referencing a choice exception strategy from the configuration element apps fails to start with this stack trace:

org.mule.module.launcher.DeploymentInitException: BeanCurrentlyInCreationException: Error creating bean with name 'logging-choice-exception-strategy': Requested bean is currently in creation: Is there an unresolvable circular reference?
	at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:220)
	at org.mule.module.launcher.application.ApplicationWrapper.init(ApplicationWrapper.java:64)
	at org.mule.module.launcher.DefaultMuleDeployer.deploy(DefaultMuleDeployer.java:46)
	at org.mule.module.launcher.DeploymentService.guardedDeploy(DeploymentService.java:381)
	at org.mule.module.launcher.DeploymentService.start(DeploymentService.java:179)
	at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:157)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.mule.module.reboot.MuleContainerWrapper.start(MuleContainerWrapper.java:56)
	at org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:3925)
Caused by: org.mule.api.config.ConfigurationException: Error creating bean with name '_muleConfiguration': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logging-choice-exception-strategy': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'logging-choice-exception-strategy': Requested bean is currently in creation: Is there an unresolvable circular reference? (org.mule.api.lifecycle.InitialisationException) (org.mule.api.config.ConfigurationException)
	at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:52)
	at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
	at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:80)
	at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:208)
	... 11 more
Caused by: org.mule.api.config.ConfigurationException: Error creating bean with name '_muleConfiguration': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logging-choice-exception-strategy': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'logging-choice-exception-strategy': Requested bean is currently in creation: Is there an unresolvable circular reference? (org.mule.api.lifecycle.InitialisationException)
	at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:52)
	at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
	at org.mule.config.builders.AutoConfigurationBuilder.autoConfigure(AutoConfigurationBuilder.java:101)
	at org.mule.config.builders.AutoConfigurationBuilder.doConfigure(AutoConfigurationBuilder.java:57)
	at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46)
	... 14 more
Caused by: org.mule.api.lifecycle.InitialisationException: Error creating bean with name '_muleConfiguration': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logging-choice-exception-strategy': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'logging-choice-exception-strategy': Requested bean is currently in creation: Is there an unresolvable circular reference?
	at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:117)
	at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:116)
	at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:73)
	at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46)
	... 18 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_muleConfiguration': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logging-choice-exception-strategy': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'logging-choice-exception-strategy': Requested bean is currently in creation: Is there an unresolvable circular reference?
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1441)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:248)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:581)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
	at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:89)
	at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:109)
	... 21 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logging-choice-exception-strategy': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'logging-choice-exception-strategy': Requested bean is currently in creation: Is there an unresolvable circular reference?
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:313)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1093)
	at org.mule.config.spring.SpringRegistry.lookupObject(SpringRegistry.java:143)
	at org.mule.registry.AbstractRegistryBroker.lookupObject(AbstractRegistryBroker.java:124)
	at org.mule.registry.MuleRegistryHelper.lookupObject(MuleRegistryHelper.java:677)
	at org.mule.config.spring.MuleConfigurationConfigurator.validateDefaultExceptionStrategy(MuleConfigurationConfigurator.java:86)
	at org.mule.config.spring.MuleConfigurationConfigurator.getObject(MuleConfigurationConfigurator.java:72)
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
	... 30 more
Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'logging-choice-exception-strategy': Requested bean is currently in creation: Is there an unresolvable circular reference?
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:255)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1093)
	at org.mule.config.spring.SpringRegistry.lookupObject(SpringRegistry.java:143)
	at org.mule.registry.AbstractRegistryBroker.lookupObject(AbstractRegistryBroker.java:124)
	at org.mule.registry.MuleRegistryHelper.lookupObject(MuleRegistryHelper.java:677)
	at org.mule.DefaultMuleContext.getDefaultExceptionStrategy(DefaultMuleContext.java:778)
	at org.mule.exception.ChoiceMessagingExceptionStrategy.addDefaultExceptionStrategyIfRequired(ChoiceMessagingExceptionStrategy.java:72)
	at org.mule.exception.ChoiceMessagingExceptionStrategy.initialise(ChoiceMessagingExceptionStrategy.java:63)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1581)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
	... 41 more
INFO  2012-04-19 15:38:05,257 [WrapperListener_start_runner] org.mule.module.launcher.StartupSummaryDeploymentListener:

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
Hide
Permalink
Pablo La Greca added a comment - 23/Apr/12 05:21 PM

The problem is that choice-exception-strategy use the default one as last exception strategy if there's no catch all exception strategy configured (es with empty when). So there's a cyclic reference because is trying to set it self as last exception strategy.

Fix it to show a nice message failing at start in that case.

Show
Pablo La Greca added a comment - 23/Apr/12 05:21 PM The problem is that choice-exception-strategy use the default one as last exception strategy if there's no catch all exception strategy configured (es with empty when). So there's a cyclic reference because is trying to set it self as last exception strategy. Fix it to show a nice message failing at start in that case.
Hide
Permalink
Pablo La Greca added a comment - 23/Apr/12 05:24 PM - edited

Mule 3.3.x : https://fisheye.codehaus.org/changelog/mule/?cs=24340
Mule 3.3.0-RC4: https://fisheye.codehaus.org/changelog/mule/?cs=24342
Mule 3.x: https://fisheye.codehaus.org/changelog/mule/?cs=24344

Show
Pablo La Greca added a comment - 23/Apr/12 05:24 PM - edited Mule 3.3.x : https://fisheye.codehaus.org/changelog/mule/?cs=24340 Mule 3.3.0-RC4: https://fisheye.codehaus.org/changelog/mule/?cs=24342 Mule 3.x: https://fisheye.codehaus.org/changelog/mule/?cs=24344

People

  • Assignee:
    Pablo La Greca
    Reporter:
    Alejandro Sequeira
Vote (0)
Watch (0)

Dates

  • Created:
    19/Apr/12 01:46 PM
    Updated:
    24/Apr/12 12:46 PM
    Resolved:
    24/Apr/12 12:46 PM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.