From: KevinBenson <km...@ms...> - 2008-03-03 21:30:20
|
A couple of things here. In my embedded webapp the configuraiton property is set all way to the 'conf.xml' not just the path if it is outside my webapp otherwise I set the property to empty/blank string and it will find it in the WEB-INF directory. I don't set exist.home but I have not upgraded to the latest eXist (currently on the one previous). But the main one is the conf_path your getting from the getResource() method I don't think this is right. I tend to grab it from a JNDI property or a properties file under WEB-INF/classes. The method your using I am think via a webapp call will produce some http url and that path is not going to be correct for finding the conf.xml cheers, Kevin titash neogi wrote: > Hi, > > I am getting a XML:DB Exception-Configuration error, when I try to > connect to eXist which is embedded in a web application. > > //Code > > Class cl = Class.forName("org.exist.xmldb.DatabaseImpl"); > Database database = (Database)cl.newInstance(); > database.setProperty("create-database", "true"); > String conf_path = this.getClass().getResource("transforms").getPath(); > conf_path = conf_path.replaceAll("%20", " "); > database.setProperty("exist.home", conf_path); > database.setProperty("configuration",conf_path); > DatabaseManager.registerDatabase(database); > Collection root = > DatabaseManager.getCollection("xmldb:exist:///db","admin","");//Getting > the error here > > Is there any other property that I need to set? Is it necessary to > set the exist.home property? (This code works fine from the > commandline as a simple java app.) > > Thanks for all the help so far. > > Regards, > Titash > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open > > |