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-6225

Object in mule's registry cannot be cast to org.mule.construct.AbstractFlowConstruct on application startup

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

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 3.2.1
  • Fix Version/s: None
  • Component/s: Core: (other)
  • Labels:
    None
  • User impact:
    Medium
  • Configuration:
    Hide

    <notifications>
    <notification event="CONTEXT"/>
    <notification-listener ref="Initializer"/>
    </notifications>
    <spring:beans>
    <spring:bean id="Initializer" name="Initializer" class="com.company.test.sorter.Initializer" doc:name="Bean"/>
    </spring:beans>

    Show
    <notifications> <notification event="CONTEXT"/> <notification-listener ref="Initializer"/> </notifications> <spring:beans> <spring:bean id="Initializer" name="Initializer" class="com.company.test.sorter.Initializer" doc:name="Bean"/> </spring:beans>
  • Log Output:
    Hide
    + Failed to deploy app 'number-sorter', see below +
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
        org.mule.module.launcher.DeploymentException: Failed to deploy application [number-sorter]
        at org.mule.module.launcher.DefaultMuleDeployer.deploy(DefaultMuleDeployer.java:68)
        at org.mule.module.launcher.DeploymentService.start(DeploymentService.java:175)
        at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:157)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.mule.module.reboot.MuleContainerWrapper.start(MuleContainerWrapper.java:56)
        at org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:2788)
    Caused by: org.mule.api.MuleRuntimeException: MBeans Failed to initialise
        at org.mule.module.management.agent.JmxAgent$MuleContextStartedListener.onNotification(JmxAgent.java:707)
        at org.mule.module.management.agent.JmxAgent$MuleContextStartedListener.onNotification(JmxAgent.java:685)
        at org.mule.context.notification.Sender.dispatch(Sender.java:40)
        at org.mule.context.notification.Policy.dispatch(Policy.java:122)
        at org.mule.context.notification.ServerNotificationManager.notifyListeners(ServerNotificationManager.java:244)
        at org.mule.context.notification.ServerNotificationManager.fireNotification(ServerNotificationManager.java:197)
        at org.mule.DefaultMuleContext.fireNotification(DefaultMuleContext.java:404)
        at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:226)
        at org.mule.module.launcher.application.DefaultMuleApplication.start(DefaultMuleApplication.java:146)
        at org.mule.module.launcher.application.ApplicationWrapper.start(ApplicationWrapper.java:107)
        at org.mule.module.launcher.DefaultMuleDeployer.deploy(DefaultMuleDeployer.java:52)
        ... 8 more
    Caused by: javax.management.RuntimeMBeanException: RuntimeException thrown in postRegister method
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postRegisterInvoke(Unknown Source)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(Unknown Source)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(Unknown Source)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(Unknown Source)
        at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(Unknown Source)
        at org.mule.module.management.agent.JmxAgent.registerFlowConstructServices(JmxAgent.java:428)
        at org.mule.module.management.agent.JmxAgent$MuleContextStartedListener.onNotification(JmxAgent.java:700)
        ... 18 more
    Caused by: java.lang.ClassCastException: com.company.test.sorter.model.Config cannot be cast to org.mule.construct.AbstractFlowConstruct
        at org.mule.module.management.mbean.FlowConstructService.postRegister(FlowConstructService.java:139)
        at org.mule.module.management.agent.ClassloaderSwitchingMBeanWrapper.postRegister(ClassloaderSwitchingMBeanWrapper.java:101)
        ... 25 more
    Show
    + Failed to deploy app 'number-sorter', see below + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++     org.mule.module.launcher.DeploymentException: Failed to deploy application [number-sorter]     at org.mule.module.launcher.DefaultMuleDeployer.deploy(DefaultMuleDeployer.java:68)     at org.mule.module.launcher.DeploymentService.start(DeploymentService.java:175)     at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:157)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)     at java.lang.reflect.Method.invoke(Unknown Source)     at org.mule.module.reboot.MuleContainerWrapper.start(MuleContainerWrapper.java:56)     at org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:2788) Caused by: org.mule.api.MuleRuntimeException: MBeans Failed to initialise     at org.mule.module.management.agent.JmxAgent$MuleContextStartedListener.onNotification(JmxAgent.java:707)     at org.mule.module.management.agent.JmxAgent$MuleContextStartedListener.onNotification(JmxAgent.java:685)     at org.mule.context.notification.Sender.dispatch(Sender.java:40)     at org.mule.context.notification.Policy.dispatch(Policy.java:122)     at org.mule.context.notification.ServerNotificationManager.notifyListeners(ServerNotificationManager.java:244)     at org.mule.context.notification.ServerNotificationManager.fireNotification(ServerNotificationManager.java:197)     at org.mule.DefaultMuleContext.fireNotification(DefaultMuleContext.java:404)     at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:226)     at org.mule.module.launcher.application.DefaultMuleApplication.start(DefaultMuleApplication.java:146)     at org.mule.module.launcher.application.ApplicationWrapper.start(ApplicationWrapper.java:107)     at org.mule.module.launcher.DefaultMuleDeployer.deploy(DefaultMuleDeployer.java:52)     ... 8 more Caused by: javax.management.RuntimeMBeanException: RuntimeException thrown in postRegister method     at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postRegisterInvoke(Unknown Source)     at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(Unknown Source)     at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(Unknown Source)     at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(Unknown Source)     at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(Unknown Source)     at org.mule.module.management.agent.JmxAgent.registerFlowConstructServices(JmxAgent.java:428)     at org.mule.module.management.agent.JmxAgent$MuleContextStartedListener.onNotification(JmxAgent.java:700)     ... 18 more Caused by: java.lang.ClassCastException: com.company.test.sorter.model.Config cannot be cast to org.mule.construct.AbstractFlowConstruct     at org.mule.module.management.mbean.FlowConstructService.postRegister(FlowConstructService.java:139)     at org.mule.module.management.agent.ClassloaderSwitchingMBeanWrapper.postRegister(ClassloaderSwitchingMBeanWrapper.java:101)     ... 25 more
  • Similar Issues:
    None

