I'm trying to create a new instance of OrientGraph database, as follows:
OrientGraph graph = new OrientGraph("local:C:/temp/graph/db");
graph.create(); //BUT no create method!!
anyhow, while sticking with the manual and do it with ODatabaseDocumentTx like:
db = new ODatabaseDocumentTx("plocal:c:/orientdb/db");
db.create();
....
db.shutdown();
then I want to get a session like:
OrientGraphFactory factory = new OrientGraphFactory("plocal:c:/orientdb/db", "admin", "admin");
OrientGraphNoTx g = factory.getNoTx();
try
{
}
finally
{
g.shutdown();
}
I got the following exception:
java.lang.IncompatibleClassChangeError: Expected static method com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.checkForGraphSchema(Lcom/orientechnologies/orient/core/db/document/ODatabaseDocumentTx;)
How Can I create a new graph database???
Thank you.
First, you should not use the "local" engine anymore, it is deprecated (your first example). Secondly, the way an OrientGraph must be created is clearly documented, see http://www.orientechnologies.com/docs/last/orientdb.wiki/Graph-Factory.html
The complete example which should work:
Finally, your reported error indicates a set of inconsistent jar files. You should:
Needed dependencies:
UPDATE:
For a complete example, see https://github.com/rmuller/graphdb-playground (under 'orientdb-embedded-graph')
After a wild struggling with V2 I went back to V.1.7.9 and everything works.
Maven Dependency: com.orientechnologies orientdb-graphdb 1.7.9
it seems that there are some unsolved issues with V.2.x I will do another PoC within a month or so.