Project: mule
Issue MULE-7518: Parameterized query broken when CDATA is preceded by a new line 
Parameterized query cannot be parsed when it contains a CDATA element that is preceded by a new line. org.mule.api.config.ConfigurationException: Unexpected exception parsing XML document from URL [file:/Users/pablokraan/devel/workspaces/muleFull/mule/modules/db/target/test-classes/integration/template/cdata-template-query-config.xml]; nested exception is org.mule.module.db.internal.parser.QueryTemplateParsingException: SQL text cannot be empty (org.mule.api.lifecycle.InitialisationException) org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:49) org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69) org.mule.context.DefaultMuleContextFactory$1.configure(DefaultMuleContextFactory.java:84) org.mule.context.DefaultMuleContextFactory.doCreateMuleContext(DefaultMuleContextFactory.java:217) org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:76) org.mule.tck.junit4.AbstractMuleContextTestCase.createMuleContext(AbstractMuleContextTestCase.java:234) org.mule.tck.junit4.AbstractMuleContextTestCase.setUpMuleContext(AbstractMuleContextTestCase.java:143) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:46) org.junit.internal.runners.statements.FailOnTimeout$1.run(FailOnTimeout.java:28) Caused by: org.mule.api.lifecycle.InitialisationException: Unexpected exception parsing XML document from URL [file:/Users/pablokraan/devel/workspaces/muleFull/mule/modules/db/target/test-classes/integration/template/cdata-template-query-config.xml]; nested exception is org.mule.module.db.internal.parser.QueryTemplateParsingException: SQL text cannot be empty org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:113) org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:133) org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:88) org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43)	... 17 more Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [file:/Users/pablokraan/devel/workspaces/muleFull/mule/modules/db/target/test-classes/integration/template/cdata-template-query-config.xml]; nested exception is org.mule.module.db.internal.parser.QueryTemplateParsingException: SQL text cannot be empty org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174) org.mule.config.spring.MuleArtifactContext.loadBeanDefinitions(MuleArtifactContext.java:106) org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451) org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:86) org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:105)	... 20 more Caused by: org.mule.module.db.internal.parser.QueryTemplateParsingException: SQL text cannot be empty org.mule.module.db.internal.parser.SimpleQueryTemplateParser.doParse(SimpleQueryTemplateParser.java:101) org.mule.module.db.internal.parser.SimpleQueryTemplateParser.parse(SimpleQueryTemplateParser.java:61) org.mule.module.db.internal.config.domain.query.QueryTemplateBeanDefinitionParser.parseParameterizedQuery(QueryTemplateBeanDefinitionParser.java:154) org.mule.module.db.internal.config.domain.query.QueryTemplateBeanDefinitionParser.doParse(QueryTemplateBeanDefinitionParser.java:67) org.mule.config.spring.parsers.AbstractMuleBeanDefinitionParser.parseInternal(AbstractMuleBeanDefinitionParser.java:297) org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:59) org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73) org.mule.config.spring.MuleHierarchicalBeanDefinitionParserDelegate.parseCustomElement(MuleHierarchicalBeanDefinitionParserDelegate.java:85) org.mule.config.spring.MuleHierarchicalBeanDefinitionParserDelegate.parseCustomElement(MuleHierarchicalBeanDefinitionParserDelegate.java:127) org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428) org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:190) org.mule.config.spring.MuleBeanDefinitionDocumentReader.parseBeanDefinitions(MuleBeanDefinitionDocumentReader.java:51) org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140) org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)	... 29 more
Story points: 1