Uploaded image for project: 'Marmotta'
  1. Marmotta
  2. MARMOTTA-608

IndexOutOfBoundsException evaluating SPARQL query with variables not projected

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.0
    • Fix Version/s: 3.4.0
    • Component/s: KiWi Triple Store
    • Labels:

      Description

      I got an issue evaluating SPARQL queries with variables not projected:

      java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      	at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[na:1.7.0_75]
      	at java.util.concurrent.FutureTask.get(FutureTask.java:202) ~[na:1.7.0_75]
      	at org.apache.marmotta.platform.sparql.services.sparql.SparqlServiceImpl.query(SparqlServiceImpl.java:324) ~[marmotta-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.sparql.services.sparql.SparqlServiceImpl$Proxy$_$$_WeldClientProxy.query(Unknown Source) [marmotta-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.sparql.webservices.SparqlWebService$3.write(SparqlWebService.java:515) [marmotta-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.jboss.resteasy.plugins.providers.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:32) [resteasy-jaxrs-3.0.10.Final.jar:na]
      	at org.jboss.resteasy.plugins.providers.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:17) [resteasy-jaxrs-3.0.10.Final.jar:na]
      	at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.writeTo(AbstractWriterInterceptorContext.java:129) [resteasy-jaxrs-3.0.10.Final.jar:na]
      	at org.jboss.resteasy.core.interception.ServerWriterInterceptorContext.writeTo(ServerWriterInterceptorContext.java:62) [resteasy-jaxrs-3.0.10.Final.jar:na]
      	at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:118) [resteasy-jaxrs-3.0.10.Final.jar:na]
      	at org.jboss.resteasy.plugins.providers.jackson.Jackson2JsonpInterceptor.aroundWriteTo(Jackson2JsonpInterceptor.java:113) [resteasy-jackson2-provider-3.0.10.Final.jar:na]
      	at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:122) [resteasy-jaxrs-3.0.10.Final.jar:na]
      	at org.jboss.resteasy.plugins.interceptors.encoding.GZIPEncodingInterceptor.aroundWriteTo(GZIPEncodingInterceptor.java:100) [resteasy-jaxrs-3.0.10.Final.jar:na]
      	at org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:122) [resteasy-jaxrs-3.0.10.Final.jar:na]
      	at org.jboss.resteasy.core.ServerResponseWriter.writeNomapResponse(ServerResponseWriter.java:99) [resteasy-jaxrs-3.0.10.Final.jar:na]
      	at org.jboss.resteasy.core.SynchronousDispatcher.writeResponse(SynchronousDispatcher.java:427) [resteasy-jaxrs-3.0.10.Final.jar:na]
      	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:376) [resteasy-jaxrs-3.0.10.Final.jar:na]
      	at org.jboss.resteasy.core.SynchronousDispatcher.invokePropagateNotFound(SynchronousDispatcher.java:217) [resteasy-jaxrs-3.0.10.Final.jar:na]
      	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:224) [resteasy-jaxrs-3.0.10.Final.jar:na]
      	at org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.doFilter(FilterDispatcher.java:62) [resteasy-jaxrs-3.0.10.Final.jar:na]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.marmotta.platform.core.servlet.MarmottaResourceFilter$MarmottaFilterChain.doFilter(MarmottaResourceFilter.java:185) [marmotta-core-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.core.filters.ModuleResourceFilter.doFilter(ModuleResourceFilter.java:157) [marmotta-core-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.core.filters.ModuleResourceFilter$Proxy$_$$_WeldClientProxy.doFilter(Unknown Source) [marmotta-core-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.core.servlet.MarmottaResourceFilter$MarmottaFilterChain.doFilter(MarmottaResourceFilter.java:180) [marmotta-core-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.core.servlet.MarmottaResourceFilter$MarmottaFilterChain.doFilter(MarmottaResourceFilter.java:182) [marmotta-core-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.core.filters.MarmottaServerNameFilter.doFilter(MarmottaServerNameFilter.java:104) [marmotta-core-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.core.servlet.MarmottaResourceFilter$MarmottaFilterChain.doFilter(MarmottaResourceFilter.java:180) [marmotta-core-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.core.filters.TemplatingFilter.doFilter(TemplatingFilter.java:176) [marmotta-core-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.core.filters.TemplatingFilter$Proxy$_$$_WeldClientProxy.doFilter(Unknown Source) [marmotta-core-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.core.servlet.MarmottaResourceFilter$MarmottaFilterChain.doFilter(MarmottaResourceFilter.java:180) [marmotta-core-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.security.filters.MarmottaAccessControlFilter.doFilter(MarmottaAccessControlFilter.java:142) [marmotta-security-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.security.filters.MarmottaAccessControlFilter$Proxy$_$$_WeldClientProxy.doFilter(Unknown Source) [marmotta-security-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.core.servlet.MarmottaResourceFilter$MarmottaFilterChain.doFilter(MarmottaResourceFilter.java:180) [marmotta-core-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.user.filters.MarmottaAuthenticationFilter.doFilter(MarmottaAuthenticationFilter.java:163) [marmotta-user-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.user.filters.MarmottaAuthenticationFilter$Proxy$_$$_WeldClientProxy.doFilter(Unknown Source) [marmotta-user-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.core.servlet.MarmottaResourceFilter$MarmottaFilterChain.doFilter(MarmottaResourceFilter.java:180) [marmotta-core-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.core.servlet.MarmottaResourceFilter.doFilter(MarmottaResourceFilter.java:133) [marmotta-core-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.marmotta.platform.core.servlet.MarmottaPreStartupFilter.doFilter(MarmottaPreStartupFilter.java:106) [marmotta-core-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:169) [cors-filter-1.9.jar:1.9]
      	at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:232) [cors-filter-1.9.jar:1.9]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.marmotta.platform.core.servlet.MarmottaOptionsFilter.doFilter(MarmottaOptionsFilter.java:81) [marmotta-core-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) [tomcat-embed-core-7.0.47.jar:7.0.47]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_75]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_75]
      	at java.lang.Thread.run(Thread.java:745) [na:1.7.0_75]
      Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      	at java.util.ArrayList.rangeCheck(ArrayList.java:635) ~[na:1.7.0_75]
      	at java.util.ArrayList.get(ArrayList.java:411) ~[na:1.7.0_75]
      	at org.apache.marmotta.kiwi.sparql.builder.SQLBuilder.buildSelectClause(SQLBuilder.java:622) ~[kiwi-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.kiwi.sparql.builder.SQLBuilder.build(SQLBuilder.java:936) ~[kiwi-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.kiwi.sparql.builder.eval.ValueExpressionEvaluator.meet(ValueExpressionEvaluator.java:135) ~[kiwi-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.openrdf.query.algebra.Exists.visit(Exists.java:42) ~[sesame-queryalgebra-model-2.7.13.jar:na]
      	at org.apache.marmotta.kiwi.sparql.builder.eval.ValueExpressionEvaluator.<init>(ValueExpressionEvaluator.java:89) ~[kiwi-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.kiwi.sparql.builder.SQLBuilder.evaluateExpression(SQLBuilder.java:849) ~[kiwi-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.kiwi.sparql.builder.SQLBuilder.prepareBuilder(SQLBuilder.java:343) ~[kiwi-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.kiwi.sparql.builder.SQLBuilder.<init>(SQLBuilder.java:165) ~[kiwi-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.kiwi.sparql.builder.SQLBuilder.<init>(SQLBuilder.java:146) ~[kiwi-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.kiwi.sparql.builder.SQLBuilder.<init>(SQLBuilder.java:136) ~[kiwi-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStrategy.evaluateNative(KiWiEvaluationStrategy.java:206) ~[kiwi-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStrategy.evaluate(KiWiEvaluationStrategy.java:123) ~[kiwi-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:592) ~[sesame-queryalgebra-evaluation-2.7.13.jar:na]
      	at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:197) ~[sesame-queryalgebra-evaluation-2.7.13.jar:na]
      	at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:662) ~[sesame-queryalgebra-evaluation-2.7.13.jar:na]
      	at org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStrategy.evaluate(KiWiEvaluationStrategy.java:108) ~[kiwi-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:577) ~[sesame-queryalgebra-evaluation-2.7.13.jar:na]
      	at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:197) ~[sesame-queryalgebra-evaluation-2.7.13.jar:na]
      	at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:607) ~[sesame-queryalgebra-evaluation-2.7.13.jar:na]
      	at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:197) ~[sesame-queryalgebra-evaluation-2.7.13.jar:na]
      	at org.apache.marmotta.kiwi.sparql.sail.KiWiSparqlSailConnection.evaluate(KiWiSparqlSailConnection.java:97) ~[kiwi-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.openrdf.sail.helpers.SailConnectionWrapper.evaluate(SailConnectionWrapper.java:95) ~[sesame-sail-api-2.7.13.jar:na]
      	at org.openrdf.sail.helpers.SailConnectionWrapper.evaluate(SailConnectionWrapper.java:95) ~[sesame-sail-api-2.7.13.jar:na]
      	at org.openrdf.repository.sail.SailTupleQuery.evaluate(SailTupleQuery.java:60) ~[sesame-repository-sail-2.7.13.jar:na]
      	at org.openrdf.repository.sail.SailTupleQuery.evaluate(SailTupleQuery.java:75) ~[sesame-repository-sail-2.7.13.jar:na]
      	at org.apache.marmotta.platform.sparql.services.sparql.SparqlServiceImpl.query(SparqlServiceImpl.java:345) ~[marmotta-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.sparql.services.sparql.SparqlServiceImpl.query(SparqlServiceImpl.java:352) ~[marmotta-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.sparql.services.sparql.SparqlServiceImpl.access$700(SparqlServiceImpl.java:60) ~[marmotta-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.sparql.services.sparql.SparqlServiceImpl$5.call(SparqlServiceImpl.java:291) ~[marmotta-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at org.apache.marmotta.platform.sparql.services.sparql.SparqlServiceImpl$5.call(SparqlServiceImpl.java:280) ~[marmotta-sparql-3.4.0-SNAPSHOT.jar:3.4.0-SNAPSHOT]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262) ~[na:1.7.0_75]
      	... 3 common frames omitted
      

      That's the typical query that SKOSjs does.

        Attachments

          Activity

            People

            • Assignee:
              wikier Sergio Fernández
              Reporter:
              wikier Sergio Fernández
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 10m
                10m
                Remaining:
                Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified