Project: mule
Issue MULE-7346: New Database Message Processor: NPE when parsing queries in Templates
Steps to reproduce: 1.- Create and run the followed Mule config: {code:xml} DELETE FROM Customers WHERE CustomerName='Alfreds Futterkiste' AND ContactName='Maria Anders'; SELECT * FROM Users USE AdventureWorks2012; GO EXEC sp_procoption @ProcName = '<procedure name>', @OptionName = ] 'startup', @OptionValue = 'on'; {code} Issue: when running the application you get the followed NPE {code} INFO 2014-02-18 12:37:34,663 [main] org.mule.module.db.sqlexecutor.parser.SimpleSqlCommandParser: Parsing SQL: DELETE FROM Customers WHERE CustomerName='Alfreds Futterkiste' AND ContactName='Maria Anders'; INFO 2014-02-18 12:37:34,669 [main] org.mule.module.db.sqlexecutor.parser.SimpleSqlCommandParser: Parsing SQL: SELECT * FROM Users INFO 2014-02-18 12:37:34,671 [main] org.mule.module.db.sqlexecutor.parser.SimpleSqlCommandParser: Parsing SQL: USE AdventureWorks2012; GO EXEC sp_procoption @ProcName = '', @OptionName = ] 'startup', @OptionValue = 'on'; ERROR 2014-02-18 12:37:34,691 [main] org.mule.module.launcher.application.DefaultMuleApplication: null java.lang.NullPointerException at org.mule.module.db.config.CommandDefinitionBeanDefinitionParser.parseSqlReference(CommandDefinitionBeanDefinitionParser.java:69) at org.mule.module.db.config.CommandDefinitionBeanDefinitionParser.doParse(CommandDefinitionBeanDefinitionParser.java:62) at org.mule.config.spring.parsers.AbstractMuleBeanDefinitionParser.parseInternal(AbstractMuleBeanDefinitionParser.java:297) at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:59) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73) at org.mule.config.spring.MuleHierarchicalBeanDefinitionParserDelegate.parseCustomElement(MuleHierarchicalBeanDefinitionParserDelegate.java:85) at org.mule.config.spring.MuleHierarchicalBeanDefinitionParserDelegate.parseCustomElement(MuleHierarchicalBeanDefinitionParserDelegate.java:127) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:190) at org.mule.config.spring.MuleBeanDefinitionDocumentReader.parseBeanDefinitions(MuleBeanDefinitionDocumentReader.java:51) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174) at org.mule.config.spring.MuleArtifactContext.loadBeanDefinitions(MuleArtifactContext.java:106) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451) at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:86) at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:105) at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:133) at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:88) at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43) at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69) at org.mule.config.builders.AutoConfigurationBuilder.autoConfigure(AutoConfigurationBuilder.java:101) at org.mule.config.builders.AutoConfigurationBuilder.doConfigure(AutoConfigurationBuilder.java:52) at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43) at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69) at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:80) at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:170) at org.mule.module.launcher.artifact.ArtifactWrapper$2.execute(ArtifactWrapper.java:62) at org.mule.module.launcher.artifact.ArtifactWrapper.executeWithinArtifactClassLoader(ArtifactWrapper.java:129) at org.mule.module.launcher.artifact.ArtifactWrapper.init(ArtifactWrapper.java:57) at org.mule.module.launcher.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:25) at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:121) {code}
Story points: 1