thinkaurelius / neo4j-gremlin-plugin

Gremlin for Neo4jServer 2.x
http://thinkaurelius.com
Apache License 2.0
30 stars 14 forks source link

Plugin doesn't show up in extensions #5

Closed gataky closed 9 years ago

gataky commented 9 years ago

I've opened up a ticket here https://github.com/neo4j-contrib/gremlin-plugin/issues/32 Wasn't sure where this ticket should go.

I've installed the plugin per the directions given. It actually works when I use curl from the command line with a simple query. The problem is when I try to get a list of extensions registered by the server, nothing shows up.

I've added this line to my config file and restarted the server

org.neo4j.server.thirdparty_jaxrs_classes=com.thinkaurelius.neo4j.plugins=/tp

Logs show "No provider classes found." which may be a clue?

Mar 18, 2015 4:14:15 PM com.sun.jersey.api.core.PackagesResourceConfig init
INFO: Scanning for root resource and provider classes in the packages:
  com.thinkaurelius.neo4j.plugins
Mar 18, 2015 4:14:15 PM com.sun.jersey.api.core.ScanningResourceConfig logClasses
INFO: Root resource classes found:
  class com.thinkaurelius.neo4j.plugins.GremlinPlugin
Mar 18, 2015 4:14:15 PM com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No provider classes found.
Mar 18, 2015 4:14:15 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.9 09/02/2011 11:17 AM'
Mar 18, 2015 4:14:16 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.9 09/02/2011 11:17 AM'
Mar 18, 2015 4:14:16 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.9 09/02/2011 11:17 AM'
Mar 18, 2015 4:14:16 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.9 09/02/2011 11:17 AM'

Testing the gremlin plugin with curl:

$ curl -s -G --data-urlencode 'script=g.V()' http://localhost:7474/tp/gremlin/execute
{"success":true,"results":[{"_id":0,"_type":"vertex"}]}

Trying to get a list of extension that are installed:

$ curl -s -G http://localhost:7474/db/data/
{
  "extensions" : {
  },
  "node" : "http://localhost:7474/db/data/node",
  "node_index" : "http://localhost:7474/db/data/index/node",
  "relationship_index" : "http://localhost:7474/db/data/index/relationship",
  "extensions_info" : "http://localhost:7474/db/data/ext",
  "relationship_types" : "http://localhost:7474/db/data/relationship/types",
  "batch" : "http://localhost:7474/db/data/batch",
  "cypher" : "http://localhost:7474/db/data/cypher",
  "indexes" : "http://localhost:7474/db/data/schema/index",
  "constraints" : "http://localhost:7474/db/data/schema/constraint",
  "transaction" : "http://localhost:7474/db/data/transaction",
  "node_labels" : "http://localhost:7474/db/data/labels",
  "neo4j_version" : "2.1.7"
}

Notice the extensions is an empty set

I would expect to see something like:

...
"extensions": { "GremlinPlugin": {"execute_script": "http://localhost:7474/tp/gremlin/execute"}}
...

Something along those lines.

I'm using a third party library to develop with Neo4j and it's expecting the extensions section to be populated with the plugins.

Am I missing something or is this a know bug?

Thanks

dkuppitz commented 9 years ago

The plugin won't show up as an extension, these are different kinds of "plugins".

NitinJamadagni commented 9 years ago

Hey, I followed the instructions, I've added this line to my config file and restarted the server

   org.neo4j.server.thirdparty_jaxrs_classes=com.thinkaurelius.neo4j.plugins=/tp

But on adding this I get the following error,NOTE:It starts just fine without adding the line to the config file

   WARNING: Max 1024 open files allowed, minimum of 40 000 recommended. See the Neo4j   manual. 
   Using additional JVM arguments:  -server -XX:+DisableExplicitGC  -Dorg.neo4j.server.properties=conf/neo4j-server.properties  -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties  -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:-OmitStackTraceInFastThrow
   Starting Neo4j Server...WARNING: not changing user
   process [7203]... waiting for server to be ready......... Failed to start within 120 seconds.
  Neo4j Server may have failed to start, please check the logs.

PS:I am running neo4j-community-2.1.7 and using tp3-2.1.6 version of the plugin,might that be the issue?

gataky commented 9 years ago

Thanks @dkuppitz. I didn't realize that there were two different types of plugins. Thanks for the clarification and I got it working.

gataky commented 9 years ago

@NitinJamadagni what do the logs say?

NitinJamadagni commented 9 years ago

console neo4j

I have added the console and neo4j logs, seems to be some compatibility issues?

Sorry for the trouble

dkuppitz commented 9 years ago

You're not using Java8, which is required by TP3.

NitinJamadagni commented 9 years ago

@dkuppitz thanks for the help,does the tp2 need java-8 to run?

dkuppitz commented 9 years ago

No, TP2 works with Java7.