Receive Null Pointer Exception with Odata query and column masking

Solution Verified - Updated -

Issue

  • JDBC query to table with column masking succeeds, same query via Odata gives:
{"error":{"code":null,"message":"org.teiid.core.TeiidException"}}

Environment

  • Red Hat JBoss Data Virtualization (DV) 6.4
  • DV Data Roles and Column masking
  • Error in server.log:
ERROR [org.teiid.ODATA] (http-127.0.0.1:8080-1) TEIID16052 Unable to process odata request due to: org.teiid.core.TeiidException: org.teiid.core.TeiidException
    at org.teiid.client.ResultsMessage.setException(ResultsMessage.java:196)
    at org.teiid.dqp.internal.process.RequestWorkItem.sendError(RequestWorkItem.java:1088)
    at org.teiid.dqp.internal.process.RequestWorkItem.close(RequestWorkItem.java:578)
    at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:374)
    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.GeneratedMethodAccessor169.invoke(Unknown Source) [:1.8.0_60]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_60]
    at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_60]
    at org.teiid.logging.LogManager$LoggingProxy.invoke(LogManager.java:121) [teiid-api-8.12.16.6_4-redhat-64-2.jar:8.12.16.6_4-redhat-64-2]
    at org.teiid.jboss.TransportService$2.invoke(TransportService.java:241)
    at com.sun.proxy.$Proxy37.executeRequest(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor169.invoke(Unknown Source) [:1.8.0_60]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_60]
    at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_60]
    at org.teiid.transport.LocalServerConnection$1$1.call(LocalServerConnection.java:208)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_60]
    at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:284)
    at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:268)
    at org.teiid.transport.LocalServerConnection$1.invoke(LocalServerConnection.java:206)
    at com.sun.proxy.$Proxy37.executeRequest(Unknown Source)
    at org.teiid.jdbc.StatementImpl.execute(StatementImpl.java:712)
    at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:554)
    at org.teiid.jdbc.PreparedStatementImpl.executeQuery(PreparedStatementImpl.java:260)
    at org.teiid.jdbc.PreparedStatementImpl.executeQuery(PreparedStatementImpl.java:73)
    at org.teiid.olingo.service.LocalClient.executeSQL(LocalClient.java:246) [teiid-olingo-8.12.16.6_4-redhat-64-2.jar:8.12.16.6_4-redhat-64-2]
    at org.teiid.olingo.service.TeiidServiceHandler.executeQuery(TeiidServiceHandler.java:344) [teiid-olingo-8.12.16.6_4-redhat-64-2.jar:8.12.16.6_4-redhat-64-2]
    at org.teiid.olingo.service.TeiidServiceHandler.read(TeiidServiceHandler.java:167) [teiid-olingo-8.12.16.6_4-redhat-64-2.jar:8.12.16.6_4-redhat-64-2]
    at org.apache.olingo.server.core.requests.DataRequest$EntityRequest.execute(DataRequest.java:323)
    at org.apache.olingo.server.core.requests.DataRequest.execute(DataRequest.java:246)
    at org.apache.olingo.server.core.ServiceDispatcher.internalExecute(ServiceDispatcher.java:160)
    at org.apache.olingo.server.core.ServiceDispatcher.execute(ServiceDispatcher.java:98)
    at org.apache.olingo.server.core.OData4HttpHandler.process(OData4HttpHandler.java:67)
    at org.teiid.olingo.web.ODataServlet.service(ODataServlet.java:43) [teiid-olingo-8.12.16.6_4-redhat-64-2.jar:8.12.16.6_4-redhat-64-2]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-2.jar:1.0.2.Final-redhat-2]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.5.28.Final-redhat-1.jar:7.5.28.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.28.Final-redhat-1.jar:7.5.28.Final-redhat-1]
    at org.teiid.olingo.web.ODataFilter.internalDoFilter(ODataFilter.java:231) [teiid-olingo-8.12.16.6_4-redhat-64-2.jar:8.12.16.6_4-redhat-64-2]
    at org.teiid.olingo.web.ODataFilter.doFilter(ODataFilter.java:100) [teiid-olingo-8.12.16.6_4-redhat-64-2.jar:8.12.16.6_4-redhat-64-2]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.5.28.Final-redhat-1.jar:7.5.28.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.28.Final-redhat-1.jar:7.5.28.Final-redhat-1]
    at org.teiid.olingo.web.CorsFilter.doFilter(CorsFilter.java:80) [teiid-olingo-8.12.16.6_4-redhat-64-2.jar:8.12.16.6_4-redhat-64-2]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.5.28.Final-redhat-1.jar:7.5.28.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.28.Final-redhat-1.jar:7.5.28.Final-redhat-1]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) [jbossweb-7.5.28.Final-redhat-1.jar:7.5.28.Final-redhat-1]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.5.28.Final-redhat-1.jar:7.5.28.Final-redhat-1]
    at org.jboss.as.web.security.SubjectInfoSetupValve.invoke(SubjectInfoSetupValve.java:34) [jboss-as-web-7.5.20.Final-redhat-1.jar:7.5.20.Final-redhat-1]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:512) [jbossweb-7.5.28.Final-redhat-1.jar:7.5.28.Final-redhat-1]
    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.5.20.Final-redhat-1.jar:7.5.20.Final-redhat-1]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151) [jbossweb-7.5.28.Final-redhat-1.jar:7.5.28.Final-redhat-1]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.5.28.Final-redhat-1.jar:7.5.28.Final-redhat-1]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.5.28.Final-redhat-1.jar:7.5.28.Final-redhat-1]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [jbossweb-7.5.28.Final-redhat-1.jar:7.5.28.Final-redhat-1]
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.5.28.Final-redhat-1.jar:7.5.28.Final-redhat-1]
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:656) [jbossweb-7.5.28.Final-redhat-1.jar:7.5.28.Final-redhat-1]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.5.28.Final-redhat-1.jar:7.5.28.Final-redhat-1]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_60]
Caused by: java.lang.NullPointerException
    at org.teiid.query.optimizer.relational.rules.RuleMergeVirtual.doMerge(RuleMergeVirtual.java:205)
    at org.teiid.query.optimizer.relational.rules.RuleMergeVirtual.execute(RuleMergeVirtual.java:84)
    at org.teiid.query.optimizer.relational.RelationalPlanner.executeRules(RelationalPlanner.java:962)
    at org.teiid.query.optimizer.relational.RelationalPlanner.optimize(RelationalPlanner.java:228)
    at org.teiid.query.optimizer.QueryOptimizer.optimizePlan(QueryOptimizer.java:159)
    at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:448)
    at org.teiid.dqp.internal.process.PreparedStatementRequest.generatePlan(PreparedStatementRequest.java:128)
    at org.teiid.dqp.internal.process.Request.processRequest(Request.java:476)
    at org.teiid.dqp.internal.process.PreparedStatementRequest.processRequest(PreparedStatementRequest.java:349)
    at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:642)
    at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:337)
    ... 55 more

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In