1 2 Previous Next 16 Replies Latest reply: May 31, 2013 2:22 AM by user571093 RSS

    same jena code loading ontology won't work in 11.2.0.2 in linux

    user571093
      Hi,

      The sample code of loading univ-bench.owl ontology into database won't work in oracle 11..2.0.2 in my linux guest system. However, it is working perfectly in oracle 11.2.0.1 in windows environment. The error I got is:
      WARN [main] (SimpleLog.java:93) - Could not set namespace prefix
      java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

      I recreated the table and model a couple of times accordint to a tutorial but it still failed. Is it an incompatibility issue? Thanks a lot.

      Hong
        • 1. Re: same jena code loading ontology won't work in 11.2.0.2 in linux
          alwu-Oracle
          Hi,

          Jena Adapter works fine with 11.2.0.2 on Linux. Actually, the software was developed mainly on Linux platforms.

          That error message is not specific enough.

          Can you try adding a triple using SQL*Plus and see if it goes through?

          Thanks,

          Zhe
          • 2. Re: same jena code loading ontology won't work in 11.2.0.2 in linux
            user571093
            Hi Zhe,
            The sample code in Example 7-16 Load OWL Ontology and Perform OWLPrime inference doesn't work in 11.2.0.2 in my linux guest system. However, the code for incremental, batch or bulk loading in Example 7-17 Bulk Load OWL Ontology and Perform OWLPrime inference works like charm. The error for runnig the previous one is:

            WARN [main] (SimpleLog.java:93) - Could not set namespace prefix
            java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

                 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
                 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
                 at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
                 at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
                 at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
                 at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
                 at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
                 at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1010)
                 at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)
                 at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576)
                 at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3677)
                 at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
                 at oracle.spatial.rdf.client.jena.Oracle.executeSQL(Oracle.java:602)
                 at oracle.spatial.rdf.client.jena.OraclePrefixMapping.setNamespacePrefix(OraclePrefixMapping.java:202)
                 at oracle.spatial.rdf.client.jena.OraclePrefixMapping.setNsPrefix(OraclePrefixMapping.java:222)
                 at com.hp.hpl.jena.rdf.arp.JenaHandler.startPrefixMapping(JenaHandler.java:94)
                 at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.startPrefixMapping(XMLHandler.java:110)
                 at org.apache.xerces.parsers.AbstractSAXParser.startNamespaceMapping(Unknown Source)
                 at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
                 at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(Unknown Source)
                 at org.apache.xerces.impl.XMLNamespaceBinder.startElement(Unknown Source)
                 at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
                 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
                 at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)
                 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
                 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
                 at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
                 at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
                 at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
                 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
                 at com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.parse(RDFXMLParser.java:142)
                 at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:158)
                 at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:145)
                 at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:215)
                 at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:197)
                 at myProject.LoadUniv3.main(LoadUniv3.java:24)
            WARN [main] (SimpleLog.java:93) - Could not set namespace prefix rdf
            java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

                 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
                 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
                 at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
                 at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
                 at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
                 at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
                 at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
                 at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1010)
                 at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)
                 at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576)
                 at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3677)
                 at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
                 at oracle.spatial.rdf.client.jena.Oracle.executeSQL(Oracle.java:602)
                 at oracle.spatial.rdf.client.jena.OraclePrefixMapping.setNamespacePrefix(OraclePrefixMapping.java:202)
                 at oracle.spatial.rdf.client.jena.OraclePrefixMapping.setNsPrefix(OraclePrefixMapping.java:222)
                 at com.hp.hpl.jena.rdf.arp.JenaHandler.startPrefixMapping(JenaHandler.java:94)
                 at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.startPrefixMapping(XMLHandler.java:110)
                 at org.apache.xerces.parsers.AbstractSAXParser.startNamespaceMapping(Unknown Source)
                 at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
                 at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(Unknown Source)
                 at org.apache.xerces.impl.XMLNamespaceBinder.startElement(Unknown Source)
                 at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
                 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
                 at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)
                 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
                 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
                 at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
                 at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
                 at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
                 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
                 at com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.parse(RDFXMLParser.java:142)
                 at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:158)
                 at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:145)
                 at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:215)
                 at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:197)
                 at myProject.LoadUniv3.main(LoadUniv3.java:24)
            WARN [main] (SimpleLog.java:93) - Could not set namespace prefix rdfs
            java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

                 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
                 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
                 at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
                 at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
                 at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
                 at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
                 at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
                 at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1010)
                 at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)
                 at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576)
                 at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3677)
                 at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
                 at oracle.spatial.rdf.client.jena.Oracle.executeSQL(Oracle.java:602)
                 at oracle.spatial.rdf.client.jena.OraclePrefixMapping.setNamespacePrefix(OraclePrefixMapping.java:202)
                 at oracle.spatial.rdf.client.jena.OraclePrefixMapping.setNsPrefix(OraclePrefixMapping.java:222)
                 at com.hp.hpl.jena.rdf.arp.JenaHandler.startPrefixMapping(JenaHandler.java:94)
                 at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.startPrefixMapping(XMLHandler.java:110)
                 at org.apache.xerces.parsers.AbstractSAXParser.startNamespaceMapping(Unknown Source)
                 at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
                 at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(Unknown Source)
                 at org.apache.xerces.impl.XMLNamespaceBinder.startElement(Unknown Source)
                 at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
                 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
                 at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)
                 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
                 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
                 at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
                 at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
                 at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
                 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
                 at com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.parse(RDFXMLParser.java:142)
                 at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:158)
                 at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:145)
                 at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:215)
                 at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:197)
                 at myProject.LoadUniv3.main(LoadUniv3.java:24)
            WARN [main] (SimpleLog.java:93) - Could not set namespace prefix owl
            java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

                 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
                 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
                 at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
                 at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
                 at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
                 at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
                 at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
                 at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1010)
                 at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)
                 at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576)
                 at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3677)
                 at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
                 at oracle.spatial.rdf.client.jena.Oracle.executeSQL(Oracle.java:602)
                 at oracle.spatial.rdf.client.jena.OraclePrefixMapping.setNamespacePrefix(OraclePrefixMapping.java:202)
                 at oracle.spatial.rdf.client.jena.OraclePrefixMapping.setNsPrefix(OraclePrefixMapping.java:222)
                 at com.hp.hpl.jena.rdf.arp.JenaHandler.startPrefixMapping(JenaHandler.java:94)
                 at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.startPrefixMapping(XMLHandler.java:110)
                 at org.apache.xerces.parsers.AbstractSAXParser.startNamespaceMapping(Unknown Source)
                 at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
                 at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(Unknown Source)
                 at org.apache.xerces.impl.XMLNamespaceBinder.startElement(Unknown Source)
                 at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
                 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
                 at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)
                 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
                 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
                 at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
                 at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
                 at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
                 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
                 at com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.parse(RDFXMLParser.java:142)
                 at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:158)
                 at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:145)
                 at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:215)
                 at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:197)
                 at myProject.LoadUniv3.main(LoadUniv3.java:24)
            Exception in thread "main" java.lang.NoClassDefFoundError: com/hp/hpl/jena/sparql/algebra/opt/Rewrite
                 at java.lang.ClassLoader.defineClass1(Native Method)
                 at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
                 at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
                 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
                 at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
                 at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
                 at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
                 at java.security.AccessController.doPrivileged(Native Method)
                 at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
                 at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                 at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
                 at oracle.spatial.rdf.client.jena.QueryEngineSem.modifyOp(QueryEngineSem.java:179)
                 at com.hp.hpl.jena.sparql.engine.QueryEngineBase.createPlan(QueryEngineBase.java:104)
                 at com.hp.hpl.jena.sparql.engine.QueryEngineBase.getPlan(QueryEngineBase.java:97)
                 at oracle.spatial.rdf.client.jena.QueryEngineSem$1.create(QueryEngineSem.java:202)
                 at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.getPlan(QueryExecutionBase.java:426)
                 at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.startQueryIterator(QueryExecutionBase.java:400)
                 at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execResultSet(QueryExecutionBase.java:408)
                 at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execSelect(QueryExecutionBase.java:135)
                 at myProject.LoadUniv3.main(LoadUniv3.java:37)
            Caused by: java.lang.ClassNotFoundException: com.hp.hpl.jena.sparql.algebra.opt.Rewrite
                 at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
                 at java.security.AccessController.doPrivileged(Native Method)
                 at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
                 at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                 at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
                 ... 21 more
            Thanks a lot.

            Hong
            • 3. Re: same jena code loading ontology won't work in 11.2.0.2 in linux
              alwu-Oracle
              Hi Hong,

              I see two issues here.

              1) ORA-00942: table or view does not exist
              2) java.lang.NoClassDefFoundError: com/hp/hpl/jena/sparql/algebra/opt/Rewrite

              1) happens during persisting namespace mapping to the database. Somehow, the table
              is not there. However, the program will continue because setting NS does not affect the core logic.
              How did you create this model? Can you run the same code with a new model name?

              2) seems to suggest that there's a mismatch of the Jena libraries you are using.

              Hope it helps,

              Zhe Wu
              • 4. Re: same jena code loading ontology won't work in 11.2.0.2 in linux
                user571093
                Hi Zhe,

                I recreated a new model name using execute sem_apis.create_sem_model function but,it didn't work in the same code. I also tried a new model name argument in the run configuration of the same code in eclipse without explicitly using sem_apis.create_sem_model function. It failed as well; but, I got two extra table univ3_ns and univ3_tpl. My jena library is 2.6.4 according to the online guide. So, what is the correct version for the oracle 11.2.0.2. Thanks a lot.

                Hong
                • 5. Re: same jena code loading ontology won't work in 11.2.0.2 in linux
                  alwu-Oracle
                  Hi Hong,

                  I just created a brand new 11202 database on Linux platform and initialized the semantic network.

                  % sqlplus / as sysdba
                  SQL*Plus: Release 11.2.0.2.0 Production on Tue May 28 22:20:38 2013
                  Copyright (c) 1982, 2010, Oracle. All rights reserved.
                  Connected to:
                  Oracle Database 11g Enterprise Edition Release *11.2.0.2.0 - Production*
                  With the Partitioning, Data Mining and Real Application Testing options
                  SQL>

                  Test6 (Example7-16) runs fine without any problems.

                  ARQ-2.8.8/% /usr/local/packages/jdk16/bin/java -classpath ./:lib/'*' Test6 jdbc:oracle:thin:@localhost:<port>:<sid> scott tiger M1
                  Asserted triples count: 293
                  Asserted + Infered triples count: 340

                  Could you double check if the you have all the right libraries on your classpath?

                  Thanks,

                  Zhe Wu
                  • 6. Re: same jena code loading ontology won't work in 11.2.0.2 in linux
                    user571093
                    Hi Zhe,

                    That is what I got in my classpath:

                    java version "1.6.0_20"
                    Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
                    Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)

                    JAVA_HOME=/usr/java/latest

                    CLASSPATH=/home/oracle/app/oracle/product/11.2.0/dbhome_2/ucp/lib/ucp.jar:/home/oracle/app/oracle/product/11.2.0/dbhome_2/jdbc/lib/ojdbc6.jar:/home/oracle/app/oracle/product/TimesTen/tt1122/lib/ttjdbc6.jar:/home/oracle/app/oracle/product/TimesTen/tt1122/lib/orai18n.jar:/home/oracle/app/oracle/product/TimesTen/tt1122/lib/timestenjmsxla.jar:/home/oracle/app/oracle/product/TimesTen/tt1122/3rdparty/jms1.1/lib/jms.jar:.:/home/oracle/app/oracle/product/11.2.0/dbhome_2/ucp/lib/ucp.jar:/home/oracle/app/oracle/product/11.2.0/dbhome_2/jdbc/lib/ojdbc6.jar

                    The jena library is 2.6.4 that is imported to eclipse as a user library. Thanks a lot.

                    Hong
                    • 7. Re: same jena code loading ontology won't work in 11.2.0.2 in linux
                      user571093
                      Hi Zhe,

                      I also added the java library to the classpath in .bashrc file:
                      /usr/java/latest/bin:/home/JENA_DIR/Jena-2.6.4/bin
                      but, it won't work. I am not sure is the right way to set the java classpath in linux? Thanks a lot.

                      Hong
                      • 8. Re: same jena code loading ontology won't work in 11.2.0.2 in linux
                        alwu-Oracle
                        Hi Hong,

                        You can copy the following jar files to your current directory and execute the following commands (as described in the document).

                        <code>
                        javac -classpath ./:./jena-2.6.4.jar:./sdordfclient.jar:./ojdbc6.jar:/slf4j-api-1.5.8.jar:./slf4j-log4j12-1.5.8.jar:./arq-2.8.8.jar:./xercesImpl-2.7.1.jar Test6.java

                        java -classpath ./:./jena-2.6.4.jar:./sdordfclient.jar:./ojdbc6.jar:./slf4j-api-1.5.8.jar:./slf4j-log4j12-1.5.8.jar:./arq-2.8.8.jar:./xercesImpl-2.7.1.jar:./iri-0.8.jar:./icu4j-3.4.4.jar:./log4j-1.2.14.jar Test6 jdbc:oracle:thin:@localhost:1521:orcl scott <password-for-scott> M1
                        </code>

                        Hope it helps,

                        Thanks,

                        Zhe
                        • 9. Re: same jena code loading ontology won't work in 11.2.0.2 in linux
                          user571093
                          Hi Zhe,

                          Do you mean add these jar file in CLASSPATH? I've added these jar files in my CLASSPATH:

                          CLASSPATH=$ORACLE_HOME/ucp/lib/ucp.jar:$ORACLE_HOME/jdbc/lib/ojdbc6.jar:/home/JENA_DIR/Jena-2.6.4/lib/arq-2.8.8.jar:/home/JENA_DIR/Jena-2.6.4/lib/junit-4.5.jar:/home/JENA_DIR/Jena-2.6.4/lib/slf4j-api-1.5.8.jar:/home/JENA_DIR/Jena-2.6.4/lib/icu4j-3.4.4.jar:/home/JENA_DIR/Jena-2.6.4/lib/log4j-1.2.13.jar:/home/JENA_DIR/Jena-2.6.4/lib/slf4j-log4j12-1.5.8.jar:/home/JENA_DIR/Jena-2.6.4/lib/iri-0.8.jar:/home/JENA_DIR/Jena-2.6.4/lib/lucene-core-2.3.1.jar:/home/JENA_DIR/Jena-2.6.4/lib/stax-api-1.0.1.jar:/home/JENA_DIR/Jena-2.6.4/lib/jena-2.6.4.jar:/home/JENA_DIR/Jena-2.6.4/lib/ojdbc6.jar:/home/JENA_DIR/Jena-2.6.4/lib/wstx-asl-3.2.9.jar:/home/JENA_DIR/Jena-2.6.4/lib/jena-2.6.4-tests.jar:/home/JENA_DIR/Jena-2.6.4/lib/sdordf.jar:/home/JENA_DIR/Jena-2.6.4/lib/xercesImpl-2.7.1.jar:$CLASSPATH
                          export CLASSPATH

                          After executed the first command, however, I got errors:

                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:4: package com.hp.hpl.jena.query does not exist
                          import com.hp.hpl.jena.query.*;
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:5: package com.hp.hpl.jena.rdf.model does not exist
                          import com.hp.hpl.jena.rdf.model.Model;
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:6: package com.hp.hpl.jena.util does not exist
                          import com.hp.hpl.jena.util.FileManager;
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:7: package oracle.spatial.rdf.client.jena does not exist
                          import oracle.spatial.rdf.client.jena.*;
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:25: cannot find symbol
                          symbol : class Oracle
                          location: class myProject.LoadUniv3
                          Oracle oracle = new Oracle(szJdbcURL, szUser, szPasswd);
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:25: cannot find symbol
                          symbol : class Oracle
                          location: class myProject.LoadUniv3
                          Oracle oracle = new Oracle(szJdbcURL, szUser, szPasswd);
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:26: cannot find symbol
                          symbol : class Model
                          location: class myProject.LoadUniv3
                          Model model = ModelOracleSem.createOracleSemModel(oracle, szModelName);
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:26: cannot find symbol
                          symbol : variable ModelOracleSem
                          location: class myProject.LoadUniv3
                          Model model = ModelOracleSem.createOracleSemModel(oracle, szModelName);
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:29: cannot find symbol
                          symbol : variable FileManager
                          location: class myProject.LoadUniv3
                          InputStream in = FileManager.get().open("/home/oracle/Desktop/eclipse/dataset/univ-bench2.owl" );
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:38: cannot find symbol
                          symbol : class Query
                          location: class myProject.LoadUniv3
                          Query query = QueryFactory.create(queryString) ;
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:38: cannot find symbol
                          symbol : variable QueryFactory
                          location: class myProject.LoadUniv3
                          Query query = QueryFactory.create(queryString) ;
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:39: cannot find symbol
                          symbol : class QueryExecution
                          location: class myProject.LoadUniv3
                          QueryExecution qexec = QueryExecutionFactory.create(query, model) ;
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:39: cannot find symbol
                          symbol : variable QueryExecutionFactory
                          location: class myProject.LoadUniv3
                          QueryExecution qexec = QueryExecutionFactory.create(query, model) ;
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:43: cannot find symbol
                          symbol : class ResultSet
                          location: class myProject.LoadUniv3
                          ResultSet results = qexec.execSelect() ;
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:45: cannot find symbol
                          symbol : class QuerySolution
                          location: class myProject.LoadUniv3
                          QuerySolution soln = results.nextSolution() ;
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:54: cannot find symbol
                          symbol : class Attachment
                          location: class myProject.LoadUniv3
                          Attachment attachment = Attachment.createInstance(
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:56: cannot find symbol
                          symbol : variable InferenceMaintenanceMode
                          location: class myProject.LoadUniv3
                          InferenceMaintenanceMode.NO_UPDATE, QueryOptions.DEFAULT);
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:56: cannot find symbol
                          symbol : variable QueryOptions
                          location: class myProject.LoadUniv3
                          InferenceMaintenanceMode.NO_UPDATE, QueryOptions.DEFAULT);
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:54: cannot find symbol
                          symbol : variable Attachment
                          location: class myProject.LoadUniv3
                          Attachment attachment = Attachment.createInstance(
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:58: cannot find symbol
                          symbol : class GraphOracleSem
                          location: class myProject.LoadUniv3
                          GraphOracleSem graph = new GraphOracleSem(oracle, szModelName, attachment);
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:58: cannot find symbol
                          symbol : class GraphOracleSem
                          location: class myProject.LoadUniv3
                          GraphOracleSem graph = new GraphOracleSem(oracle, szModelName, attachment);
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:62: cannot find symbol
                          symbol : variable QueryFactory
                          location: class myProject.LoadUniv3
                          query = QueryFactory.create(queryString) ;
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:63: cannot find symbol
                          symbol : class ModelOracleSem
                          location: class myProject.LoadUniv3
                          qexec = QueryExecutionFactory.create(query,new ModelOracleSem(graph)) ;
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:63: cannot find symbol
                          symbol : variable QueryExecutionFactory
                          location: class myProject.LoadUniv3
                          qexec = QueryExecutionFactory.create(query,new ModelOracleSem(graph)) ;
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:67: cannot find symbol
                          symbol : class ResultSet
                          location: class myProject.LoadUniv3
                          ResultSet results = qexec.execSelect() ;
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:69: cannot find symbol
                          symbol : class QuerySolution
                          location: class myProject.LoadUniv3
                          QuerySolution soln = results.nextSolution() ;
                          ^
                          /home/oracle/Desktop/eclipse/Jena_Oracle/src/myProject/LoadUniv3.java:79: cannot find symbol
                          symbol : variable OracleUtils
                          location: class myProject.LoadUniv3
                          OracleUtils.dropSemanticModel(oracle, szModelName);
                          ^
                          27 errors

                          I cannot figure out what's wrong with my java library settings. Thanks a lot for help.

                          Hong
                          • 10. Re: same jena code loading ontology won't work in 11.2.0.2 in linux
                            alwu-Oracle
                            Hi,

                            Yes. You need to add those libraries to your CLASSPATH.

                            I would suggest you do "echo $CLASSPATH" and then check each element in the classpath and make sure the element (usually a jar file) does exist.

                            e.g.
                            ls -l /home/JENA_DIR/Jena-2.6.4/lib/jena-2.6.4.jar

                            Thanks,

                            Zhe Wu
                            • 11. Re: same jena code loading ontology won't work in 11.2.0.2 in linux
                              user571093
                              Hi Zhe,

                              I added these jar files in my CLASSPATH; but, the programm still failed. I checked the CLASSPATH and all jar files are there:
                              $ echo $CLASSPATH
                              /home/oracle/app/oracle/product/11.2.0/dbhome_2/ucp/lib/ucp.jar:/home/oracle/app/oracle/product/11.2.0/dbhome_2/jdbc/lib/ojdbc6.jar:/home/JENA_DIR/Jena-2.6.4/lib/arq-2.8.8.jar:/home/JENA_DIR/Jena-2.6.4/lib/junit-4.5.jar:/home/JENA_DIR/Jena-2.6.4/lib/slf4j-api-1.5.8.jar:/home/JENA_DIR/Jena-2.6.4/lib/icu4j-3.4.4.jar:/home/JENA_DIR/Jena-2.6.4/lib/log4j-1.2.13.jar:/home/JENA_DIR/Jena-2.6.4/lib/slf4j-log4j12-1.5.8.jar:/home/JENA_DIR/Jena-2.6.4/lib/iri-0.8.jar:/home/JENA_DIR/Jena-2.6.4/lib/lucene-core-2.3.1.jar:/home/JENA_DIR/Jena-2.6.4/lib/stax-api-1.0.1.jar:/home/JENA_DIR/Jena-2.6.4/lib/jena-2.6.4.jar:/home/JENA_DIR/Jena-2.6.4/lib/ojdbc6.jar:/home/JENA_DIR/Jena-2.6.4/lib/wstx-asl-3.2.9.jar:/home/JENA_DIR/Jena-2.6.4/lib/jena-2.6.4-tests.jar:/home/JENA_DIR/Jena-2.6.4/lib/sdordf.jar:/home/JENA_DIR/Jena-2.6.4/lib/xercesImpl-2.7.1.jar:/home/oracle/app/oracle/product/TimesTen/tt1122/lib/ttjdbc6.jar:/home/oracle/app/oracle/product/TimesTen/tt1122/lib/orai18n.jar:/home/oracle/app/oracle/product/TimesTen/tt1122/lib/timestenjmsxla.jar:/home/oracle/app/oracle/product/TimesTen/tt1122/3rdparty/jms1.1/lib/jms.jar:.:/home/oracle/app/oracle/product/11.2.0/dbhome_2/ucp/lib/ucp.jar:/home/oracle/app/oracle/product/11.2.0/dbhome_2/jdbc/lib/ojdbc6.jar:/home/JENA_DIR/Jena-2.6.4/lib/arq-2.8.8.jar:/home/JENA_DIR/Jena-2.6.4/lib/junit-4.5.jar:/home/JENA_DIR/Jena-2.6.4/lib/slf4j-api-1.5.8.jar:/home/JENA_DIR/Jena-2.6.4/lib/icu4j-3.4.4.jar:/home/JENA_DIR/Jena-2.6.4/lib/log4j-1.2.13.jar:/home/JENA_DIR/Jena-2.6.4/lib/slf4j-log4j12-1.5.8.jar:/home/JENA_DIR/Jena-2.6.4/lib/iri-0.8.jar:/home/JENA_DIR/Jena-2.6.4/lib/lucene-core-2.3.1.jar:/home/JENA_DIR/Jena-2.6.4/lib/stax-api-1.0.1.jar:/home/JENA_DIR/Jena-2.6.4/lib/jena-2.6.4.jar:/home/JENA_DIR/Jena-2.6.4/lib/ojdbc6.jar:/home/JENA_DIR/Jena-2.6.4/lib/wstx-asl-3.2.9.jar:/home/JENA_DIR/Jena-2.6.4/lib/jena-2.6.4-tests.jar:/home/JENA_DIR/Jena-2.6.4/lib/sdordf.jar:/home/JENA_DIR/Jena-2.6.4/lib/xercesImpl-2.7.1.jar

                              and, the jena-2.6.4. jar is in the directory as well.
                              $ ls -l /home/JENA_DIR/Jena-2.6.4/lib/jena-2.6.4.jar
                              -rwxrwx--- 1 oracle oracle 1903761 Dec 11 2010 /home/JENA_DIR/Jena-2.6.4/lib/jena-2.6.4.jar

                              Thanks a lot for your patience.

                              Hong
                              • 12. Re: same jena code loading ontology won't work in 11.2.0.2 in linux
                                user571093
                                Hi Zhe,

                                Can you pls check these jar files contained in my jena directory if they are the correct version.

                                -rwxrwx--- 1 oracle oracle 2247124 Apr 20 2011 arq-2.8.8.jar
                                -rwxrwx--- 1 oracle oracle 3233439 Aug 25 2010 icu4j-3.4.4.jar
                                -rwxrwx--- 1 oracle oracle 151589 Aug 25 2010 iri-0.8.jar
                                -rwxrwx--- 1 oracle oracle 1903761 Dec 11 2010 jena-2.6.4.jar
                                -rwxrwx--- 1 oracle oracle 1507851 Dec 11 2010 jena-2.6.4-tests.jar
                                -rwxrwx--- 1 oracle oracle 198945 Aug 27 2010 junit-4.5.jar
                                -rwxrwx--- 1 oracle oracle 358180 Aug 25 2010 log4j-1.2.13.jar
                                -rwxrwx--- 1 oracle oracle 665064 Aug 1 2009 lucene-core-2.3.1.jar
                                -rw-r--r-- 1 oracle oracle 2152051 Aug 14 2010 ojdbc6.jar
                                -rw-r--r-- 1 oracle oracle 235498 Aug 14 2010 sdordf.jar
                                -rwxrwx--- 1 oracle oracle 23445 Aug 25 2010 slf4j-api-1.5.8.jar
                                -rwxrwx--- 1 oracle oracle 9679 Aug 25 2010 slf4j-log4j12-1.5.8.jar
                                -rwxrwx--- 1 oracle oracle 26514 Aug 1 2009 stax-api-1.0.1.jar
                                -rwxrwx--- 1 oracle oracle 524224 Aug 1 2009 wstx-asl-3.2.9.jar
                                -rwxrwx--- 1 oracle oracle 1203860 Aug 25 2010 xercesImpl-2.7.1.jar

                                Thanks a lot.

                                Hong

                                Edited by: user571093 on May 30, 2013 3:17 PM
                                • 13. Re: same jena code loading ontology won't work in 11.2.0.2 in linux
                                  alwu-Oracle
                                  Hi Hong,

                                  They look fine to me.

                                  Maybe we can try this first on your computer.

                                  cd /home/JENA_DIR/Jena-2.6.4/lib/
                                  javac -classpath ./:./jena-2.6.4.jar:./sdordfclient.jar:./ojdbc6.jar:/slf4j-api-1.5.8.jar:./slf4j-log4j12-1.5.8.jar:./arq-2.8.8.jar:./xercesImpl-2.7.1.jar:./jena-2.6.4.jar Test6.java

                                  Does it compile? Please make sure to copy sdordfclient.jar to the above directory as well. And also make sure to use
                                  JDK6.

                                  Thanks,

                                  Zhe
                                  • 14. Re: same jena code loading ontology won't work in 11.2.0.2 in linux
                                    user571093
                                    Hi Zhe,

                                    Sorry for the late reply. I just experienced a connection problem to oracle database. It said the network adapter couldn't be established. the connection to sql developer is ok now; but, the OEM console still won't start despite I $ emctl start dbconsole. It really confused me. javac did compile sucessfully this time. however, when I run the program in command line, it still failed with these errors:

                                    java.lang.ClassNotFoundException: home.oracle.Desktop.eclipse.Jena_Oracle.bin.myProject.LoadUniv3
                                    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
                                    at java.security.AccessController.doPrivileged(Native Method)
                                    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
                                    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                                    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                                    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
                                    Could not find the main class: home/oracle/Desktop/eclipse/Jena_Oracle/bin/myProject/LoadUniv3. Program will exit.

                                    Thanks a lot.

                                    Hong
                                    1 2 Previous Next