8 Replies Latest reply on May 18, 2017 8:31 AM by SemanticGuy

    Unexpected SQLException [ java.sql.SQLSyntaxErrorException: ORA-00903

    SemanticGuy

      We're using Fuseki 2.4.0 (Oracle supported one) to expose a Graph created with a set of views.

      These views are extracting information from external Oracle databases using a external link (Public link) accessing to another Oracle database.

      When we want to extract all predicated (
      SELECT distinct ?predicate
      WHERE

      { ?subject ?predicate ?object }

      An error ORA-00903 is trigger with a large stack.

      Some potentially important notes:
      1) views are extracting a subset of fields from external databases
      2) the ORA-00903 issue is appearing also when views are created with an InnerJoin.
      3) Same SPARQL query works fine from Oracle SQL Development, which drives me to think it's an issue on Jena or Fuseki

      Exception Stack

      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)

      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)

      at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1059)

      at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:522)

      at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:257)

      at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:587)

      at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:225)

      at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:53)

      at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:774)

      at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:925)

      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1111)

      at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:4798)

      at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:4845)

      at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1501)

      at oracle.spatial.rdf.client.jena.Oracle.executeQuery(Oracle.java:554)

      at oracle.spatial.rdf.client.jena.OracleOpExecutor.buildSemIterator(OracleOpExecutor.java:2808)

      at oracle.spatial.rdf.client.jena.OracleRepeatApply.nextStage(OracleRepeatApply.java:1252)

      at org.apache.jena.sparql.engine.iterator.QueryIterRepeatApply.makeNextStage(QueryIterRepeatApply.java:108)

      at org.apache.jena.sparql.engine.iterator.QueryIterRepeatApply.hasNextBinding(QueryIterRepeatApply.java:65)

      at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:111)

      at org.apache.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:39)

      at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:111)

      at org.apache.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:39)

      at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:111)

      at org.apache.jena.sparql.engine.ResultSetStream.hasNext(ResultSetStream.java:74)

      at org.apache.jena.sparql.engine.ResultSetCheckCondition.hasNext(ResultSetCheckCondition.java:59)

      at org.apache.jena.fuseki.servlets.SPARQL_Query.executeQuery(SPARQL_Query.java:321)

      at org.apache.jena.fuseki.servlets.SPARQL_Query.execute(SPARQL_Query.java:270)

      at org.apache.jena.fuseki.servlets.SPARQL_Query.executeWithParameter(SPARQL_Query.java:228)

      at org.apache.jena.fuseki.servlets.SPARQL_Query.perform(SPARQL_Query.java:213)

      at org.apache.jena.fuseki.servlets.ActionSPARQL.executeLifecycle(ActionSPARQL.java:134)

      at org.apache.jena.fuseki.servlets.SPARQL_UberServlet.executeRequest(SPARQL_UberServlet.java:354)

      at org.apache.jena.fuseki.servlets.SPARQL_UberServlet.serviceDispatch(SPARQL_UberServlet.java:315)

      at org.apache.jena.fuseki.servlets.SPARQL_UberServlet.executeAction(SPARQL_UberServlet.java:271)

      at org.apache.jena.fuseki.servlets.ActionSPARQL.execCommonWorker(ActionSPARQL.java:85)

      at org.apache.jena.fuseki.servlets.ActionBase.doCommon(ActionBase.java:81)

      at org.apache.jena.fuseki.servlets.FusekiFilter.doFilter(FusekiFilter.java:72)

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)

      at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)

      at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)

      at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)

      at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)

      at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)

      at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)

      at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)

      at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)

      at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)

      at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)

      at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)

      at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)

      at org.apache.jena.fuseki.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:285)

      at org.apache.jena.fuseki.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:248)

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)

      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)

      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)

      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)

      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)

      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)

      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:341)

      at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:498)

      at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

      at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:796)

      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1368)

      at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

      at java.lang.Thread.run(Unknown Source)

       

      Steps to reproduce:

       

      1) Create a public link to external Oracle Database:

      CREATE PUBLIC DATABASE LINK EXTERN CONNECT TO username IDENTIFIED BY password USING 'EXTERNALSVC';

      2) Create some views to tables to filter data, include several of them, with INNER JOINS and selecting by filtering:

      CREATE VIEW  view1 AS Select * from SCHEMA.MyVeryLargeTable@EXTERN

      3) Create RDFVIEW on all views (i.e.EXTERNRDF):

      BEGIN

        sem_apis.create_rdfview_model(

          model_name => 'EXTERNRDF',

          tables => SYS.ODCIVarchar2List(

         "RDFEXPLORER". '"view1"',

          "RDFEXPLORER"."view2",

          "RDFEXPLORER"."view3",

          [...],

          "RDFEXPLORER"."viewN-1",

          "RDFEXPLORER"."viewN" ),

          prefix => 'http://Example.org/thatthing',

          options => ' KEY_BASED_REF_PROPERTY  CONFORMANCE=T ');

      END;

       

      3) Publish model with dataset:

      <#oracle> rdf:type oracle:Dataset;

          oracle:connection

          [ a oracle:OracleConnection ;

            oracle:jdbcURL "jdbc:oracle:thin:@localhost:1521:LOCALRDF";

            oracle:User "RDFEXPLORER" ;

            oracle:Password "welcome"

          ];

      oracle:allGraphs [ oracle:firstModel "EXTERNRDF" ] .