1 Reply Latest reply on Jan 4, 2017 2:06 PM by Steven Hawkins

    Teiid Query Exception:  java.lang.AssertionError: ASSERTION FAILED: expected reference to be not null

    Ivan Chan Apprentice

      Teiid Query needs to rewrite tween Teiid version 8.2 and 8.12.3. A customer's virtual datasource had a query containing a join statement which involved MS Sql Server tables and Oracle tables. Things were fine til they upgraded from 8.2 and 8.12.3.

       

      They ran into an error:

      java.lang.AssertionError: ASSERTION FAILED: expected reference to be not null
      at org.teiid.core.util.Assertion.failed(Assertion.java:73)
      at org.teiid.core.util.Assertion.isNotNull(Assertion.java:100)
      at org.teiid.core.util.Assertion.isNotNull(Assertion.java:92)
      at org.teiid.query.processor.relational.RelationalNode.getProjectionIndexes(RelationalNode.java:367)
      at org.teiid.query.processor.relational.JoinNode.initialize(JoinNode.java:133)
      at org.teiid.query.processor.relational.RelationalPlan.connectExternal(RelationalPlan.java:96)
      at org.teiid.query.processor.relational.RelationalPlan.connectExternal(RelationalPlan.java:102)
      at org.teiid.query.processor.relational.RelationalPlan.connectExternal(RelationalPlan.java:102)
      at org.teiid.query.processor.relational.RelationalPlan.initialize(RelationalPlan.java:91)
      at org.teiid.query.processor.QueryProcessor.init(QueryProcessor.java:226)
      at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:138)
      at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114)
      at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:164)
      at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146)
      at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:470)
      at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:348)
      at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51)
      at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:274)
      at org.teiid.dqp.internal.process.DQPCore.executeRequest(DQPCore.java:306)
      at org.teiid.dqp.internal.process.DQPCore.executeRequest(DQPCore.java:238)
      at sun.reflect.GeneratedMethodAccessor603.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.teiid.transport.LocalServerConnection$1$1.call(LocalServerConnection.java:180)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276)
      at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:260)
      at org.teiid.transport.LocalServerConnection$1.invoke(LocalServerConnection.java:178)
      at com.sun.proxy.$Proxy183.executeRequest(Unknown Source)
      at org.teiid.jdbc.StatementImpl.execute(StatementImpl.java:670)
      at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:536)
      at org.teiid.jdbc.PreparedStatementImpl.executeQuery(PreparedStatementImpl.java:260)
      at org.teiid.jdbc.PreparedStatementImpl.executeQuery(PreparedStatementImpl.java:73)
      at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:310)

       

      This occurred for a few different queries, and the resolution was to re-write the SQL queries-- "the SQL Server table joins were done first. After those table joins executed successfully, the table joins between SQL Server and Oracle were added to the query. Lastly, the Oracle-only table joins were added to the query."