neo4j rest API not working

2013-07-26T21:48:33

having problems with the neo4j java-rest-binding API

git clone https://github.com/neo4j/java-rest-binding
mvn clean package

Then got my JAR.

Tried this:

import org.neo4j.rest.graphdb.RestAPI;
import org.neo4j.rest.graphdb.RestAPIFacade;
import org.neo4j.rest.graphdb.entity.RestNode;
import org.neo4j.rest.graphdb.query.RestCypherQueryEngine;
import org.neo4j.rest.graphdb.util.QueryResult;
import static org.neo4j.helpers.collection.MapUtil.map;

import java.util.Map;

public class Connect {
    public static void main(String[] args) {
        System.out.println("starting test");
        RestAPI api = new RestAPIFacade("http://localhost:7474/");
        System.out.println("API created");
        final RestCypherQueryEngine engine = new RestCypherQueryEngine(api);
        System.out.println("engine created");

        QueryResult<Map<String,Object>> result = engine.query("start n=node({id}) return n", map("id",1));

        System.out.println("query created");
        System.out.println(result);


    for (Map<String, Object> row : result) {
        Object tagline = row.get("tagline");
        long id=((Number)row.get("id")).longValue();
        System.out.println("id is " + id);
        System.out.println(row.get("myRow"));
        }
   }
}

Added the neo4j rest and embedded libraries and got this error message. (BTW I have checked and there is a node 1 and the server is running locally)

starting test

Exception in thread "main" java.lang.NoClassDefFoundError: javax/ws/rs/core/Response$StatusType
at org.neo4j.rest.graphdb.RestAPIFacade.<init>(RestAPIFacade.java:294)
at Connect.main(Connect.java:20)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.ClassNotFoundException: javax.ws.rs.core.Response$StatusType
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 7 more

Any ideas?

Copyright License:
Author:「Badmiral」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/17883077/neo4j-rest-api-not-working

About “neo4j rest API not working” questions

What suggestions do you have for creating neo4j API to serve clients, if I already created a neo4j database? It seems there are two sets of API: 1) Rest API: https://neo4j.com/docs/rest-docs/current/
having problems with the neo4j java-rest-binding API git clone https://github.com/neo4j/java-rest-binding mvn clean package Then got my JAR. Tried this: import org.neo4j.rest.graphdb.RestAPI;
I am using Neo4j 2.0.0M4 community edition with Node.js with https://github.com/thingdom/node-neo4j to access the Neo4j DB server over REST API by passing Cypher queries. I have observed that the ...
I need some conceptual understanding of Neo4j REST api's usage. I went through the tutorial of neo4j RESt api and got some idea. So is it like these REST api's are used only to CREATE nodes and
Over the last couple of months I've been building up a Neo4j database. I'm finding Neo4j &amp; Cypher really easy to use and definitely appropriate for the kind of data that I'm working with. I'm
with the REST api traversal , is it possible to put loop structures in the body of the prune_evaluator ? according to this example : http://docs.neo4j.org/chunked/milestone/rest-api-traverse.html#r...
I am attempting to execute a MERGE function using Neo4j's REST API, and I am having a difficult time getting it to work. I have been leaning on the answer posted here, however even when I copy the...
I'm working on neo4j with the REST API. For this request : MATCH (n:Person)-[r*2]-(b) RETURN n,r,b When I display the result into the viewer/browser (localhost:7474). I haven't the intermediary
Is there an existing library that I can use that has the functionality: http://docs.neo4j.org/chunked/milestone/rest-api-transactional.html I've looked into https://github.com/neo4j/java-rest-bin...
I'm currently working a Neo4j REST API wrapper for nodejs (node-neo4j). Just making it ready for v2.0 of Neo4j My fork: https://github.com/Stofkn/node-neo4j of https://github.com/philippkueng/node...

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.