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

[xmlblaster] Xindice-XmlBlaster help needed



Hi All,
I am having a slight problem using Xindice with XmlBlaster, and i was wondering if anyone could possibly help me,i have a very simple program which connects to XmlBlaster locally and then connects to an existing Database (xmldb:xindice:///db/xmlBlaster). However it always fails to connect to the database if i try to connect to xmlblaster first,but when i connect to the database first and then connect to xmlblaster it works, why is this and is there any way around this?? My simple program is shown below.
Regards,
Finbarr O'Brien

import org.xmlBlaster.util.Log;
import org.jutils.init.Args;
import java.net.*;
import org.xmlBlaster.client.protocol.XmlBlasterConnection;
import org.xmlBlaster.engine.persistence.xmldb.xindice.XindiceProxy;
import org.xmlBlaster.util.XmlBlasterException;
import org.xmlBlaster.util.XmlBlasterProperty;
import org.xmldb.api.base.XMLDBException;
import org.jutils.JUtilsException;
public class Test {
public static void main(String []args)
{
connectdb();
connectXmlblaster(args);
}
public static void connectdb()
{
String thiscolPath = XmlBlasterProperty.get("Persistence.Path", "xmldb:xindice:///db");
String thiscolName = XmlBlasterProperty.get("Persistence.Collection", "xmlBlaster");
try
{
XindiceProxy db=new XindiceProxy(thiscolPath+"/"+thiscolName);
}
catch(XmlBlasterException xe)
{
xe.printStackTrace();
}
}
public static void connectXmlblaster(String []args)
{
try{
String loginName = Args.getArg(args, "-name","default");
String passwd = Args.getArg(args, "-passwd","default");
XmlBlasterConnection clientConnection = new XmlBlasterConnection(args);
clientConnection.login(loginName, passwd, null);
}catch(XmlBlasterException xe)
{
xe.printStackTrace();
}
catch(JUtilsException je)
{
je.printStackTrace();
}
}
}



Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more