[orient-db] java.lang.NoSuchMethodError when connecting to an existing TinkerPop GraphDB

77 views
Skip to first unread message

Salvatore Piccione

unread,
Jul 18, 2011, 12:00:18 PM7/18/11
to orient-...@googlegroups.com
Hello,

I'm using OrientDB GraphED edition 1.0rc3 and, on the client side, I'm using orient 1.0rc4-SNAPSHOT and blueprints 0.8 (MAVEN).
When I try to connect to an existing GraphDB (it's empty but was created using com.orientechnologies.orient.client.remote.OServerAdmin) I get the following exception:

Exception in thread "main" java.lang.NoSuchMethodError: com.orientechnologies.orient.core.metadata.OMetadata.getIndexManager()Lcom/orientechnologies/orient/core/index/OIndexManager;
    at com.tinkerpop.blueprints.pgm.impls.orientdb.OrientGraph.openOrCreate(OrientGraph.java:389)
    at com.tinkerpop.blueprints.pgm.impls.orientdb.OrientGraph.<init>(OrientGraph.java:47)

I also tried to use
orient 1.0rc3 but I got the same exception.
Here is the code:

Orient.instance().registerEngine(new OEngineRemote());
OrientGraph graphDB = null;
try {
  graphDB = new OrientGraph ("remote:iot-at-work1/graphdb1","admin","admin");
  LOGGER.debug("Successfully connected to graphDB1");
} catch (Exception e) {
  if (graphDB != null)
    graphDB.shutdown();
  e.printStackTrace();
}


The log message is never displayed as the exception occures when I call OrientGraph constructor.

Do you have any suggestion?

Cheers,

Salvatore

Luca Garulli

unread,
Jul 18, 2011, 12:03:24 PM7/18/11
to orient-...@googlegroups.com
Hi,
yes you're using an old version of Blueprints. Use the libs contained in Graph(Ed) or get the last SNAPSHOT.

Lvc@

Salvatore Piccione

unread,
Jul 18, 2011, 12:15:15 PM7/18/11
to orient-...@googlegroups.com
Thanks for your hint!

I've updated the definition of Blueprints' MAVEN dependency and repository as follows:

<repository>
  <id>tinkerpop-repository</id>
  <name>TinkerPop Maven2 Repository</name>
  <url>http://tinkerpop.com/maven2</url>
  <snapshots>
    <enabled>true</enabled>
    <updatePolicy>always</updatePolicy>
  </snapshots>
</repository>

<dependency>

  <groupId>com.tinkerpop.blueprints</groupId>
  <artifactId>blueprints-orient-graph</artifactId>
  <version>0.9-SNAPSHOT</version>
</dependency>

...and now it works like a charm!

Thanks again!

2011/7/18 Luca Garulli <l.ga...@gmail.com>

Adolfo Rodriguez

unread,
Sep 10, 2011, 8:36:51 PM9/10/11
to OrientDB
Hi,

I have spent a while with the same issue on orientdb-
graphed-1.0rc5.zip. At the final, I found this release includes
blueprints-orient-graph-1.0-SNAPSHOT. In this version of blueprints-
orient-graph, class OrientElement has the method:

public Set<String> getPropertyKeys() {
Set set = this.rawElement.fieldNames();
set.remove("label");
return set;
}

which assumes ODocument#fieldNames() method returning a Set.

Method signature was changed to public String[] fieldNames() beofre
rc5 so it will throw NotSuchMethod Exceptions.

I just updated to a version of blueprints-orient-graph compiled on my
workspace and it worked again. Maybe someone else runs in the same
issue. It happens under the covers, for example, when you use Gremlin
in queries.

For next release, please remember to verify that the included
blueprints-orient-graph.jar compiles against OrientDB sources.

Thanks,

Adolfo







On Jul 18, 6:15 pm, Salvatore Piccione <salvo.pi...@gmail.com> wrote:
> Thanks for your hint!
>
> I've updated the definition of Blueprints' MAVEN dependency and repository
> as follows:
>
> <repository>
>   <id>tinkerpop-repository</id>
>   <name>TinkerPop Maven2 Repository</name>
>   <url>http://tinkerpop.com/maven2</url>
>   <snapshots>
>     <enabled>true</enabled>
>     <updatePolicy>always</updatePolicy>
>   </snapshots>
> </repository>
>
> <dependency>
>   <groupId>com.tinkerpop.blueprints</groupId>
>   <artifactId>blueprints-orient-graph</artifactId>
>   <version>0.9-SNAPSHOT</version>
> </dependency>
>
> ...and now it works like a charm!
>
> Thanks again!
>
> 2011/7/18 Luca Garulli <l.garu...@gmail.com>
>
>
>
>
>
>
>
> > Hi,
> > yes you're using an old version of Blueprints. Use the libs contained in
> > Graph(Ed) or get the last SNAPSHOT.
>
> > Lvc@
>
> > On 18 July 2011 18:00, Salvatore Piccione <salvo.pi...@gmail.com> wrote:
>
> >> Hello,
>
> >> I'm using *OrientDB GraphED edition 1.0rc3* and, on the client side, I'm
> >> using *orient 1.0rc4-SNAPSHOT* and *blueprints 0.8* (MAVEN).
> >> When I try to connect to an existing GraphDB (it's empty but was created
> >> using *com.orientechnologies.orient.client.remote.OServerAdmin*) I get
> >> the following exception:
>
> >> Exception in thread "main" java.lang.NoSuchMethodError:
> >> com.orientechnologies.orient.core.metadata.OMetadata.getIndexManager()Lcom/ orientechnologies/orient/core/index/OIndexManager;
> >>     at
> >> com.tinkerpop.blueprints.pgm.impls.orientdb.OrientGraph.openOrCreate(Orient Graph.java:389)
> >>     at
> >> com.tinkerpop.blueprints.pgm.impls.orientdb.OrientGraph.<init>(OrientGraph. java:47)
>
> >> I also tried to use *orient 1.0rc3* but I got the same exception.

Marko Rodriguez

unread,
Sep 10, 2011, 9:31:17 PM9/10/11
to orient-...@googlegroups.com
Hi,

It is not a good idea to use TinkerPop SNAPSHOTs with your projects as, given that they are SNAPSHOTs, the code base is changing. Moreover, the latest developements of the TinkerPop stack (e.g Blueprints 1.0 -- releasing on September 21st) has undergone lots of refactoring and thus, the API is changes (slightly) from day to day.

In general, its best to stick with stable releases or else code that works one day, will break another.

Good luck,
Marko.

http://markorodriguez.com

Reply all
Reply to author
Forward
0 new messages