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

OData - Teiid throws IndexOutOfBoundsException if user requests value of nonexistent propery

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 9.3
    • Fix Version/s: 9.3, 8.12.18.6_4
    • Component/s: OData
    • Labels:
      None

      Description

      If user requests property of entity which is not present, Teiid returns 404 (this is correct behavior). However, if user requests value of the property ($value), Teiid returns 500 which is cause by IndexOutOfBoundsException [1]. VDB [2].

      http://localhost:8080/odata4/vdb/test/t1(1)/fk/id/ - returns 404
      http://localhost:8080/odata4/vdb/test/t1(1)/fk/id/$value - returns 500

      [1] Exception
      Unable to find source-code formatter for language: text. 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
      09:20:27,462 ERROR [org.teiid.ODATA] (default task-26)  TEIID16052 Unable to process odata request due to: Index: 0, Size: 0: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      	at java.util.ArrayList.rangeCheck(ArrayList.java:638)
      	at java.util.ArrayList.get(ArrayList.java:414)
      	at org.teiid.olingo.service.TeiidServiceHandler$1.visit(TeiidServiceHandler.java:189)
      	at org.apache.olingo.server.core.responses.PrimitiveValueResponse.accepts(PrimitiveValueResponse.java:113)
      	at org.teiid.olingo.service.TeiidServiceHandler.read(TeiidServiceHandler.java:179)
      	at org.apache.olingo.server.core.requests.DataRequest$ValueRequest.execute(DataRequest.java:674)
      	at org.apache.olingo.server.core.requests.DataRequest.execute(DataRequest.java:255)
      	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)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
      	at org.teiid.olingo.web.ODataFilter.internalDoFilter(ODataFilter.java:228)
      	at org.teiid.olingo.web.ODataFilter.doFilter(ODataFilter.java:100)
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
      	at org.teiid.olingo.web.gzip.GzipFilter.doFilter(GzipFilter.java:61)
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
      	at org.teiid.olingo.web.CorsFilter.doFilter(CorsFilter.java:80)
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
      	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
      	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
      	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
      	at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
      	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
      	at io.undertow.server.handlers.DisableCacheHandler.handleRequest(DisableCacheHandler.java:33)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51)
      	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
      	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
      	at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56)
      	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
      	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
      	at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
      	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284)
      	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263)
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
      	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)
      	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
      	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)
      	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:744)
      
      [2] VDB
      <vdb name="vdb" version="1">
          <model name="test" type="VIRTUAL">
              <metadata>
                      CREATE VIEW t1 (
                          id integer PRIMARY KEY,
                          fid integer,
                          CONSTRAINT fk FOREIGN KEY (fid) REFERENCES t1(id))
                      AS
                          SELECT 1, null;
              </metadata>
          </model>
      </vdb>
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                shawkins Steven Hawkins
                Reporter:
                jdurani Juraj DurĂ¡ni
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: