Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 3.2.1
-
Fix Version/s: None
-
Component/s: Core: (other)
-
Labels:None
-
User impact:Medium
-
Configuration:
-
Log Output:
-
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
}
}
}
}