From: Dmitriy S. <sha...@gm...> - 2013-05-29 12:46:57
|
Do you get same error after data folder cleanup on 2nd run? On Wed, May 29, 2013 at 12:45 PM, minskybelieve <cmg...@gm...> wrote: > I used the exact codes from the link on deployment. > > Reproduce below: > > import org.xmldb.api.DatabaseManager; > import org.xmldb.api.base.Collection; > import org.xmldb.api.base.Database; > import org.exist.xmldb.DatabaseInstanceManager; > public class TestDB { > public static void main(String args[]) throws Exception { > // initialize driver > System.setProperty("exist.home", EXIST_HOME); // i added this to > line to set the location of my conf.xml > Class cl = Class.forName("org.exist.xmldb.DatabaseImpl"); > Database database = (Database)cl.newInstance(); > database.setProperty("create-database", "true"); > DatabaseManager.registerDatabase(database); > > // try to read collection > Collection col = > DatabaseManager.getCollection("xmldb:exist:///db", "admin", > ""); > String resources[] = col.listResources(); > System.out.println("Resources:"); > for (int i = 0; i < resources.length; i++) { > System.out.println(resources[i]); > } > > // shut down the database > DatabaseInstanceManager manager = (DatabaseInstanceManager) > col.getService("DatabaseInstanceManager", "1.0"); > manager.shutdown(); > } > } > -- Dmitriy Shabanov |