java - Opening OrientDB Database in Eclipse Maven project throws errors -
the error getting follows:
" aug 25, 2015 1:47:41 pm com.orientechnologies.common.log.ologmanager log info: orientdb auto-config diskcache=4,161mb (heap=1,776mb os=7,985mb disk=416,444mb) aug 25, 2015 1:47:41 pm com.orientechnologies.common.log.ologmanager log warning: segment file 'database.ocf' not closed correctly last time exception in thread "main" com.orientechnologies.common.exception.oexception: error on creation
of shared resource @ com.orientechnologies.common.concur.resource.osharedcontainerimpl.getresource(osharedcontainerimpl.java:55) @ com.orientechnologies.orient.core.metadata.ometadatadefault.init(ometadatadefault.java:175) @ com.orientechnologies.orient.core.metadata.ometadatadefault.load(ometadatadefault.java:77) @ com.orientechnologies.orient.core.db.document.odatabasedocumenttx.initatfirstopen(odatabasedocumenttx.java:2633) @ com.orientechnologies.orient.core.db.document.odatabasedocumenttx.open(odatabasedocumenttx.java:254) @ arss.db.main(db.java:17) caused by: com.orientechnologies.orient.core.exception.orecordnotfoundexception: record id '#0:1' not found @ com.orientechnologies.orient.core.record.orecordabstract.reload(orecordabstract.java:266) @ com.orientechnologies.orient.core.record.impl.odocument.reload(odocument.java:665) @ com.orientechnologies.orient.core.type.odocumentwrapper.reload(odocumentwrapper.java:91) @ com.orientechnologies.orient.core.type.odocumentwrappernoclass.reload(odocumentwrappernoclass.java:73) @ com.orientechnologies.orient.core.metadata.schema.oschemashared.load(oschemashared.java:786) @ com.orientechnologies.orient.core.metadata.ometadatadefault$1.call(ometadatadefault.java:180) @ com.orientechnologies.orient.core.metadata.ometadatadefault$1.call(ometadatadefault.java:175) @ com.orientechnologies.common.concur.resource.osharedcontainerimpl.getresource(osharedcontainerimpl.java:53) ... 5 more caused by: com.orientechnologies.orient.core.exception.odatabaseexception: error on retrieving record #0:1 (cluster: internal) @ com.orientechnologies.orient.core.db.document.odatabasedocumenttx.executereadrecord(odatabasedocumenttx.java:1605) @ com.orientechnologies.orient.core.tx.otransactionnotx.loadrecord(otransactionnotx.java:80) @ com.orientechnologies.orient.core.db.document.odatabasedocumenttx.reload(odatabasedocumenttx.java:1453) @ com.orientechnologies.orient.core.db.document.odatabasedocumenttx.reload(odatabasedocumenttx.java:117) @ com.orientechnologies.orient.core.record.orecordabstract.reload(orecordabstract.java:260) ... 12 more caused by: java.lang.nosuchmethoderror: com.orientechnologies.common.concur.lock.onewlockmanager.tryacquiresharedlock(ljava/lang/object;j)z @ com.orientechnologies.orient.core.storage.impl.local.oabstractpaginatedstorage.acquirereadlock(oabstractpaginatedstorage.java:1301) @ com.orientechnologies.orient.core.tx.otransactionabstract.lockrecord(otransactionabstract.java:120) @ com.orientechnologies.orient.core.id.orecordid.lock(orecordid.java:282) @ com.orientechnologies.orient.core.storage.impl.local.oabstractpaginatedstorage.lockrecord(oabstractpaginatedstorage.java:1784) @ com.orientechnologies.orient.core.storage.impl.local.oabstractpaginatedstorage.readrecord(oabstractpaginatedstorage.java:1424) @ com.orientechnologies.orient.core.storage.impl.local.oabstractpaginatedstorage.readrecord(oabstractpaginatedstorage.java:697) @ com.orientechnologies.orient.core.db.document.odatabasedocumenttx.executereadrecord(odatabasedocumenttx.java:1572) ... 16 more"
the code use is:
package arss; import com.orientechnologies.orient.core.config.oglobalconfiguration; import com.orientechnologies.orient.core.db.document.odatabasedocumenttx; import com.orientechnologies.orient.core.record.impl.odocument; import com.orientechnologies.orient.core.serialization.serializer.record.orecordserializerfactory; import com.orientechnologies.orient.core.serialization.serializer.record.binary.orecordserializerbinary; import com.orientechnologies.orient.core.serialization.serializer.record.string.orecordserializerschemaaware2csv; public class db { public static void main(string[] args) { odatabasedocumenttx db = new odatabasedocumenttx("plocal:c:/ar/ar/newfolder/orientdb-community-2.0.3_s/databases/gratefuldeadconcerts").open("admin", "admin"); try { // create new document , fill odocument doc = new odocument("person"); doc.field( "name", "luke" ); doc.field( "surname", "skywalker" ); doc.field( "city", new odocument("city").field("name","rome").field("country", "italy") ); // save document doc.save(); db.close(); } { db.close(); } } }"
not sure if need .flush odocuments, should up. (or if save equivalent , okay)
from 2 errors lines:
warning: segment file 'database.ocf' not closed correctly last time
and
com.orientechnologies.orient.core.db.document.odatabasedocumenttx.executereadrecord(odatabasedocumenttx.java:1572) ... 16 more"
i think has database.ocf file itself. dont know if helps, try opening manually, preferable with/without admin , close again. ("have tried turning off , on again?")
if there still erorr, check if different one.
Comments
Post a Comment