Error in connecting plocal by OrientgraphFactory

701 views
Skip to first unread message

Shishya

unread,
Mar 12, 2014, 2:41:12 AM3/12/14
to orient-...@googlegroups.com
I get the following error on connecting plocal by graphFactory.
Code


        OrientGraphFactory factory = new OrientGraphFactory("plocal:/home/db/releases/orientdb-community-1.7-rc1/databases/test2","admin","admin").setupPool(1, 10);
        factory.getTx().getRawGraph().declareIntent(new OIntentMassiveInsert());
        OrientGraph graph = factory.getTx();

        System.out.println("Connected");
 



Mar 12, 2014 12:08:08 PM com.orientechnologies.common.log.OLogManager log
WARNING: Sun Unsafe direct  memory implementation is going to be used, this implementation is not stable so please use JNA version instead.
Exception in thread "main" com.orientechnologies.common.exception.OException: Error on creation of shared resource
at com.orientechnologies.common.concur.resource.OSharedContainerImpl.getResource(OSharedContainerImpl.java:55)
at com.orientechnologies.orient.core.metadata.OMetadataDefault.init(OMetadataDefault.java:110)
at com.orientechnologies.orient.core.metadata.OMetadataDefault.load(OMetadataDefault.java:68)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.open(ODatabaseRecordAbstract.java:161)
at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:54)
at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getDatabase(OrientGraphFactory.java:67)
at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.setupPool(OrientGraphFactory.java:82)
at USPTO_MassProcessv1_2.main(USPTO_MassProcessv1_2.java:48)
Caused by: com.orientechnologies.orient.core.exception.ORecordNotFoundException: The record with id '#0:1' not found
at com.orientechnologies.orient.core.record.ORecordAbstract.reload(ORecordAbstract.java:311)
at com.orientechnologies.orient.core.record.impl.ODocument.reload(ODocument.java:352)
at com.orientechnologies.orient.core.type.ODocumentWrapper.reload(ODocumentWrapper.java:87)
at com.orientechnologies.orient.core.type.ODocumentWrapperNoClass.reload(ODocumentWrapperNoClass.java:69)
at com.orientechnologies.orient.core.metadata.schema.OSchemaShared$16.call(OSchemaShared.java:605)
at com.orientechnologies.orient.core.storage.OStorageAbstract.callInLock(OStorageAbstract.java:185)
at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage.callInLock(OLocalPaginatedStorage.java:1446)
at com.orientechnologies.orient.core.metadata.schema.OSchemaShared.load(OSchemaShared.java:600)
at com.orientechnologies.orient.core.metadata.OMetadataDefault$1.call(OMetadataDefault.java:114)
at com.orientechnologies.orient.core.metadata.OMetadataDefault$1.call(OMetadataDefault.java:110)
at com.orientechnologies.common.concur.resource.OSharedContainerImpl.getResource(OSharedContainerImpl.java:53)
... 7 more
Caused by: com.orientechnologies.orient.core.exception.ODatabaseException: Error on retrieving record #0:1 (cluster: internal)
at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.read(ODatabaseRaw.java:243)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.executeReadRecord(ODatabaseRecordAbstract.java:757)
at com.orientechnologies.orient.core.tx.OTransactionNoTx.loadRecord(OTransactionNoTx.java:64)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.reload(ODatabaseRecordTx.java:235)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.reload(ODatabaseRecordTx.java:39)
at com.orientechnologies.orient.core.record.ORecordAbstract.reload(ORecordAbstract.java:304)
... 17 more
Caused by: java.lang.NoClassDefFoundError: org/iq80/snappy/Snappy
at com.orientechnologies.orient.core.compression.impl.OSnappyCompression.uncompress(OSnappyCompression.java:39)
at com.orientechnologies.orient.core.storage.impl.local.paginated.OPaginatedCluster.readRecord(OPaginatedCluster.java:602)
at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage.readRecord(OLocalPaginatedStorage.java:1254)
at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage.readRecord(OLocalPaginatedStorage.java:1221)
at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.read(ODatabaseRaw.java:237)
... 22 more
Caused by: java.lang.ClassNotFoundException: org.iq80.snappy.Snappy
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 27 more

Andrey Lomakin

unread,
Mar 12, 2014, 7:14:11 AM3/12/14
to orient-database
Hi,
So reason is

