J'ai une nouvelle version de neo4j-rest-graphdb-1.8-SNAPSHOT.jar. Mais j'ai des problèmes dès la sortie.Neo4j Java Rest Reliure: NoClassDefFoundError
J'installation de base/défaut de Neo4j en cours d'exécution, configuré avec un magasin de graphique valide:
Neo4j Version
Graphique Database noyau 1.8.M05
OS
Ubuntu 12.04 LTS
Java Version
"1.6.0_24" OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu3) OpenJDK 64 bits serveur VM (build 20,0-b12, mode mixte)
Une demande boucle suggère tout fonctionne bien:
$ curl http://localhost:7474/db/data/ -i
HTTP/1.1 200 OK
Content-Length: 809
Content-Encoding: UTF-8
Content-Type: application/json
Access-Control-Allow-Origin: *
Server: Jetty(6.1.25)
{
"extensions" : {
"CypherPlugin" : {
"execute_query" : "http://localhost:7474/db/data/ext/CypherPlugin/graphdb/execute_query"
},
"GremlinPlugin" : {
"execute_script" : "http://localhost:7474/db/data/ext/GremlinPlugin/graphdb/execute_script"
}
},
"node" : "http://localhost:7474/db/data/node",
"reference_node" : "http://localhost:7474/db/data/node/0",
"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",
"neo4j_version" : "1.8.M05-1-ge9cdca9"
Mais, en essayant la ligne suivante:
GraphDatabaseService graph = nouvelle RestGraphDatabase ("http: // localhost: 7474/db/data /");
... produit une exception:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/ws/rs/core/Response$StatusType
at org.neo4j.rest.graphdb.RestAPIFacade.<init>(RestAPIFacade.java:265)
at org.neo4j.rest.graphdb.RestGraphDatabase.<init>(RestGraphDatabase.java:44)
at com.tester.api.Neo4j.importer(Neo4j.java:185)
at com.tester.api.Neo4j.main(Neo4j.java:97)
Caused by: java.lang.ClassNotFoundException: javax.ws.rs.core.Response$StatusType
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 4 more
Citation de Neo4j Group (de Peter): Cela fonctionne, mais vous avez eu de la chance. Le regroupement de tous les fichiers jar en un seul peut écraser les fichiers qui existent avec un contenu différent sous le même emplacement dans différents fichiers jars entrants, tels que les fichiers du chargeur de service Java. Vous ne les avez pas, mais soyez conscient si vous incluez le e. g. Kernel et les jars d'entreprise qui enregistrent plus de types de cache. – Rob