Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7953985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:17:18+00:00 2026-06-04T03:17:18+00:00

I’m trying to store instance of some class in mule registry on flow application

  • 0

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). Is it a bug or am I doing something wrong?

@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
            }
        }
    }
}
<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>

Below is fragment of mule’s log with exception:

+ 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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T03:17:21+00:00Added an answer on June 4, 2026 at 3:17 am

    Feels like a bug: after reading the source code, I find no reasonable explanation to why Mule would try to register your custom object in JMX while mistaking it for a Flow!

    As a side note, why using a notification listener and the Mule registry when you can just build your object with Spring?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how can I replace this 2 symbol below from the string
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.