tinkerpop/blueprints — Issue #184: Support Neo4j Relationship and Node Indexes with the same name
Author: maxdemarzi
Created: 2011-11-10 20:00:16+00:00
State: open

From https://github.com/neo4j/gremlin-plugin/issues/4

Nov 10, 2011 12:03:48 PM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException
SEVERE: The RuntimeException could not be mapped to a response, re-throwing to the HTTP container
java.lang.RuntimeException: Index already exists: test_index3
at com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph.createManualIndex(Neo4jGraph.java:124)
at com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph.loadIndices(Neo4jGraph.java:118)
at com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph.(Neo4jGraph.java:98)
at org.neo4j.server.webadmin.console.GremlinSession.getGremlinWrappedGraph(GremlinSession.java:140)
at org.neo4j.server.webadmin.console.GremlinSession.(GremlinSession.java:59)
at org.neo4j.server.webadmin.rest.SessionFactoryImpl.createSession(SessionFactoryImpl.java:50)
at org.neo4j.server.webadmin.rest.ConsoleService.getSession(ConsoleService.java:115)
at org.neo4j.server.webadmin.rest.ConsoleService.exec(ConsoleService.java:105)
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)

https://github.com/tinkerpop/blueprints/blob/master/blueprints-neo4j-graph/src/main/java/com/tinkerpop/blueprints/pgm/impls/neo4j/Neo4jGraph.java

public synchronized Index createManualIndex(final String indexName, final Class indexClass) {
if (this.indices.containsKey(indexName))
throw new RuntimeException("Index already exists: " + indexName);

Neo4jIndex index = new Neo4jIndex(indexName, indexClass, this);
this.indices.put(index.getIndexName(), index);
return index;
}

-------
this.indices is protected Map indices = new HashMap();

and doesn't account for node and relationship indices with the same name.