Description

I'm trying to store instance of some class in mule registry on flow application startup. Below you can see my java code and flow fragment. My problem is that sometimes application deployment fails with following error:

Caused by: java.lang.ClassCastException: com.company.test.sorter.model.Config cannot be cast to org.mule.construct.AbstractFlowConstruct
at org.mule.module.management.mbean.FlowConstructService.postRegister(FlowConstructService.java:139)
at org.mule.module.management.agent.ClassloaderSwitchingMBeanWrapper.postRegister(ClassloaderSwitchingMBeanWrapper.java:101)

You can find whole stacktrace below. I must repeat: this exception is raised only sometimes, approximately every fifth deployment of unchanged application. In most cases application runs perfectly fine. I googled for this exceptions and classes but I didn't find any solution. I am using Mule 3.2.1 (standalone). I asked a question about this issue on stackoverflow (http://stackoverflow.com/questions/10583336/object-in-mules-registry-cannot-be-cast-to-org-mule-construct-abstractflowconst/10587415#10587415), where it was suggested to me that this is a bug.

@XmlRootElement(name = "config")
public class Config { private String x2Regex; private String x3Regex; private String x2QueueName; private String x3QueueName; // constructors, getters and setters }
public class Initializer implements
MuleContextNotificationListener<MuleContextNotification> {
@Override
public void onNotification(MuleContextNotification notification) {
if (notification.getAction() == MuleContextNotification.CONTEXT_STARTED) {
try { notification.getMuleContext().getRegistry().registerObject("config", new Config()); } catch (RegistrationException e) { // cut }
}
}
}

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
There are no comments yet on this issue.

People

  • Assignee:
    Unassigned
    Reporter:
    Michal Nowak
Vote (1)
Watch (2)

Dates

  • Created:
    15/May/12 02:52 AM
    Updated:
    04/Jun/12 02:11 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.