On Wed, Mar 12, 2014 at 8:41 AM, Shishya <prab...@gmail.com> wrote:
Caused by: java.lang.ClassNotFoundException: org.iq80.snappy.Snappy

Do you have snappy jar in your classpath ?


--
Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

prabhat

unread,
Mar 12, 2014, 7:27:39 AM3/12/14
to orient-...@googlegroups.com
Hi Andrey,

I do have it in my classpath.
snappy-0.3.jar






--

---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/LRlrio5Qrx4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrey Lomakin

unread,
Mar 12, 2014, 7:30:06 AM3/12/14
to orient-database
Hi,
But it seems JVM do not think so, (because of Caused by: java.lang.ClassNotFoundException: org.iq80.snappy.Snappy )

What is value of system property  "java.class.path" in your application ?



--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

prabhat

unread,
Mar 12, 2014, 7:37:44 AM3/12/14
to orient-...@googlegroups.com
In 1.7rc2SS, I get following error

Exception in thread "main" com.orientechnologies.orient.core.exception.ODatabaseException: Cannot create database
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.create(ODatabaseRecordAbstract.java:275)
at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.create(ODatabaseWrapperAbstract.java:60)
at com.orientechnologies.orient.core.db.ODatabaseRecordWrapperAbstract.create(ODatabaseRecordWrapperAbstract.java:64)
at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getDatabase(OrientGraphFactory.java:65)
at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.setupPool(OrientGraphFactory.java:82)
at USPTO_MassProcessv1_3.main(USPTO_MassProcessv1_3.java:50)
Caused by: com.orientechnologies.orient.core.exception.ODatabaseException: Cannot create database
at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.create(ODatabaseRaw.java:126)
at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.create(ODatabaseWrapperAbstract.java:60)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.create(ODatabaseRecordAbstract.java:222)
... 5 more
Caused by: java.lang.IllegalStateException: Location passed in WAL does not exist, or IO error was happened. DB can not work in durable mode in such case.
at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWriteAheadLog.<init>(OWriteAheadLog.java:107)
at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWriteAheadLog.<init>(OWriteAheadLog.java:83)
at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage.initWal(OLocalPaginatedStorage.java:168)
at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage.create(OLocalPaginatedStorage.java:623)
at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.create(ODatabaseRaw.java:122)
... 7 more
Mar 12, 2014 11:36:49 AM com.orientechnologies.common.log.OLogManager log
INFO: Shutting down storage: test2...
Mar 12, 2014 11:36:49 AM com.orientechnologies.common.log.OLogManager log
INFO: Orient Engine shutdown complete

Shishya

unread,
Mar 13, 2014, 3:10:16 AM3/13/14
to orient-...@googlegroups.com
Hi,

I found that there is some other issue than plocal.
It works fine on local servers where WAL files can be accessed without sudo.
But on AWS, Java class needs to be run as sudo for direct read/write. But then Java class is not able to find the classes(all and any) when run as sudo either for remote or plocal.

Error is following when run with Sudo . The same runs fine(for remote) without sudo. Though this issue is unreleated now to Orientdb, but any help will be greatly appreciated.
----------------------------------------------------
Exception in thread "main" java.lang.NoClassDefFoundError: com/tinkerpop/blueprints/impls/orient/OrientGraphFactory
at MassProcessv1_4.main(USPTO_MassProcessv1_4.java:51)
Caused by: java.lang.ClassNotFoundException: com.tinkerpop.blueprints.impls.orient.OrientGraphFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 1 more
------------

Andrey Lomakin

unread,
Mar 13, 2014, 5:56:45 AM3/13/14
to orient-database
Do you mean that you start JVM using root user privielges ?


--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

prabhat

unread,
Mar 13, 2014, 6:08:05 AM3/13/14
to orient-...@googlegroups.com
For plocal, non-root users are not able to access WAL files, so have to use root



--

---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/LRlrio5Qrx4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.

Andrey Lomakin

unread,
Mar 14, 2014, 6:13:02 AM3/14/14
to orient-database
Hi,
It is not question of implementation but  file system permissions you use file system which does not allow to write access to the database folder, if we use permissions in database it was impossible to work with OrientDB on Windows because it does not have such permissions.

You should check your folder permissions.

prabhat

unread,
Mar 14, 2014, 6:21:16 AM3/14/14
to orient-...@googlegroups.com

Thanks Andrey
 But it is strange that remote is able to do so "www-data" but not others.
Reply all
Reply to author
Forward
0 new messages