Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-5189

Empty XmlElement throws an NPE when passed for the non-nullable parameter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 10.1, 9.3.6, 10.0.2
    • 10.0.1
    • Query Engine
    • None
    • Hide

      1. create the following proc:

          <model visible = "true" type = "VIRTUAL" name = "views">
              <metadata type = "DDL"><![CDATA[
                create virtual procedure v0(IN soapBody xml not null) 
                   returns (response xml) as
                begin
                   select XmlElement(root, 'Hi!');
                end
              ]]>
              </metadata>
          </model>
      

      2. when running the following query:

      call views.v0(
          soapBody => XmlElement(root)
      );;
      

      teiid throws out the following stacktrace:

      Unable to find source-code formatter for language: noformat. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      2017-12-27 17:19:12,864 ERROR [org.teiid.PROCESSOR] (Worker2_QueryProcessorQueue5) l9O5D2rjxOO3 TEIID30019 Unexpected exception for request l9O5D2rjxOO3.0: java.lang.NullPointerExcep
      tion
              at org.teiid.query.function.source.XMLSystemFunctions.xmlElement(XMLSystemFunctions.java:500)
              at org.teiid.query.eval.Evaluator.evaluateXMLElement(Evaluator.java:1130)
              at org.teiid.query.eval.Evaluator.internalEvaluate(Evaluator.java:769)
              at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:707)
              at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:151)
              at org.teiid.query.validator.ValidationVisitor.visit(ValidationVisitor.java:341)
              at org.teiid.query.sql.lang.StoredProcedure.acceptVisitor(StoredProcedure.java:202)
              at org.teiid.query.sql.navigator.AbstractNavigator.visitVisitor(AbstractNavigator.java:50)
              at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.preVisitVisitor(PreOrPostOrderNavigator.java:51)
              at org.teiid.query.validator.Validator$1.preVisitVisitor(Validator.java:80)
              at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:358)
              at org.teiid.query.sql.lang.StoredProcedure.acceptVisitor(StoredProcedure.java:202)
              at org.teiid.query.validator.Validator.executeValidation(Validator.java:90)
              at org.teiid.query.validator.Validator.validate(Validator.java:44)
              at org.teiid.dqp.internal.process.Request.validateWithVisitor(Request.java:338)
              at org.teiid.dqp.internal.process.Request.validateQuery(Request.java:290)
              at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:434)
              at org.teiid.dqp.internal.process.Request.processRequest(Request.java:486)
              at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:660)
              at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:339)
              at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47)
              at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:276)
              at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:280)
              at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
              at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      
      Show
      1. create the following proc: <model visible = "true" type = "VIRTUAL" name = "views" > <metadata type = "DDL" > <![CDATA[ create virtual procedure v0(IN soapBody xml not null) returns (response xml) as begin select XmlElement(root, 'Hi!' ); end ]]> </metadata> </model> 2. when running the following query: call views.v0( soapBody => XmlElement(root) );; teiid throws out the following stacktrace: Unable to find source-code formatter for language: noformat. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml 2017-12-27 17:19:12,864 ERROR [org.teiid.PROCESSOR] (Worker2_QueryProcessorQueue5) l9O5D2rjxOO3 TEIID30019 Unexpected exception for request l9O5D2rjxOO3.0: java.lang.NullPointerExcep tion at org.teiid.query.function.source.XMLSystemFunctions.xmlElement(XMLSystemFunctions.java:500) at org.teiid.query.eval.Evaluator.evaluateXMLElement(Evaluator.java:1130) at org.teiid.query.eval.Evaluator.internalEvaluate(Evaluator.java:769) at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:707) at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:151) at org.teiid.query.validator.ValidationVisitor.visit(ValidationVisitor.java:341) at org.teiid.query.sql.lang.StoredProcedure.acceptVisitor(StoredProcedure.java:202) at org.teiid.query.sql.navigator.AbstractNavigator.visitVisitor(AbstractNavigator.java:50) at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.preVisitVisitor(PreOrPostOrderNavigator.java:51) at org.teiid.query.validator.Validator$1.preVisitVisitor(Validator.java:80) at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:358) at org.teiid.query.sql.lang.StoredProcedure.acceptVisitor(StoredProcedure.java:202) at org.teiid.query.validator.Validator.executeValidation(Validator.java:90) at org.teiid.query.validator.Validator.validate(Validator.java:44) at org.teiid.dqp.internal.process.Request.validateWithVisitor(Request.java:338) at org.teiid.dqp.internal.process.Request.validateQuery(Request.java:290) at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:434) at org.teiid.dqp.internal.process.Request.processRequest(Request.java:486) at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:660) at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:339) at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47) at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:276) at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:280) at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115) at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang. Thread .run( Thread .java:745)

      Empty XmlElement throws an NPE when passed for the non-nullable parameter.

              rhn-engineering-shawkins Steven Hawkins
              dalex005 Dmitrii Pogorelov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: