From: Василий С. <wst...@gm...> - 2011-11-07 18:46:45
|
Hi! I wil try to start eXist in embedding mode. Do all by this http://demo.exist-db.org/exist/deployment.xml But has no effect. In data dir exist make all files with journal dir. Make .lck files. I try to run exist in eXist sources. Put my class in org.exist.start package and after start Exception in thread "main" java.lang.ClassNotFoundException: org.exist.start.MySecond. Can any help me? my simple code public class StartExist { public static void main(String arg[]) { Collection current = null; try { System.setProperty("exist.home", "/Users/ws/dev/exist/myApp/eXist"); Class<?> cl = Class.forName("org.exist.xmldb.DatabaseImpl"); Database database = (Database) cl.newInstance(); database.setProperty("create-database", "true"); DatabaseManager.registerDatabase(database); current = DatabaseManager.getCollection("xmldb:exist:///db", "admin", ""); String[] list = current.listChildCollections(); for (String name : current.listChildCollections()) try { System.out.println("Collection: " + URLDecoder.decode(name, "utf-8")); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } String[] resources = current.listResources(); for (String name : resources) try { System.out.println("Resource: " + URLDecoder.decode(name, "utf-8")); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (XMLDBException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } try { DatabaseInstanceManager manager = (DatabaseInstanceManager) current.getService("DatabaseInstanceManager", "1.0"); manager.shutdown(); } catch (XMLDBException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } } } here is error log log4j:WARN No appenders could be found for logger (org.exist.util.ConfigurationHelper). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. File lock last access timestamp: 07.11.2011 /Users/ws/Apps/oxygen/plugins/eXist/data/dbx_dir.lck Found a stale lockfile. Trying to remove it: /Users/ws/Apps/oxygen/plugins/eXist/data/dbx_dir.lck File lock last access timestamp: 07.11.2011 /Users/ws/Apps/oxygen/plugins/eXist/data/journal/journal.lck Found a stale lockfile. Trying to remove it: /Users/ws/Apps/oxygen/plugins/eXist/data/journal/journal.lck org.xmldb.api.base.XMLDBException: Can not access to local database instance at org.exist.xmldb.DatabaseImpl.getLocalCollection(DatabaseImpl.java:184) at org.exist.xmldb.DatabaseImpl.getCollection(DatabaseImpl.java:156) at org.exist.xmldb.DatabaseImpl.getCollection(DatabaseImpl.java:151) at org.xmldb.api.DatabaseManager.getCollection(Unknown Source) at ru.wstarcev.oxygen.plugin.exist.StartExist.main(StartExist.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) Caused by: org.exist.EXistException: database instance 'exist' is not available at org.exist.storage.BrokerPool.getInstance(BrokerPool.java:306) at org.exist.xmldb.DatabaseImpl.getLocalCollection(DatabaseImpl.java:182) ... 9 more [B@52c00025org.exist.EXistException: database instance 'exist' is not available at org.exist.storage.BrokerPool.getInstance(BrokerPool.java:306) at org.exist.xmldb.DatabaseImpl.getLocalCollection(DatabaseImpl.java:182) at org.exist.xmldb.DatabaseImpl.getCollection(DatabaseImpl.java:156) at org.exist.xmldb.DatabaseImpl.getCollection(DatabaseImpl.java:151) at org.xmldb.api.DatabaseManager.getCollection(Unknown Source) at ru.wstarcev.oxygen.plugin.exist.StartExist.main(StartExist.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) Caused by: org.exist.EXistException: database instance 'exist' is not available at org.exist.storage.BrokerPool.getInstance(BrokerPool.java:306) at org.exist.xmldb.DatabaseImpl.getLocalCollection(DatabaseImpl.java:182) at org.exist.xmldb.DatabaseImpl.getCollection(DatabaseImpl.java:156) at org.exist.xmldb.DatabaseImpl.getCollection(DatabaseImpl.java:151) at org.xmldb.api.DatabaseManager.getCollection(Unknown Source) at ru.wstarcev.oxygen.plugin.exist.StartExist.main(StartExist.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -- С наилучшими пожеланиями Василий Старцев |