mulesoft/mongo-connector — Issue #5: Having Mongo namespace but not using it causes the app to fail
Author: ealdinio
Created: 2011-10-14 15:02:55+00:00
State: open

Testing the cloud connectors in Studio I found out that when Mongo DB namespace is there and if you don't actually use that connector, it throws an error in the initialization of the application.

Steps to reproduce:
1. Enter in Studio, create a project and a flow.
2. Create an HTTP inbound endpoint, a Mongo DB CC and configuration.
3. Delete the cloud connector and configuration . In the XML the Mongo DB namespace remains.
4. Create another cloud connector and configuration itself such as CMIS.
5. Save the project.
6. Run the application.
It fails throwing this error:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Initializing app 'testing_cc' +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
INFO 2011-10-14 11:42:36,228 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising RegistryBroker
INFO 2011-10-14 11:42:36,346 [main] org.mule.config.spring.MuleApplicationContext: Refreshing org.mule.config.spring.MuleApplicationContext@1fa12495: startup date [Fri Oct 14 11:42:36 GMT-03:00 2011]; root of context hierarchy
WARN 2011-10-14 11:42:38,418 [main] org.mule.config.spring.parsers.assembly.DefaultBeanAssembler: Cannot assign class java.lang.Object to interface org.mule.api.AnnotatedObject
WARN 2011-10-14 11:42:38,418 [main] org.mule.config.spring.parsers.assembly.DefaultBeanAssembler: Cannot assign class java.lang.Object to interface org.mule.api.AnnotatedObject
ERROR 2011-10-14 11:42:39,232 [main] org.mule.tooling.server.application.ApplicationDeployer: null
org.mule.api.lifecycle.InitialisationException: Cannot find object
at org.mule.module.mongo.config.DbobjectToJsonTransformer.initialise(DbobjectToJsonTransformer.java:53)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:225)
at org.mule.lifecycle.phases.MuleContextInitialisePhase.applyLifecycle(MuleContextInitialisePhase.java:72)
at org.mule.lifecycle.RegistryLifecycleManager.applyCompletedPhases(RegistryLifecycleManager.java:220)
at org.mule.registry.TransientRegistry.registerObject(TransientRegistry.java:265)
at org.mule.registry.AbstractRegistryBroker.registerObject(AbstractRegistryBroker.java:193)
at org.mule.registry.MuleRegistryHelper.registerObject(MuleRegistryHelper.java:712)
at org.mule.config.bootstrap.SimpleRegistryBootstrap.registerObject(SimpleRegistryBootstrap.java:340)
at org.mule.config.bootstrap.SimpleRegistryBootstrap.registerObjects(SimpleRegistryBootstrap.java:292)
at org.mule.config.bootstrap.SimpleRegistryBootstrap.initialise(SimpleRegistryBootstrap.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1536)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
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$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:574)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:89)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:109)
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)
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)
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:203)
at org.mule.module.launcher.application.ApplicationWrapper.init(ApplicationWrapper.java:64)
at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:42)
Exception in thread "main" org.mule.module.launcher.DeploymentInitException: InitialisationException: Cannot find object
at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:215)
at org.mule.module.launcher.application.ApplicationWrapper.init(ApplicationWrapper.java:64)
at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:42)
Caused by: org.mule.api.config.ConfigurationException: Error creating bean with name '_muleSimpleRegistryBootstrap' defined in URL [jar:file:/Users/eugenia/Downloads/MuleStudio-14Oct-2011/plugins/org.mule.tooling.server.3.2.0_1.0.0.201110132008/mule/mule/mule-module-spring-config-3.2.0.jar!/default-mule-config.xml]: Invocation of init method failed; nested exception is org.mule.api.lifecycle.InitialisationException: Cannot find object (org.mule.api.lifecycle.InitialisationException) (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:203)
... 2 more
Caused by: org.mule.api.config.ConfigurationException: Error creating bean with name '_muleSimpleRegistryBootstrap' defined in URL [jar:file:/Users/eugenia/Downloads/MuleStudio-14Oct-2011/plugins/org.mule.tooling.server.3.2.0_1.0.0.201110132008/mule/mule/mule-module-spring-config-3.2.0.jar!/default-mule-config.xml]: Invocation of init method failed; nested exception is org.mule.api.lifecycle.InitialisationException: Cannot find object (org.mule.api.lifecycle.InitialisationException) (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)
... 5 more
Caused by: org.mule.api.lifecycle.InitialisationException: Error creating bean with name '_muleSimpleRegistryBootstrap' defined in URL [jar:file:/Users/eugenia/Downloads/MuleStudio-14Oct-2011/plugins/org.mule.tooling.server.3.2.0_1.0.0.201110132008/mule/mule/mule-module-spring-config-3.2.0.jar!/default-mule-config.xml]: Invocation of init method failed; nested exception is org.mule.api.lifecycle.InitialisationException: Cannot find object (org.mule.api.lifecycle.InitialisationException)
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)
... 9 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_muleSimpleRegistryBootstrap' defined in URL [jar:file:/Users/eugenia/Downloads/MuleStudio-14Oct-2011/plugins/org.mule.tooling.server.3.2.0_1.0.0.201110132008/mule/mule/mule-module-spring-config-3.2.0.jar!/default-mule-config.xml]: Invocation of init method failed; nested exception is org.mule.api.lifecycle.InitialisationException: Cannot find object (org.mule.api.lifecycle.InitialisationException)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412)
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$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:574)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:89)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:109)
... 12 more
Caused by: org.mule.api.lifecycle.InitialisationException: Cannot find object (org.mule.api.lifecycle.InitialisationException)
at org.mule.config.bootstrap.SimpleRegistryBootstrap.initialise(SimpleRegistryBootstrap.java:169)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1536)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
... 23 more
Caused by: org.mule.api.registry.RegistrationException: Cannot find object (org.mule.api.lifecycle.InitialisationException)
at org.mule.registry.TransientRegistry.registerObject(TransientRegistry.java:270)
at org.mule.registry.AbstractRegistryBroker.registerObject(AbstractRegistryBroker.java:193)
at org.mule.registry.MuleRegistryHelper.registerObject(MuleRegistryHelper.java:712)
at org.mule.config.bootstrap.SimpleRegistryBootstrap.registerObject(SimpleRegistryBootstrap.java:340)
at org.mule.config.bootstrap.SimpleRegistryBootstrap.registerObjects(SimpleRegistryBootstrap.java:292)
at org.mule.config.bootstrap.SimpleRegistryBootstrap.initialise(SimpleRegistryBootstrap.java:165)
... 30 more
Caused by: org.mule.api.lifecycle.InitialisationException: Cannot find object
at org.mule.module.mongo.config.DbobjectToJsonTransformer.initialise(DbobjectToJsonTransformer.java:53)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:225)
at org.mule.lifecycle.phases.MuleContextInitialisePhase.applyLifecycle(MuleContextInitialisePhase.java:72)
at org.mule.lifecycle.RegistryLifecycleManager.applyCompletedPhases(RegistryLifecycleManager.java:220)
at org.mule.registry.TransientRegistry.registerObject(TransientRegistry.java:265)
... 35 more

This is the flow I created and used: