You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Torsten Steinert <To...@web.de> on 2004/02/19 12:56:42 UTC

Problem getting access to embeded xindice 1.1b3

Hi,

i am trying to access my xindice 1.1b3 database using embeded mode and get
the following exception:
There were 10 errors:
1)
testInit(de.fhg.fokus.SDO.ContextServer.TestXindiceDataStore)java.lang.Excep
t
ion: can not conntext to database using
xmldb:xindice-embed:///db/testDataStore
        at
de.fhg.fokus.SDO.ContextServer.XindiceDataStore.init(XindiceDataStore
.java:85)
        at
de.fhg.fokus.SDO.ContextServer.TestXindiceDataStore.setUp(TestXindice
DataStore.java:49)


First question: which Database (driver?) to use. Shown below is the code i
use to access the database.
I use org.apache.xindice.client.xmldb.embed.DatabaseImpl, but the embeded
test uses only
org.apache.xindice.client.xmldb.DatabaseImpl (without embed). Does it matter
which database class to use?


      // loading driver
      String driver = "org.apache.xindice.client.xmldb.embed.DatabaseImpl";
      Class c = Class.forName(driver);

      // register database
      database = (Database) c.newInstance();
      DatabaseManager.registerDatabase(database);

      // get collection
      String db_uri = "xmldb:xindice-embed:///db/testDataStore";
      col = DatabaseManager.getCollection(db_uri);


Second question: for the embeded mode, must the xindice database be running
in a servlet container (Tomcat)?

Third question: when using the commandline tool (tomcat is not running):
xindice lc -v -l -c /db
gives the following result:

[INFO] DatabaseImpl - -Specified configuration file:
'c:\programme\xindice\\conf
ig\system.xml'
[INFO] Database - -Database points to
c:\programme\jakarta-tomcat-5\webapp\xindi
ce\web-inf\db
[INFO] Database - -Meta information initialized

        contextDataInfo_rel
        sdoData
        histData_rel
        testDataStore
        relData
        histData_sdo
        system
        contextDataInfo_sdo
        meta

Total collections: 9
[INFO] Collection - -[main] '/db/system/SysConfig' Set document database.xml
[INFO] Collection - -[main] '/db/meta/Metas/system/SysConfig' Set object
databas
e.xml


is the call with the -l option the same as using embeded mode?

Any answers to my questions are appreciated.

Torsten Steinert


Re: Problem getting access to embeded xindice 1.1b3

Posted by Upayavira <uv...@upaya.co.uk>.
Can't answer all of your questions, but here's some...


Torsten Steinert wrote:

>Hi,
>
>i am trying to access my xindice 1.1b3 database using embeded mode and get
>the following exception:
>There were 10 errors:
>1)
>testInit(de.fhg.fokus.SDO.ContextServer.TestXindiceDataStore)java.lang.Excep
>t
>ion: can not conntext to database using
>xmldb:xindice-embed:///db/testDataStore
>        at
>de.fhg.fokus.SDO.ContextServer.XindiceDataStore.init(XindiceDataStore
>.java:85)
>        at
>de.fhg.fokus.SDO.ContextServer.TestXindiceDataStore.setUp(TestXindice
>DataStore.java:49)
>
>
>First question: which Database (driver?) to use. Shown below is the code i
>use to access the database.
>I use org.apache.xindice.client.xmldb.embed.DatabaseImpl, but the embeded
>test uses only
>org.apache.xindice.client.xmldb.DatabaseImpl (without embed). Does it matter
>which database class to use?
>
>
>      // loading driver
>      String driver = "org.apache.xindice.client.xmldb.embed.DatabaseImpl";
>      Class c = Class.forName(driver);
>
>      // register database
>      database = (Database) c.newInstance();
>      DatabaseManager.registerDatabase(database);
>
>      // get collection
>      String db_uri = "xmldb:xindice-embed:///db/testDataStore";
>      col = DatabaseManager.getCollection(db_uri);
>  
>
Don't know which you _should_ use, but I do:

import org.apache.xindice.client.xmldb.embed.DatabaseImpl;
DatabaseManager.registerDatabase(new DatabaseImpl());
and use xmldb:xindice-embed:///

>
>Second question: for the embeded mode, must the xindice database be running
>in a servlet container (Tomcat)?
>  
>
No, it _should not_ be running as a servlet. Basic rule is: only one JVM 
accessing the db directly via embedded mode. If you need more than one, 
use the Xindice servlet, and use XMLRPC (thus, you still maintain the 
one JVM rule, i.e. only the servlet now).

>Third question: when using the commandline tool (tomcat is not running):
>xindice lc -v -l -c /db
>gives the following result:
>
>[INFO] DatabaseImpl - -Specified configuration file:
>'c:\programme\xindice\\conf
>ig\system.xml'
>[INFO] Database - -Database points to
>c:\programme\jakarta-tomcat-5\webapp\xindi
>ce\web-inf\db
>[INFO] Database - -Meta information initialized
>
>        contextDataInfo_rel
>        sdoData
>        histData_rel
>        testDataStore
>        relData
>        histData_sdo
>        system
>        contextDataInfo_sdo
>        meta
>
>Total collections: 9
>[INFO] Collection - -[main] '/db/system/SysConfig' Set document database.xml
>[INFO] Collection - -[main] '/db/meta/Metas/system/SysConfig' Set object
>databas
>e.xml
>
>
>is the call with the -l option the same as using embeded mode?
>  
>
Yup.

>Any answers to my questions are appreciated.
>  
>
Hope this helps.

Upayavira