[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xmlblaster-devel] Re: switching ORB in Xindice (was: integration of Xindice in xmlBlaster)



Kimbro,

thanks for your answer I'm dividing into two mails now, since topics
become to different now. Btw, I switched to Xindice 1.0rc1 (DarkHorse).

On Thu, 17 Jan 2002, Kimbro Staken wrote:

>
>On Thursday, January 17, 2002, at 12:25 PM, Heinrich Götzger wrote:
>>
>> The Testcase (TestPersistenceXindice.java) is mostly developed and ready
>> to be commited but it rejects to run because of the two ORBs.
>>
>> Now I'm getting into the real issue of the two-ORB-Problem: This test
>> won't run satisfying because the two ORB's disturbing each other as others
>> because of their experience recognized already. Still a lot to learn ;-)
>>
>> How can we proceed?
>>
>> 1. Integrate a different ORB
>>    -> not the best idea
>>
>
>As long as you have a POA compliant ORB this is trivial to do. I've
>switched between OpenORB and JacORB many times while testing and other
>people have used Visibroker as well.

I tried with different orbs: OpenORB, JacORB, Orbacus and the java-builtin
SunORB and got different results. Xindice seems to run with OpenOrb and
SunORB very well, but using JacORB or Orbacus seem not to work.

I added some example as attachment, showing how I testet it. Example1 is
from the Xindice, slightly changed. All the commands I used are in
helloORB.java at the end.


>> 3. Connect to dbXML via XML-Objects or XML-RPC (bypassing CORBA)
>>    does dbXML run without any orb?
>>
>
>You can run it without an ORB, but things like the XML:DB API and the
>command line tools won't work since CORBA is how they communicate with the
>server. If you can do without that functionality, just get rid of
>APIService in system.xml and the server won't load the ORB.
>
>Overall there's a very loose coupling between the server and the network
>API used, there's also a loose coupling between the command line tools and
>the XML:DB APi implementation used. Where there is a tight coupling is
>between the current XML:DB API implementation and the CORBA API service.
>Replace the XML:DB driver impl and provide a different network API for the
>server and you can have everything working without CORBA pretty easily.
>Take a look at the XML:-RPC impl to see how to write a different network
>API. http://sourceforge.net/projects/xindice-xmlrpc/ for Xindice or
>http://www.xmldatabases.org/projects/dbXML-XMLRPC/ for dbXML.
>

I'll take a look into xindice-xmlrpc as well.

regards

Heinrich
--
http://www.xmlBlaster.org
/*
 * dbXML Core - Example Code
 *
 * Copyright (c) 1999-2001 The dbXML Group
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to
 * deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 *    The above copyright notice and this permission notice shall be included
 *       in all copies of substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 *
 * $Id: $
 */

import org.xmldb.api.base.*;
import org.xmldb.api.modules.*;
import org.xmldb.api.*;

/**
 * Simple XML:DB API example to query the database.
 */
public class Example1 {

   public static void perform() throws Exception {
      Collection col = null;
      try {
         String driver = "org.apache.xindice.client.xmldb.DatabaseImpl";
         Class c = Class.forName(driver);

         Database database = (Database) c.newInstance();
         DatabaseManager.registerDatabase(database);
         col =
            //DatabaseManager.getCollection("xmldb:dbxml:///db/root/ocs");
            DatabaseManager.getCollection("xmldb:xindice:///db/xmlBlaster");

         String xpath = "//key[ at oid='amIdurable']";
         // String xpath = "//test[text()='Hello']";
         XPathQueryService service =
            (XPathQueryService) col.getService("XPathQueryService", "1.0");
         ResourceSet resultSet = service.query(xpath);
         ResourceIterator results = resultSet.getIterator();

         while (results.hasMoreResources()) {
            Resource res = results.nextResource();
            System.out.println((String) res.getContent());
         }
      }
      catch (XMLDBException e) {
         System.err.println("XML:DB Exception occured " + e.errorCode + " " +
            e.getMessage());
      }
      finally {
         if (col != null) {
            col.close();
         }
      }
   }
}
// Class to check which orb runs with dbXML/Xindice
import Example1;
import org.apache.xindice.util.XindiceException;

import org.xmldb.api.base.*;
import org.xmldb.api.modules.*;
import org.xmldb.api.DatabaseManager;

// For the XMLDB specific CollectionManager service
import org.apache.xindice.client.xmldb.services.*;
import org.apache.xindice.xml.dom.*;


public class helloORB
{
   static Example1 E = new Example1();

   public static void run() throws Exception {
      System.out.println("\n1");
      System.out.println("org.omg.CORBA.ORBClass: "          + System.getProperty("org.omg.CORBA.ORBClass") );
      System.out.println("org.omg.CORBA.ORBSingletonClass: " + System.getProperty("org.omg.CORBA.ORBSingletonClass") );

      E.perform();

      System.out.println("\n2");
      System.out.println("org.omg.CORBA.ORBClass: "          + System.getProperty("org.omg.CORBA.ORBClass") );
      System.out.println("org.omg.CORBA.ORBSingletonClass: " + System.getProperty("org.omg.CORBA.ORBSingletonClass") );

      //System.setProperty("org.omg.CORBA.ORBClass", "org.jacorb.orb.ORB");
      //System.setProperty("org.omg.CORBA.ORBSingletonClass", "org.jacorb.orb.ORBSingleton");

      System.out.println("\n3");
      System.out.println("org.omg.CORBA.ORBClass: "          + System.getProperty("org.omg.CORBA.ORBClass") );
      System.out.println("org.omg.CORBA.ORBSingletonClass: " + System.getProperty("org.omg.CORBA.ORBSingletonClass") );

      E.perform();

      System.out.println("\n");
   } // end of run

   public static void main(String[] arg) {

      try {
         run();
      } catch (Exception e) {
         System.out.println("Exception: " + e.toString() );
      }
   } // end of main

      /*


  javac -classpath .:xmldb.jar:xindice.jar *.java

  // SunORB (Builtin)
  java -classpath xmldb.jar:xindice.jar:xalan-2.0.1.jar:xerces-1.4.3.jar:. helloORB

  // Orbacus JOB-4.1.0
  java -classpath xmldb.jar:xindice.jar:xalan-2.0.1.jar:xerces-1.4.3.jar:OB.jar:. -Dorg.omg.CORBA.ORBClass=com.ooc.CORBA.ORB  -Dorg.omg.CORBA.ORBSingletonClass=com.ooc.CORBA.ORBSingleton helloORB

  // JacORB V 1.3.30
  java  -classpath jacorb.jar:xmldb.jar:xindice.jar:xalan-2.0.1.jar:xerces-1.4.3.jar:.  -Dorg.omg.CORBA.ORBClass=org.jacorb.orb.ORB -Dorg.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton helloORB

  // openORB
  java -classpath xmldb.jar:xindice.jar:xalan-2.0.1.jar:xerces-1.4.3.jar:openorb-1.2.0.jar:. -Dorg.omg.CORBA.ORBClass=org.openorb.CORBA.ORB -Dorg.omg.CORBA.ORBSingletonClass=org.openorb.CORBA.ORBSingleton helloORB
      */

   /*
   $ ls -1
   Example1.class
   Example1.java
   OB.jar
   helloORB.class
   helloORB.java
   jacorb.jar
   jacorb.properties
   listClasses.class
   listClasses.java
   openorb-1.2.0.jar
   xalan-2.0.1.jar
   xerces-1.4.3.jar
   xindice.jar
   xmldb.jar

   $ java -version
   java version "1.3.0"
   Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
   Java HotSpot(TM) Client VM (build 1.3.0, mixed mode)

   */

} // end of helloORB